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.

Program often go to the illegal address 0x210642 and then jump to illegal interrupt, when using RPTB instruction and several interrupts open.

Other Parts Discussed in Thread: CONTROLSUITE

   

Program often go to the illegal address 0x210642 and then jump to illegal interrupt, every a few minutes to several hours.

There is a main loop and four different interrupts list below(low to high priority):

Timer2_Int: the lowest priority interrupt, which calls the TIFFT128 function in VCU2 lib;

SCIAInt9_ISR:Sci communication, while uses the float point math, can interrupt the Timer2_Int;

EPWM10_ISR and TIMER0_ISR:high level interrupt,which can interrupt the other interrupts;

All code is written in “C”.

 

CPU: cpu1 of 28377D revB

CCS Version :CCS 6.1, ti-cgt-c2000_6.2.5

Lib: rts2800_fpu32.lib, c28x_fpu_dsp_library_tmu0.lib, c28x_vcu2_library_fpu32.lib(V2_00_00_00)

 

Problem description:

         When break in the 0x210642, I read the registers and stack data( as list below). It seems that before go to 0x210642, RPTB block is running and interrupt 2 occur, and when the interrupt 2 is returning(,just doing "POP RB" instruction), a new interrupt 3 arriving, then before or after the new interrupt 3 is over, the code jump off. From the DP and IER value, it looks like the code is in interrupt 2 (SCIAInt9_ISR) just now.

RB: 0x4FE8000B (or other value, but always 0x4FE8XXXX)

Stack:

0x001E 0x6A1A  0x03C3 0x0905 0x001F 0x6D4A 0x0001(Addr in Timer2_Int, in the RPTB block of _CFFT_unpack function) 0x6F00 0x0001 0x00C1(SP position,st0) 0x0008(T) 0x0030(AL) 0x0008(AH) 0x0040(PL) 0x0000(PH) 0x00A0(AR0) 0x001E(AR1) 0x8A1A(ST1) 0x03A0(DP) 0x0005(IER) 0x001F 0x66E9 0x0001(Addr to “NASP” in SCIAInt9_ISR, after the “POP RB”, before “IRET”) 0x05B2 0x0000 0x000B 0x8FE8 0x0000 0x0000 0x004D 0x0008 0x0448 0x0000 0xFFFF 0x0000 0xB5F0 0x0000 0xE32A 0x0000 0x0603 0x0000 0x05B2  0x0000 0x3333 0x3F33 0x0000 0x0000 0xDB58 0x3F40 0x69DE 0x0001(Addr in Timer2_Int, just follow the LCR _CFFT_unpack function) 0x0018 0x0002 0xF09D 0x0000 0xC040 0x0000 0x0000 0x0000 0xF100

 

Related code:

Code In Timer2_Int:

_CFFT_unpack: (c28x_vcu2_library_fpu32.lib )

CFFT_CONTEXT_SAVE

……

    .align    2

0x16D48    RPTB      _CFFT_unpack_loop, AR1

         ……

_CFFT_unpack_loop:

0x16D69     ……

    CFFT_CONTEXT_RESTORE

    LRETR

 

70                         CFFT_unpack(handleCFFT);

0169da:      MOVL         XAR4, *-SP[20]

0169db:      SPM          #0

0169dc:  LCR          $C:/ti/controlSUITE_Packaging/libs/dsp/VCU/ v2_00_00_00/source/ vcu2 /fft/ vcu2_cfft_utils.asm: 178:460$

71                  asm("   NOP");

0169de:   7700        NOP         

0169df:   FF69        SPM          #0

0169e0:   FE94        SUBB         SP, #20

0169e1:   0006        LRETR       

 

Code in SCIAInt9_ISR

0166d9:   E2AF03BE    MOV32        R3H, *--SP, UNCF

0166db:   E2AF02BE    MOV32        R2H, *--SP, UNCF

0166dd:   E2AF01BE    MOV32        R1H, *--SP, UNCF

0166df:   E2AF00BE    MOV32        R0H, *--SP, UNCF

0166e1:   E28000BE    MOV32        STF, *--SP

0166e3:   C5BE        MOVL         XAR7, *--SP

0166e4:   C4BE        MOVL         XAR6, *--SP

0166e5:   83BE        MOVL         XAR5, *--SP

0166e6:   8ABE        MOVL         XAR4, *--SP

0166e7:   87BE        MOVL         XT, *--SP

0166e8:   FFF1        POP          RB

0166e9:   7617        NASP        

0166ea:   7602        IRET    

 

Please analyze the problem for me, thanks.