2026-05-07 12:57 AM - edited 2026-05-07 1:14 AM
I'm using an STM32H7S78-DK board and I have a part of the firmware that, from the boot, updates the FLASH from a .bin inside an SD card
The code is pretty simple as I loop the FLASH comparing every sector with the one in the SD card and, if different I erase the internal flash sector and write the new one.
Everything was working correctly until a update the code via CubeMX
The read seems to still working
if (EXTMEM_Read(0, fw_offset, flash_buf, br) != 0)but as soon as I do the
if (EXTMEM_EraseSector(0, fw_offset, FLASH_SECTOR_SIZE) != 0)I got an error
The crash happens in
if (EXTMEM_DRIVER_NOR_SFDP_OK != EXTMEM_DRIVER_NOR_SFDP_SectorErase(&extmem_list_config[MemId].NorSfdpObject,
local_address, sector_type))
{
retr = EXTMEM_ERROR_DRIVER;
}I've rolled back just the driver in the STM32_ExtMem_Manager, and everything started working again
I've noticed that quite a few files have been changed, including the addition of #define EXTMEM_DRIVER_CUSTOM 0
In the conf_template, it could be helpful to understand what's changed. Everything else has stayed the same. Where should I look?