This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

无效操作和指令陷阱

Other Parts Discussed in Thread: HALCOGEN

您好,《安全手册》里说“Cortex-R4F CPU 包括针对无效操作的诊断和可被用作安全机制的指令。很多此类陷阱在复位后不启用且必
须由软件配置。强烈建议安装软件句柄以支持硬件无效操作和指令陷阱。”,请问这个在软件上是怎么配置的?

  • Hi Wei,

        您提的问题都很有深度啊!

        我查了一下安全手册的英文原文是如下的:

        

        ARM Cortex-R4F CPU中有多种异常,比如上面提到的,但是我查下来,除了浮点单元的异常外,其他异常都是复位后自动打开的。

        我们的HALCoGen已经生成了一些基本的句柄入口,处理函数内部就要靠用户自己来编写了。

        

        安全手册这段中提到的“复位后不会自动打开的异常”应该是指浮点运算单元的异常。

       这些异常是:

    Floating-point inexact exception

    Floating-point overflow exception

    Floating-point underflow exception

    Floating-point invalid operation exception

    Floating-point divide-by-zero exception

    Floating-point input denormal exception

        这些异常信号受Secondary Auxiliary Control Register(第二辅助控制寄存器)的控制,复位后的默认状态是关闭,用户可以通过Secondary Auxiliary Control Register来打开这些异常。

        如何操作Secondary Auxiliary Control 寄存器: 

        MRC p15, 0, <Rd>, c15, c0, 0 ; Read Secondary Auxiliary Control Register
    
        MCR p15, 0, <Rd>, c15, c0, 0 ; Write Secondary Auxiliary Control Register
    
    
     详情可以参考ARM的技术手册:
        http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0363e/index.html
  • 呵呵,不好意思,总是打扰您。还有我想问下IEC61508的safeTI软件包什么时候公布啊?

  • Hi Wei,

        为了方便搜索,我把内容写在这个帖子了。

        请查。

        http://www.deyisupport.com/question_answer/microcontrollers/hercules/f/70/t/24807.aspx