Tool/software: Code Composer Studio
My situation involves transitioning from a bootloader to application code. I'm using a TMS320F28068 MCU. My bootloader resides in sector A of flash. If it doesn't detect that code needs be downloaded to flash, it should transition to the application code which is in sectors B to H. I'm using the linker command file to make sure the code is separated like this. My bootloader and application code all reside in one CCS project.
I noticed that when I make changes to the application code, it would load fine using my bootloader (meaning that the application code was correctly loaded) but it wouldn't transition out of the bootloader after reset. Using Code Composer and the JTAG port, I examined the disassembly. I did this for one version of my code and another version. In each version I never modified the bootloader code. Rather, I modified the application code only. Below are two screen shots of the disassembly (each from a different version).
My "main()" function is in sector A. This calls my bootloader. "main_apl()" is the function at the start of the application code (which again is in sectors B to H). As you can see, at address 0x3F4268, the contents of that address changes even though they are both calls to "main_apl". In the first one, the contents of 0x3F4268 is 767E2C61 and the other is 767E2C3D. This is a problem because the bootloader only writes to sectors B to H. Thus, the code might load correctly, but the call from sector A to go to the application isn't the same. This would prevent a successful transition between the bootloader and the application code.
My question is this: how can I go to "main_apl" from the bootloader section while keeping the contents of sector A constant between different compilations? I was thinking about replacing "main_apl();" with "asm( "LCR 0x3D8000)", but how do I make sure from the linker command file that the function will always stay at 0x3D8000?
Thanks.
Syed