Fingerprint MCU RAM and Flash

Overview

The fingerprint firmware divides flash into three sections: RO, Rollback, and RW. The RO (Read-only) section contains a minimal set of code to check the signature of the code in RW; it’s essentially a bootloader and once a device enters production it never changes. The RW section is the portion of flash that runs the matching algorithm and is the portion that we update over time. The Rollback section consists of two separate flash sectors that store the minimum RW version that is allowed to run; this prevents attacks where an older version of RW firmware has a security vulnerability, and we want to prevent it from ever being loaded again (even though it’s valid and will pass the signature check). The fingerprint firmware also uses the rollback section to store the entropy used for the encryption key that protects the fingerprint templates.

The amount of RAM and flash used is specific to the sensor and matching algorithm used. After building the FPMCU firmware (e.g., make BOARD=bloonchipper), the amount of flash and RAM remaining will be printed out.

STM32H743 (Dartmonkey)

Total Flash: 2 MB

Total SRAM: 1 MB, but 864 KB is “user SRAM”. See Section 2.4 Embedded SRAM for more details.

Flash

Flash sectionSizeAmount Used
Read-only (RO)768 KBSee make BOARD=dartmonkey output.
Rollback256 KB total (two 128 KB sectors)44 bytes in each of the two sections
Read-write (RW)1024 KBSee make BOARD=dartmonkey output.

Layout

Flash sectorFlash sector sizeOffsetFirmware Region
1128 KB0RO (768 KB)
2128 KB0x20000 (131072)...
3128 KB0x40000 (262144)...
4128 KB0x60000 (393216)...
5128 KB0x80000 (524288)...
6128 KB0xA0000 (655360)...
7128 KB0xC0000 (786432)Rollback (256 KB)
8128 KB0xE0000 (917504)...
9128 KB0x100000 (1048576)RW (1024 KB)
10128 KB0x120000 (1179648)...
11128 KB0x140000 (1310720)...
12128 KB0x160000 (1441792)...
13128 KB0x180000 (1572864)...
14128 KB0x1A0000 (1703936)...
15128 KB0x1C0000 (1835008)...
16128 KB0x1E0000 (1966080)...

STM32F412CG (Bloonchipper)

Total Flash: 1 MB

Total SRAM: 256 KB

Flash

Flash sectionSizeAmount Used
Read-only (RO)128 KBSee make BOARD=bloonchipper output.
Rollback256 KB (two 128 KB sectors)44 bytes in each of the two sections
Read-write (RW)640 KBSee make BOARD=bloonchipper output.

Layout

Flash sectorFlash sector sizeOffsetFirmware Region
116 KB0RO (128 KB)
216 KB0x4000 (16384)...
316 KB0x8000 (32768)...
416 KB0xC000 (49152)...
564 KB0x10000 (65536)...
6128 KB0x20000 (131072)Rollback (256 KB)
7128 KB0x40000 (262144)...
8128 KB0x60000 (393216)RW (640KB)
9128 KB0x80000 (524288)...
10128 KB0xA0000 (655360)...
11128 KB0xC0000 (786432)...
12128 KB0xE0000 (917504)...

NPCX99FP (Helipilot)

Total Flash: 1 MB

Total SRAM: 512 KB

helipilot is different from the other FPMCU boards in that it cannot execute code quickly from Flash. Instead, all code is loaded in RAM and execute from RAM. This means that RAM must be partitioned into Code RAM and Data RAM.

RAM Partition

DescriptionSize
Code RAM352 KB
Data RAM156 KB
Data RAM for ROM functions4 KB

Flash

Flash sectionSizeAmount Used
Nuvoton bootloader header4 KB64 bytes
Read-only (RO)124 KBSee make BOARD=helipilot output.
Rollback128 KB (two 64 KB sectors)44 bytes in each of the two sections
Read-write (RW)768 KB (320 KB usable)See make BOARD=helipilot output. Note that the usable RW size is limited by the amount of SRAM.

Flash Layout

NPCX99FP supports erase size of 64 KB, 32 KB, and 4 KB. Our code configures it with a uniform flash sector size of 64 KB.