Nucleo-WB55RG / CubeMX / Flash Erase Hard Fault Interrupt??
I am using the above subject Nucleo. I create a project and let STM32CubeIDE V 1.16.1 create a default project. I make NO changes to this. I close the .ioc and open main and add the following code (seen by Red Bars). I build and load to target. I place a breakpoint on the HAL_FLASHEx_ERASE function and when I go to step over this function I get a hard fault interrupt. I step into code and the following line
MODIFY_REG(FLASH->CR, FLASH_CR_PNB, ((Page << FLASH_CR_PNB_Pos) | FLASH_CR_PER | FLASH_CR_STRT));creates the hard fault. Can someone please tell me what I am doing wrong here?....The target address has been verified to be readable via STM32CubeProgrammer so I know that it is not out of memory space.

