HardFault Interrupt when trying to erase flash?
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));