cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Data from Rom to Ram

rohitkumarkv07
Associate II

how to copy  sdata from rom to ram in stm32f407 board.

3 REPLIES 3

Use memcpy() ?

Check startup_f4xx.s for code that copies statics and Linker scripts for symbols.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rohitkumarkv07
Associate II

I develop my Mcu driver code for stm32fdiscovery board by using two functions Mcu_Init and Mcu_InitClock.

But when I try to flash my code, I didn't get the values of register there .

Can you help me out with this.

Can you buy me coffee?

With the GNU/GCC model you typically use the linker script (.LD) to stage RAM data in ROM so at startup you can copy it. Code in the startup.s source file uses the symbols to determine the location and size of this data, and then has the assembler equivalent to memcpy() to move from the ROM staging area to the RAM destination.

Perhaps look at some of ST's supplied examples, and some college level texts on linkers, compilers, and embedded programming.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..