Difference between revisions of "SAMD Flash Overview"

From KONNEKTING Wiki
Jump to navigation Jump to search
 
Line 55: Line 55:
  
 
Some additional information:
 
Some additional information:
SAMD21G18A has 256 KByte FLASH
+
*SAMD21G18A has 256 KByte FLASH
Page size is 64 Byte
+
*PAGE size is 64 Byte
Row has 4 pages.
+
*One ROW has 4 pages.
Before a page can be written, the row that contains the page must be erased.
+
*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)
+
=> 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.
 +
#So you have to read the data of this 3 pages to an array
 +
#add data of page 1 to this array
 +
#erase whole row (=pages 0,1,2,3)
 +
#and then write whole row(=pages 0,1,2,3)

Latest revision as of 22:22, 20 March 2018

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)