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.

ITRAP0 Causing ILLEGAL_ISR

Other Parts Discussed in Thread: TMS320F28027

Hello, I am using Code Composer Studio Version 3.3.81.28 wtih BIOS 5.33.01 and Code Generation Tools v5.1.0.

 

My target chip is the TMS320F28027 and used emulator is the SD XDS510LC.

 

I have successfully integrated sample code for FIR, ADC, and PWM operation. However, when I add one line of code to my modified program, the compiler inserts a sequence of ITRAP0 statements into my assembled code, which then throw me to the ILLEGAL_ISR handler.

 

The line of code simply sets a register in the PWM module as follows: EPwm1Regs.DBCTL.bit.POLSEL = 2; 

 

Without this line, my code appears to compile to sensible assembly. With this line, opcode 0000 (ITRAP0) is inserted a specific address and repeated about 5 times.

 

Please let me know what other information I may provide to help get me through this FRUSTRATING problem.

 

Thanks!

 

  • The compiler does not generate ITRAP0 instructions.  Most likely, that bit of memory is somehow overwritten with 0 between when execution begins and when execution reaches that point.  You can verify this by examining that bit of memory right before execution begins.  Please let me know if I have guessed correctly.  If so, then I need to refer you to another forum.

    Thanks and regards,

    -George

     

     

  • George,

     

    Thanks for the quick response. You are correct, program/data memory is being overwritten during the c_int00 call. Any information on how to resolve this problem is greatly appreciated.

     

    Thanks!

     

    - Chris

  • Chris,

    it looks like a collision between sections during runtime.  A static collision would be detected by the linker, but of course it cannot spot any runtime issues.  The c_int00 basically allocates the defined size for stack, and copies initial values from .cinit to global variables (.ebss). Finally c_int0 calls main.

    Without any other information about your setup it is difficult to help.

    Regards

      

  • Hi  all:

    i have  also encountered this issue ,especially in my SCI_init(), i doubt that if my CMD cann`t be configured correctly, in CCS`s "build option", i select a optimization level-3, please help to analysis what cause this?,my .map file as attachment, thans a lot

    2043.mymap.txt