EFL Flash Sectors on STM32G0
Posted: Tue Apr 21, 2020 9:08 pm
Hi there,
I've been trying to use the EFL driver on an stm32g071 and I was running into some problems. I think the number of pages is incorrectly assigned which leads to sectors_size being 512 bytes instead of 2k.
As the datasheet specifies 32 or 64 pages of 2k, I changed the lines:
#define STM32_FLASH_SECTORS_TOTAL_64K 128
#define STM32_FLASH_SECTORS_TOTAL_128K 256
to
#define STM32_FLASH_SECTORS_TOTAL_64K 32
#define STM32_FLASH_SECTORS_TOTAL_128K 64
And everything started working as I expected.
I've been trying to use the EFL driver on an stm32g071 and I was running into some problems. I think the number of pages is incorrectly assigned which leads to sectors_size being 512 bytes instead of 2k.
As the datasheet specifies 32 or 64 pages of 2k, I changed the lines:
#define STM32_FLASH_SECTORS_TOTAL_64K 128
#define STM32_FLASH_SECTORS_TOTAL_128K 256
to
#define STM32_FLASH_SECTORS_TOTAL_64K 32
#define STM32_FLASH_SECTORS_TOTAL_128K 64
And everything started working as I expected.