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.

run ime error

Other Parts Discussed in Thread: SYSBIOS

Hi 

I'm using CCS6 , tirtos_tivac_2_01_00_03

tirtos_tivac_2_01_00_03

xdctools_3_30_04_52_core 

and i'm working on an errors logging task , I need to generate a runtime error , like an array out of boundry or a division by zero 

I've tried to divide a nubmer by zero and accessing array out of its ranger , that worked with no error .

Help please

thanks

  • To enable divide-by-zero exceptions, you need to configure the M4 core's NVIC accordingly.

    Here is an example of how to do that statically:

      var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
      m3Hwi.nvicCCR.DIV_0_TRP = 1;

    The 'nvicCCR' configuration parameter has fields that correspond to the CCR register within the NVIC:

          STKALIGN, BFHFNMIGN, DIV_0_TRP,  UNALIGN_TRP,  USERSETMPEND, NONEBASETHRDENA

    In the example code, I have set the DIV_0_TRP bit to 1, which results in an exception when an attempt to divide-by-zero is detected. By default, this bit is NOT SET, which means that the divide-by-zero occurs, it simply results in a quotient of zero.

    Here is a link that describes the CCR register bits;

       http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/Bhcjabhi.html

    Alan