Hi,
For performance reasons I need some functions (e.g. interrupt routines) to be executed from internal memory.
When I compile it seems no Ram is used for code yet. So I guess I have to tell the linker somehow which functions need to be executed from Ram.
How can I do that? I'm using MCUXpresso and the MIMXRT1010-EVK.
I did search the forum on this. And there are topics about it, but I have a hard time filtering this for the correct info.
I hope someone can help me with this.
Solved! Go to Solution.
Hi @simmania ,
Thank you so much for your interest in our products and for using our community.
I suggest you can refer this link wrote by a NXP expert.
https://www.nxpic.org.cn/module/forum/thread-623079-1-1.html
I use a MIMXRT1170-EVKB board for example, MCUXpresso IDE v24.9.25 version to do this validation.
It is same if you use MIMXRT1010 board, Please refer to what I have done.
I import a SDK demo "evkbmimxrt1170_igpio_input_interrupt_cm7"
In the next MCUXpresso IDE project config , the SRAM_DTC_cm7 space is specified for storing the readwrite segment.
Method 1: use __RAMFUNC()
In my project, I put function "EXAMPLE_GPIO_IRQHandler" to Ram.
the .map file describe the address of function EXAMPLE_GPIO_IRQHandler is in Ram.
Method 2: use Specify functions for custom sections
__attribute__((section("TestSection")))
This method is also working.
Wish it helps you.
If you still have question about it, please kindly let me know.
Best Regards
mayliu
When I put __DATA(RAM2) in front of the function
like this:
__DATA(RAM2) void ADC1_IRQHANDLER(void) {
.....
}
the function seems to be placed in SRAM_ITC (I assume this is ITCM ram).
But the program does not work. The HardFault_Handler(void) function is called. I do not know why.
What else do I need to do to make this work?
In which documentation should I be able to find the answer (I found it difficult ti find good documentation).
Is there some example somewhere? I guess executing a fast interrupt from ITCM is something more people need to do.
Hi @simmania ,
Thank you so much for your interest in our products and for using our community.
I suggest you can refer this link wrote by a NXP expert.
https://www.nxpic.org.cn/module/forum/thread-623079-1-1.html
I use a MIMXRT1170-EVKB board for example, MCUXpresso IDE v24.9.25 version to do this validation.
It is same if you use MIMXRT1010 board, Please refer to what I have done.
I import a SDK demo "evkbmimxrt1170_igpio_input_interrupt_cm7"
In the next MCUXpresso IDE project config , the SRAM_DTC_cm7 space is specified for storing the readwrite segment.
Method 1: use __RAMFUNC()
In my project, I put function "EXAMPLE_GPIO_IRQHandler" to Ram.
the .map file describe the address of function EXAMPLE_GPIO_IRQHandler is in Ram.
Method 2: use Specify functions for custom sections
__attribute__((section("TestSection")))
This method is also working.
Wish it helps you.
If you still have question about it, please kindly let me know.
Best Regards
mayliu
Thanks a lot, this worked.
I would like to read that article. But the link refers to a Chinese forum. Unfortunately I can not read Chinese.
Hi @simmania ,
You are welcome!
I 'm sorry I have no article about it in English form.
If your question is solved, please Accept as solution, and tell me to close this case, thanks.
Best Regards
mayliu