STM32G0 erasing bank2
I am using a stm32g0b1ret with stm32cubemx package 1.6.1 .
The symptoms are:
On deletion of pages I receive a signal 0 in the debugger, but the pages do get erased eventually. (I use HAL_FLASHEx_Erase)
On the first flash write I get an error with goes to hardfault - because the Flag CFGBSY is set. (I use HAL_FLASH_Program, with Doubleword).
A reset cures this, and then the writing happens without a further problem.
On the next erase the problem is repeated.
Questions:
I do not know, if this solves my problem, but it looks like there is an inconsistency between the ref man RM0444 and the cube-mx firmware/sample project.
CubeMX: Erasing pages in bank 2 assumes and asserts page number start from 0 to 127 for both banks and the choice of bank is done solely by the BKER bit.
Reference manual rev 5, page 71/page102 -> this looks like page numbers for bank 2 start at 256 (with a gap from last page 127 of bank1).
I have tried both ways, the pages get deleted in both cases, but also the error seems to stick. I have not found anything in the errata (I disabled the prefetch, to be on the safe side)
So, anyone got any experience with this?
Which would be the correct way to delete a page on bank 2?
