Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: Code Composer Studio v5.5 (Porting from IAR)

$
0
0

I have a new question while working on migrating our code from IAR to CCS. We have separate bootloader and application firmware projects and the application firmware image has to include the address of the bootloader’s entry function. To achieve this, we edit the linker file so that the reset vector is placed into a different location rather than 0xFFFE and then we declare a const variable at address 0xFFFE in the code using the @ operator in IAR. To achieve this under CCS I’ve been referring to  the “Code Composer Studio v5.5 User’s Guide for MSP430” document found here: http://www.ti.com/lit/ug/slau157z/slau157z.pdf

 Page 25 (B.3.2 Data Placement Into Named Segments) describes using #pragma DATA_SECTION() directive. I declared a section named “.bootreset” at 0xFFFE in the linker command file and used DATA_SECTION() pragma described to declare and initialize a constant variable which contains the address of our bootloader’s entry point, like this:

 

#pragma DATA_SECTION(bootloaderResetVector, ".bootreset")

const uint16_t bootloaderResetVector = (uint16_t)APP_BOOTLOADER_START;

 

However the const variable bootloaderResetVector is not included in the output image and it is also not included in the map file. I believe this is because it is not referenced anywhere else and the linker automatically removes unused variables from the output. IAR’s compiler did the same and we had to use the __root directive when declaring the variable, which prevents the linker from removing it if it’s not referenced. However I have not found any way to do this in CCS.

 

We also have other const data in the application firmware that has to be at a specific location in the application image and must not be excluded by the linker so it is important that we are able to do this.

 


Viewing all articles
Browse latest Browse all 91752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>