Electronic – Trying to understand the FLASH region of an STM32L433

armflashmicrocontrollernon-volatile-memorystm32

I am trying to learn more about the STM32's FLASH memory (on the Nucleo-64 STM32L433RCT6P) so that I can use a page of the FLASH memory to store some user configuration (so that the data is retained even when power is not supplied to the microcontroller).

Page 1 of the datasheet states that the STM32L433RCTxP has 256KB of Flash memory. In Page 85 of the same datasheet, the FLASH memory goes up to 0x0803_FFFF. The Keil toolchain that I am using also states that there is 256KB of Flash memory on this board, also confirmed by the address range (0x0803_FFFF – 0x0800_0000 = 0x03_FFFF = 262143 in base10/decimal):

Flash Memory on Keil Settings/Configuration

Page 78 of the Reference Manual tells something different regarding the FLASH memory of the STM32L43xx family device, where some regions of the address range above are not available to use as FLASH memory. On that page, only Pages 0-3, Page 63, Page 127, and Page 255 of the FLASH memory are usable, with 2KB of FLASH per page (14KB combined total FLASH for those pages). The Address range also extends up to 0x0807_FFFF, and not 0x0803_FFFF.

The Memory Map in page 67 of the Reference Manual actually lists the whole 0x0800_0000 to 0x0807_FFFF as FLASH memory, but
this would mean that there is actually 512KB of FLASH on the board. There is also some FLASH memory from the region 0x0000_0000 to 0x0008_0000.

How much FLASH memory does the STM32L433 Nucleo-64 has? If I were to follow the datasheet where the FLASH goes up to 0x0803_FFFF only, and parts of the RM that states only Pages 0-3, 63, and 127 are available as FLASH memory, does that mean that this board has 12KB usable FLASH memory?

Thanks!

Best Answer

You're completely misinterpreting page 78 of the reference manual.
Firstly, that document applies to more than just your 256kB STM32L433 - it also applies to 128kB and 512kB devices in the same family.
Secondly, Table 8 does not list every identical page of 2k flash. There is flash between pages 3 and 63, and between 63 and 127, and between 127 and 255 (depending on if the specific device in the family has that much flash). Listing them all would simply be a waste of space.
You'll also notice that the lines for 63, 127 & 255 each have a superscript number which refers to the notes immediately underneath the table telling you that these are the end pages for each device variant.

The datasheet for your specific STM32L433 part is correct and unambiguous in stating that it has 256kB of flash.
The reference manual for the family of which your STM32L433 is just one member does not contradict the datasheet.