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.
Hello,
I am working from flash, but I have a control loop ISR that I want to execute from RAM. But I am curious how "deeply" the following command from TI goes.
#pragma CODE_SECTION(control_loop_isr, "ramfuncs");
I call a global data structure and a bunch of functions that are called from this ISR "control_loop_isr". I was hoping that because I call them in this overall ISR, that they all get copied to RAM. However, I am not sure if everything the ISR touches gets copied to RAM by this command, or just the instruction calls. For instance, if I have a function MyFunction() that is called as part of the ISR, does the instruction to call it just get loaded to RAM or the entire function? In the end, I want everything in this ISR to execute as quickly as possible, including the global data structure.
Thank you,
Logan Snow
Hi Logan,
That is not the case. Only the function control_loop_isr will be placed in the ramfuncs section. Incase the function you are calling is inlined, it will remain as part of control_loop_isr function and be inside ramfuncs. Otherwise, those function will be part of .text section. You need to use the pragma for each of those functions. Alternatively, you can also use SET_CODE_SECTION pragma to set the section for all declarations below the pragma.
Eg:
#pragma SET_CODE_SECTION("section")
extern void func1();
extern void func2();
#pragma SET_CODE_SECTION()
Regards,
Veena
Veena,
Thank you. One follow up - how would I do this for the instantiation of my global data structure? I'd like all of that to be available in RAM for the functions to utilize quickly.
Thank you,
Logan
You can use similar pragma's like DATA_SECTION and SET_DATA_SECTION for global data.
Note that data will always be in RAM (except const, which by default is placed in Flash)
Regards,
Veena