After I write to flash memory I cannot do it again upon reflashing entire program onto chip, how to avoid this?
I have an STM32F407 board and have worked out how to flash a certain flash-sector as well as erasing it.
My problem is that whenever I have written to flash, and I reboot my board, I cannot flash again until I reflash the entire programme from STM32CubeIDE. As far as I've understood it is that whenever flash is accessed it will lock it afterwards to avoid unauthorized access. But I want to be able to do it indefinitely without having to reflash the code. How do I do this?
My code is at the moment:
FLASH_Unlock();
FLASH_OB_Unlock();
FLASH_EraseSector(FLASH_Sector, VoltageRange);
flashFunction(param);
FLASH_Lock();
FLASH_OB_Lock();Any suggestions what to do to be able to write to flash how much I want without reflashing?
