Skip to main content
Visitor II
February 12, 2024
Solved

Linker script: what are the differences between XXX_FLASH.id and XXX_RAM.id?

  • February 12, 2024
  • 2 replies
  • 2472 views

Hello,

Can you tell me the differences between two files linker script

STM32... FLASH.id and STM32...RAM.id

Regards,

 

 

 

    This topic has been closed for replies.
    Best answer by TDK

    FLASH puts the program in FLASH. RAM puts it in RAM. Since you want your program to stay in memory after power is lost, you typically want the FLASH file.

    I don't really understand why they include the RAM linker script at all. It's not very useful.

     

    2 replies

    TDKAnswer
    Super User
    February 12, 2024

    FLASH puts the program in FLASH. RAM puts it in RAM. Since you want your program to stay in memory after power is lost, you typically want the FLASH file.

    I don't really understand why they include the RAM linker script at all. It's not very useful.

     

    Technical Moderator
    February 12, 2024

    It could be useful for quick tests or benchmarks like system performance or power consumption.

    GPHIL.1Author
    Visitor II
    February 12, 2024

    Thanks for response,

    I use the flash.id to declare a backupsram section

    like

    MEMORY

    {

    RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K

    FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* Memory is divided. Actual start is 0x08000000 and actual length is 2048K */

    DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K

    RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K

    RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K

    ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K

    BKPRAM (rw) : ORIGIN = 0x38800000, LENGTH = 4k

    }

     

     

    .save_data (NOLOAD) :

    {

    . = ALIGN(4);

    . = ABSOLUTE(0x38800000);

    . = ALIGN(4);

    } >BKPRAM

     

    Graduate II
    February 12, 2024

    It's LD (Lima Delta) not id

    The RAM version would be to produce an object that's delivered / loaded directly into ram and executed in place, rather the where the core is in FLASH, and unpacks / initializes RAM at each startup.

    Which STM32, the MPU or MCU variants?