You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also noticed that STM32G0 with a flash bigger than 128k have 2 flash banks.
When writing to bank2 BKER bit must be set and page number is offseted by 256.
@vgeneves The proposed fix will be submitted soon. I'm currently waiting for a PR-review before being able to proceed.
I'll let you know as soon as we are ready to test.
The PR has now merged. I've added the change locally, but are still reviewing some other fixes regarding dual bank devices which may also be part of it. The patch will be submitted to the testing branch shortly.
STM32G0B1 can have up to 512kB of flash memory with a page size of 2kB, which means up to 256 pages.
Looking at stlink_erase_flash_page in common_flash.c:
There is a problem with how is handled page number.
According to STM32G0B1 ref manual RM440 (https://www.st.com/resource/en/reference_manual/rm0444-stm32g0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf) chapter 3.7.5 FLASH control register (FLASH_CR), page 105, PNB is 10 bit wide and not 6.
By masking the register value with 0x3F this limit to 64 the number of pages that can be erased.
Code should look like this :
The text was updated successfully, but these errors were encountered: