How to execute code from RAM on nRF51 using GCC Environment
How to execute code from RAM on nRF51 using GCC Environment
Hi Håkon,
function2() has variable assignments like saving data from local variable to global variable, and itos() and memcpy() function and also some function which are related to our application are called.
I just did one simple experiment like below code which does not have any memcpy or memcpy.
void toggle_GPIO(); int main(void) { toggle_GPIO(); }
attribute((used, long_call, section(".data"))) void toggle_GPIO(void) { nrf_gpio_pin_set(NRF_GPIO0); nrf_gpio_pin_clear(NRF_GPIO0); }
when I build it I got the error "d:..........Source/main.c:190:(.data+0xc): relocation truncated to fit: R_ARM_THM_CALL against `nrf_gpio_pin_clear".'
Is the section(".data") is the proper section name we are putting. Do I need to give some other section name instead of ".data"? or do I need to change any thing in the gcc_startup_nrf51.s or Makefile.common or in linker files?
could you please share your email id ? Regards, Anand
Hi Håkon,
function2() has variable assignments like saving data from local variable to global variable, and itos() and memcpy() function and also some function which are related to our application are called.
I just did one simple experiment like below code which does not have any memcpy or memcpy.
void toggle_GPIO(); int main(void) { toggle_GPIO(); }
attribute((used, long_call, section(".data"))) void toggle_GPIO(void) { nrf_gpio_pin_set(NRF_GPIO0); nrf_gpio_pin_clear(NRF_GPIO0); }
when I build it I got the error "d:..........Source/main.c:190:(.data+0xc): relocation truncated to fit: R_ARM_THM_CALL against `nrf_gpio_pin_clear".'
Is the section(".data") is the proper section name we are putting. Do I need to give some other section name instead of ".data"? or do I need to change any thing in the gcc_startup_nrf51.s or Makefile.common or in linker files?
could you please share your email id ? Regards, Anand