Skip to main content
Strooom
Senior
June 11, 2026
Question

EEPROM Emulation number of variables

  • June 11, 2026
  • 0 replies
  • 5 views

I am using the EEPROM emulation (X-CUBE-EEPROM) on a STM32C0.

The default setting for number of variables is 100 : In eeprom_emul_conf.h : 

#define NB_OF_VARIABLES         100U  /*!< Number of variables to handle in eeprom */

If I understand this emulation correctly, it uses a number of 2K flash pages (minimum 2 for alternating...).

Also, each (32bit) variable is stored as 8 bytes : 16bit virtual address, 32bit data, 16bit CRC.

I understood there is also some header overhead of 32 bytes per 2K page.

So the number of variables fitting in a single page is (2048 - 32) / 8 = 252

So my question is then : why is the default value set to 100 io. 252 ???