2023-04-29 06:01 PM
Hello...
I am using a Nucleo WB55 board. I can run the FLASH_EraseProgram that comes with the WB55 example code successfully. I have pre-existing code and am trying to pull this into my code. I have checked the PWR and the Flash SFR in the debugger between the two codes (the example and mine) and they look the same. When running my code I get a HardFault Interrupt and when running the example I do not.....
Can anyone give me a reason why the following line of code is causing me to get a HardFault Interrupt?
This line of code is in function FLASH_PageErase (stm32wbxx_hal_flash_ex.c). It is being called from HAL_FLASHEx_Erase function within the same file.
MODIFY_REG(FLASH->CR, FLASH_CR_PNB, ((Page << FLASH_CR_PNB_Pos) | FLASH_CR_PER | FLASH_CR_STRT));
2023-05-30 10:30 AM
Hello SWenn,
Could you provide more information ? What is the address you trying to erase ? Is it page aligned ? Have you check the Flash read/write protection?
It's may be an unauthorized erase (erase at address of the BLE stack for example)
Best Regards,
Axel L.
2023-06-01 12:27 PM
This has been resolved...