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.

wrong code generation



Hello, all

The CCS Version: 6.1.1.00022 generates asm code missing statement from C source.

Here is the C and generated assembly source code.

I'm trying to set up a new irq handler, but the expression PieVectTable.TINT2 = BL_WD_TIMER2_ISR_WDOFF is missed in asm generated code... 

No errors or warnings were reported.

I'm using --opt_level = 4 (Whole program optimization)

Speed vs size treadoffs = 5.

Maybe it's a coincidence, but there was no problems with this statement and with proper working of this isr routine until I previously manually clear PIEFR register (what is strictly not recommended) and have another Timer2 isr routine executing.

Help please.

  • Do you by any chance write to PieVectTable.TINT2 anywhere else in the code. The optimizer might remove this statement if PieVectTable.TINT2 is rewritten later. Make sure that PieVectTable is defined as volatile
  • Mitja, thank you, you are right, I write to PieVectTable elsewhere in code.

    I use register variable definitions from files supplied by TI. All register variables was defined as volatile, but PieVectorTable not. For eliminating this error,  PieVectTable in files DSP2802x_PieVect.h and DSP2802x_GlobalVariableDefs.c should be defined as volatile.

    Thank you!

  • Hi Konstantin,
     

    Konstantin Shirokov said:


    Mitja, thank you, you are right, I write to PieVectTable elsewhere in code.

    I use register variable definitions from files supplied by TI. All register variables was defined as volatile, but PieVectorTable not. For eliminating this error, PieVectTable in files DSP2802x_PieVect.h and DSP2802x_GlobalVariableDefs.c should be defined as volatile.

    Thank you!


     
    The 'volatile' was added to the PieVectTable variable starting with header files v2.20. The latest is now v2.30. Please check that you are using the latest header files.
     
    Regards,
    David