liveBook · Manning

Flash memory

As explained in Embedded Software with Rust

Flash memory is nonvolatile semiconductor memory that retains data without power and can be electrically erased and rewritten.

Flash memory is nonvolatile semiconductor memory: it retains data without power and can be electrically erased and rewritten. In embedded systems, limited Flash capacity puts pressure on firmware size and data layout. section 4.1.1 section 1.1.2

A firmware section has a load memory address (LMA), where its initial contents are stored, and a virtual memory address (VMA), where it resides during execution. Code in .text and read-only data in .rodata generally remain in Flash. Initialized writable data in .data is stored in Flash but copied to RAM before main runs. The .bss section has no Flash load image; startup code zeroes it in RAM. section 4.1.1 section 4.1.3

.data :
  {
    *(.data .data.*)
  } > RAM AT > FLASH

  .bss (NOLOAD) :
  {
    . = ALIGN(8);
    *(.bss .bss.*)
  } > RAM
}

This linker-script fragment places .data in RAM with its load image in Flash, and reserves .bss in RAM without a load image. section 4.1.3

On Arm Cortex-M, the vector table is commonly placed at the beginning of Flash. Its first entry supplies the initial stack pointer; the second gives the reset handler address. Some microcontrollers alias physical Flash to address 0x00000000 at boot so the processor can find the table there. section 4.1.3 section 4.2.1

Flash aliasing at boot

On STM32 devices, physical Flash may start at 0x08000000. Boot configuration can map it to 0x00000000, where the processor looks for the vector table. section 4.2.1

How Embedded Software with Rust covers it

How deep it goes
Explains section placement, startup data movement, and boot aliasing rather than Flash programming procedures.
Examples
Uses linker-script section mappings and an STM32 boot-address alias to illustrate Flash placement.
What you can do after
Configure a linker script to place firmware sections in Flash and RAM for bare-metal startup.
How it connects
Connects Flash memory to RAM, linker scripts, startup initialization, vector tables, and memory aliasing.

Also explained in

Compare how 2 books explain flash memory →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Embedded Software with Rust. The section links point to the parts of the book it draws on.