Emulating EEPROM in CH32V003 Internal Flash
Looking at this diagram, we can see 4 blocks of flash memory: Option Bytes (Configuration Bytes) : 64 bytes (addresses 0x1FFF F800 – 0x1FFF F83F ). Reserved for static hardware settings of the microcontroller (for example, flash memory read protection). Additionally, the block contains two free bytes ( Data0 and Data1 ), which developers can use to store their own settings. Vendor Bytes (Calibration Data) : 64 bytes (addresses 0x1FFF F7C0 – 0x1FFF F7FF ). The block programmed during manufacturing and is accessible only for reading. It contains the unique chip identifier (ID) and important factory calibration values for the ADC (ADC) and internal oscillators (HSI/LSI). System Flash (Bootloader) : 1920 bytes (addresses 0x1FFF 0000 – 0x1FFF 077F ). This block contains the system bootloader, also programmed at the WCH factory once and permanently locked against user erasure or modification. Main Memory (Code Flash) : 16 KB in CH32V003 (addresses 0x0800 0000 – 0x0800 3FFF ). This ...