I'm working with 2 memories on my device, DDR and SRAM. The device is running a pre-OS code written in C and ARM.
I would like to conduct a DDR calibration, for that I need to copy a few functions to the SRAM, jump to it, run the calibration code, and go back to DDR when done.
In order to do so, I've modify my scatter file (.lds) so the relevant functions will be mapped to SRAM (instructions, data etc.). After compiling the image, he is copied into the DDR and start running from there.
My problem is as follows: How can I locate the starting address and size of these functions on DDR, so I'll be able to copy them to the SRAM and jump there?
Thanks you all in advance!
I am assuming you are talking about
ARMarchitecture:__attribute__((always_inline));on all related functions and compile with-fpic -fPICread here for more info.0xd1001000{r4-r15}on SRAM.pcto0xd1001000andspproperly to point the stack.{r4-r15}You can look at here for a good resource of how to use the right gcc flags.
here is a refernce from uboot - it doesn't jump back to the initial place: