Part Number: TMS320F28379D
Other Parts Discussed in Thread: CONTROLSUITE
Tool/software: Code Composer Studio
Hi,
when I load my code to RAM instead to FLASH the fist instruction at the entry of main is replaced by a ESTOP0. The overwritten instruction moved the stackpointer. As this is missing in RAM execution moves the stackpointer, the stack underflows and overwrites other code. Eventually the application crashes.
When debugging the MCU also stops twice at the main entry.
Disassembly when loaded to RAM:
main():
014405: 7625 ESTOP0
40 volatile boolean_T runModel = 1;
014406: 56BF0141 MOVB *-SP[1], #0x01, UNC
41 float modelBaseRate = 0.2;
014408: 2844CCCD MOV *-SP[4], #0xcccd
01440a: 28433E4C MOV *-SP[3], #0x3e4c
42 float systemClock = 200;
01440c: E8021A40 MOVIZ R0, #0x4348
01440e: E2030046 MOV32 *-SP[6], R0H
43 c2000_flash_init();
Disassembly when loaded to FLASH:
main():
0816eb: FE06 ADDB SP, #6
40 volatile boolean_T runModel = 1;
0816ec: 56BF0141 MOVB *-SP[1], #0x01, UNC
41 float modelBaseRate = 0.2;
0816ee: 2844CCCD MOV *-SP[4], #0xcccd
0816f0: 28433E4C MOV *-SP[3], #0x3e4c
42 float systemClock = 200;
0816f2: E8021A40 MOVIZ R0, #0x4348
0816f4: E2030046 MOV32 *-SP[6], R0H
43 c2000_flash_init();
The code is generated using Simulink and the embedded coder. CCS Version is 6.2.
As far as I can see the only difference in the build process is --define=BOOT_FROM_FLASH=0/1 .
What could be the reason for this?
Best regards,
Thomas.
