Difference between revisions of "SAMD Flash Overview"

From KONNEKTING Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
Applicable for SAMD21x18 with 256k FLASH
 +
 +
'''EFU - External Flash Update'''
 
{| class="wikitable"  
 
{| class="wikitable"  
 
!style="text-align:center"|address
 
!style="text-align:center"|address
Line 9: Line 12:
 
|-
 
|-
 
|0x02000-0x05FFF
 
|0x02000-0x05FFF
|0x4000 (16k)
+
|0x3FFF (16k)
|2nd stage update bootloader
+
|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'''
 +
{| class="wikitable"
 +
!style="text-align:center"|address
 +
!style="text-align:center"|size
 +
!style="text-align:center"|Description
 +
|-
 +
|0x00000-0x01FFF
 +
|0x2000 (8k)
 +
|Arduino Bootloader
 +
|-
 +
|0x02000-0x05FFF
 +
|0x3FFF (16k)
 +
|2nd stage update bootloader, last 256 bytes (0x05F00-0x05FFF) Bootloader EEPROM
 
|-
 
|-
 
|0x06000-0x21FFF
 
|0x06000-0x21FFF
Line 21: Line 49:
 
|-
 
|-
 
|0x3E000-0x3FFFF
 
|0x3E000-0x3FFFF
|0x2000(8k)
+
|0x2000 (8k)
 
|8k virtual "flash EEPROM"
 
|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.
 +
#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)