Skip to main content
Explorer
April 12, 2024
Question

Copy Data from Rom to Ram

  • April 12, 2024
  • 2 replies
  • 1265 views

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

    This topic has been closed for replies.

    2 replies

    Graduate II
    April 12, 2024

    Use memcpy() ?

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

    Explorer
    April 12, 2024

    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.

    Graduate II
    April 12, 2024

    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.