How to execute code from RAM on nRF51 using GCC Environment
How to execute code from RAM on nRF51 using GCC Environment
Hi Anand,
You're seeing a conflict between the function you state to be placed in RAM, where it calls functions that have been placed in .text (flash) and therefore the linker throws an error back. In order to link the application properly, you will have to make sure that all functions called within the function that you have placed in RAM, also are located in RAM. If not, only partial segments of the call tree is present in RAM, thus invoking a higher current consumption. I would recommend that you look into the gcc linker scripts and create proper RAM-segments, or manually trace the call tree of your function and place the sub-functions into RAM using attribute. However; What I have to ask is which functions do you need to place in RAM? Normally you want time-consuming functions to be placed in RAM, for instance flash-writing operations, or interrupt functions.
Cheers, Håkon
Hi Anand,
You're seeing a conflict between the function you state to be placed in RAM, where it calls functions that have been placed in .text (flash) and therefore the linker throws an error back. In order to link the application properly, you will have to make sure that all functions called within the function that you have placed in RAM, also are located in RAM. If not, only partial segments of the call tree is present in RAM, thus invoking a higher current consumption. I would recommend that you look into the gcc linker scripts and create proper RAM-segments, or manually trace the call tree of your function and place the sub-functions into RAM using attribute. However; What I have to ask is which functions do you need to place in RAM? Normally you want time-consuming functions to be placed in RAM, for instance flash-writing operations, or interrupt functions.
Cheers, Håkon