2016-11-17 01:35 AM
Hello everybody,
I'm actually working on a bootloader on an STM32F030X8 board. The programme already work's on a L100RC and an F303RE.My bootloader starts at 0X08000000 ans my user app starts at 0X0800FA00.I need to eraser before writing so here is what i do :for(i=pStartAdress_u32;i<pEndAdress_u32;i+=1000) { halFlashPageErase_v((u8 *)i); }with start = 0x0800FA00 and end = 0x0803E800the + 1000 is because page size is 1KBthen hal calls drivers with this function :void drvFlashPageErase_v(u8 * pAddress_u8){ HAL_FLASH_Unlock(); FLASH_PageErase((u32)pAddress_u8); HAL_FLASH_Lock();}My probleme is when i call this my programme blocks and my stack shows this :Thread #1 (Suspended : Signal : SIGINT:Interrupt) 0xfffffffe <signal handler called>() at 0xfffffff1 0xfffffffe <signal handler called>() at 0xfffffff9 drvFlashPageErase_v() at drvFlash.c:80 0x8003780 halFlashPageErase_v() at halFlash.c:70 0x80047fc sSvcComProtFlashErase_b() at svcComProt.c:723 0x8006490 sCmdErase_v() at svcComProt.c:395 0x8005e60 sSvcComProtHandleCommand_u8() at svcComProt.c:972 0x800698a svcComProtBootProcess_v() at svcComProt.c:1 092 0x8006b4a <...more frames...>2016-12-01 03:00 AM
Hello,
May be this example can help you, it describes how to configure and use the FLASH HAL API to erase and program the FLASH memory:STM32Cube_FW_F0_V1.6.0\Projects\STM32F072B-Discovery\Examples\FLASH\FLASH_EraseProgramRegards