stm flash write problem uint32_t Flash_Write_Data (uint32_t StartSectorAddress, uint32_t *Data, uint16_t numberofwords)
Hello,
cn anyone help me with flash writing.
I am using bootloader to update the application code in STM32F407, But the code isnt working i tried to debug the code, the code is not erasing the sectors.
i found HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError) erasing function returning the error status.
So i also have tried to do the FLASH_Erase_Sector(StartSector, FLASH_VOLTAGE_RANGE_3); After this the sector was getting erased successfully but the
HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, StartSectorAddress, Data[sofar]) is giving error .
So i tried to debug this function too and i observed FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); this function was givinig eror status.
Can someone help me solve this problem
The code works fine when i run it in debug mode , the flash erase and write works properly
