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.
Tool/software: Code Composer Studio
Hi,
Can I put function in specific ROM location?
Say If I have Serial code, and I want all the serial function to go in FLASHB, how do I c do this? How to mention this in linker file?
Whole idea is to use flash API to flash specific code.
The general method has three steps.
Step 1 is done in the C source. Steps 2 and 3 are done in the linker command file.
Perform step 1 with #pragma SET_CODE_SECTION, or #pragma CODE_SECTION, or the GCC function attribute section. You can read about the pragmas in the C2000 compiler manual. GCC function attributes are documented in many places on the web. For now, I presume you use the section name "serial_code".
In the linker command file, I presume you already have a memory range configured with the name FLASHB. In that case, in the SECTIONS directive, you can write ...
serial_code > FLASHB
This one line performs steps 2 and 3. All the input sections named "serial_code" are collected together into an output section also named "serial_code". Then that output section is allocated to the memory range named FLASHB.
To understand steps 2 and 3 better, please see the article Linker Command File Primer.
Thanks and regards,
-George