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:
Hi,
The program structure I am testing involves multiple functions that get called from a one or two ISRs.
The program is loaded to the flash memory and to allow execution from RAM I included #pragma CODE_SECTION(".TI.ramfunc"); . Do I need to do this for all the functions that get called inside the ISRs or are the functions automatically executed from RAM? . I also have some global variables. Do I need to change the way they are defined?
Thank you,
Aditya
Hi Aditya,
You need to include the #pragma CODE_SECTION(".TI.ramfunc") for all the functions that is loaded to flash and executed from RAM.
Please have a look at similar thread - (+) CCSTUDIO-C2000: issue about the CODE_SECTION Pragma - C2000 microcontrollers forum - C2000︎ microcontrollers - TI E2E support forums
Thanks
Aswin
Hi Aswin,
Thanks for the link to the thread. I did not understand the effect of optimization.
Basically if I have
interrupt void ISR1() { function1(); } void function1() { Statements...; }
Do I need to include it just as
#pragma CODE_SECTION(".TI.ramfunc") interrupt void ISR1() { function1(); } void function1() { Statements...; }
OR
#pragma CODE_SECTION(".TI.ramfunc") interrupt void ISR1() { function1(); } #pragma CODE_SECTION(".TI.ramfunc") void function1() { Statements...; }
Thanks,
-Aditya
Hi Aditya,
You need to follow the second approach. You need to add it before the function that is to be executed from RAM.
Please take reference from driverlib code from flash.h/.c files for these #pragma defines.
We need to add it individually for all the fiunctions.
Thanks
Aswin
Thanks for the clarification. Other than reduced performance, would it have any problems if I do not include this for all functions that are being called by ISR1() ?
Thank you,
Aditya
Hi Aditya,
If you need to execute from RAM, it should be having the Pragma format.
There will not be other problems if you do not include all the functions.
I am closing this ticket for now, let me know if you need further help.
Thanks
Aswin