Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STM32Gx]: Added erase support for multi-bank products #1420

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

d4ilyrun
Copy link
Contributor

@d4ilyrun d4ilyrun commented Aug 8, 2024

Some products of the Gx series (namely the G0B1) use mutiple flash banks.

On those products we need to explicitely set the BKER bit to chose which bank to erase. This is currently not done.
This would also cause a Programming Sequence error if trying to flash (into bank1 by default currently) when the program on the board already tried to erase a part of bank 2 (since the BKER bit was last set to bank 2 and we didn't change it).

@Nightwalker-87 Nightwalker-87 added this to the v1.8.1 milestone Aug 10, 2024
@Nightwalker-87 Nightwalker-87 changed the title STM32Gx: flash: Add erase support for multi-bank products [STM32Gx]: Added erase support for multi-bank products Aug 10, 2024
Products of the Gx series with more than 128K of flash use 2 banks.
In this case we need to specify which bank to erase using the BKER bit.

Reference: 3.7.5 - BKER
As described in 3.3.8, if erasing while another mode's "enable" bit
is set, a programming sequence error will be raised. This change
makes sure this will not happen for an erase operation.
@Nightwalker-87 Nightwalker-87 merged commit 1f0b95c into stlink-org:testing Aug 11, 2024
10 checks passed
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Aug 11, 2024
@d4ilyrun d4ilyrun deleted the g0/erase_bank2 branch August 13, 2024 11:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants