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 improvements #910

Merged
merged 6 commits into from
Apr 6, 2020

Conversation

grevaillot
Copy link
Collaborator

Hi,

here are a few patches to improve g4/g0 support

  • introduce a helper to handle devices with dual bank flash
  • handle cat3 g4 devices with configurable dual bank flash
  • enable mass erase for g4 and g0 devices.
  • add a flash programming check at the end of mass erase.

has_dual bank flag could probably avoid multiple device type check around the code with a bit of work.
flash programming check could probably be added in page erase and flash write and extended to other devices, to debug some silent issues.

add a 'has_dual_bank' info to flash param, helping handling a couple of cases
 - selecting over dual bank specific code path without handling multiple chip id all over the code.
 - handling dual bank mode dynamic configuration
g4 cat3 devices can be configured in two mode via option bytes:
  - dual bank, 2x256kib, 2KiB pages.
  - single bank, 1x512KiB, 4KiB pages.
in anycase, these have two banks, and need to be handled with more care.

-> read optr after loading flash params to patch page size.
-> in single bank mode, mass erase _must_ be triggered by applying
MER1 and MER2 bits. erasing half of the flash will lead to a pgserr.
toggle proper MER bits, taking in account dual bank mode enabled or not.
only implement it for g0/g4 for now, but this is most probably a must for
all chips.
@Nightwalker-87 Nightwalker-87 merged commit 5e3abc3 into stlink-org:develop Apr 6, 2020
@Nightwalker-87
Copy link
Member

Merci 🥇

@grevaillot grevaillot deleted the to_merge/stm32gx_work branch April 21, 2020 15:04
@stlink-org stlink-org locked as resolved and limited conversation to collaborators May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants