SAMD Flash Overview

From KONNEKTING Wiki
Jump to navigation Jump to search

Applicable for SAMD21x18 with 256k FLASH

EFU - External Flash Update

address size Description
0x00000-0x01FFF 0x2000 (8k) Arduino Bootloader
0x02000-0x05FFF 0x3FFF (16k) 2nd stage update bootloader, last 256 bytes (0x05F00-0x05FFF) Bootloader EEPROM
0x06000-0x3DFFF 0x38000 (224k) Sketch
0x3E000-0x3FFFF 0x2000 (8k) 8k virtual "flash EEPROM"


IFU - Internal Flash Update

address size Description
0x00000-0x01FFF 0x2000 (8k) Arduino Bootloader
0x02000-0x05FFF 0x3FFF (16k) 2nd stage update bootloader, last 256 bytes (0x05F00-0x05FFF) Bootloader EEPROM
0x06000-0x21FFF 0x1C000 (112k) Sketch
0x22000-0x3DFFF 0x1C000 (112k) Update
0x3E000-0x3FFFF 0x2000 (8k) 8k virtual "flash EEPROM"


Some additional information:

  • SAMD21G18A has 256 KByte FLASH
  • PAGE size is 64 Byte
  • One ROW has 4 pages.
  • Before one PAGE can be written, whole ROW that contains this PAGE must be erased.

=> the minimum writeble amount of data is 256 bytes (1 ROW/4 PAGES).

Example: you will write some bytes to page 1. Pages 0,2 and 3 are on the same ROW. Pages 0,2 and 3 contains already some date.

  1. So you have to read the data of this 3 pages to an array
  2. add data of page 1 to this array
  3. erase whole row (=pages 0,1,2,3)
  4. and then write whole row(=pages 0,1,2,3)