Skip to main content
GPHIL.1
Associate 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

TDK
TDKBest answer
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.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
mƎALLEm
Technical Moderator
February 12, 2024

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

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
GPHIL.1
GPHIL.1Author
Associate 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

 

Tesla DeLorean
Guru
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?

 

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