From 6832a62872ccef733a263f9951921a3d3abf1ed2 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Mon, 5 Mar 2012 22:35:02 -0500 Subject: [PATCH] f4 bl_helper: clear all flash errors as we unlock the flash Error flags being set were causing flash erase operations to fail. Not sure why these flags were set though so this might be hiding some other problem. --- flight/PiOS/STM32F4xx/pios_bl_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/flight/PiOS/STM32F4xx/pios_bl_helper.c b/flight/PiOS/STM32F4xx/pios_bl_helper.c index 5473e8447..9f08c12bb 100644 --- a/flight/PiOS/STM32F4xx/pios_bl_helper.c +++ b/flight/PiOS/STM32F4xx/pios_bl_helper.c @@ -44,6 +44,7 @@ uint8_t *PIOS_BL_HELPER_FLASH_If_Read(uint32_t SectorAddress) uint8_t PIOS_BL_HELPER_FLASH_Ini() { FLASH_Unlock(); + FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); return 1; }