Subject: instruction RPTB seems to cause PC going crazy
Package: TMS320F28069PZT
CA-31AYGRW
G4
CCS: Version: 6.1.1.00022
C Compiler: c2000_6.2.5, no optimization
Math library: basic rts2800_fpu32.lib
Emulator: XDS200 USB JTAG (not relevant)
Hardware: custom board
Symptoms: It seems that the Program Counter (PC) goes crazy when 4 interrupts are nested and a RPTB instruction resides at a specific location and is executed 6 times. The issue happens ca. 10-15 minutes after reset. The issue does not happen anymore if either
1) the RPTB code is shifted by some words (e.g.2, 4, 6, 8), or
2) the fourth interrupt source is disabled, or
3) the RPTB instruction is replaced by two NOPS, causing the block to be executed just once without modifying the mapping, or
4) the RPTB instruction is in place but executed just once or twice(?) (counter=0 or 1).
The application has been compiled without optimization. I have checked that the compiler inserts a PUSH RB code on every interrupt entry, as it should be.
The interrupts are nested as follows:
main(), interrupted by …
… timer1() = int.13, which calls SQRT() and is interrupted by …
… timer0() = int.1.7, interrupted by …
… adc() = int.1.1, interrupted by …
… SpiA_RX() = int.6.1
The math library function sqrt() which executes RPTB, resides in flash at address 0x3de67c. Displacing sqrt() by few bytes, the issue doesn’t happen anymore.
Thanks for any hint helping me out of the darkness :-)