Skip to content

stm32gx improvements - #910

Merged
Nightwalker-87 merged 6 commits into
stlink-org:developfrom
grevaillot:to_merge/stm32gx_work
Apr 6, 2020
Merged

Nightwalker-87 merged 6 commits into
stlink-org:developfrom
grevaillot:to_merge/stm32gx_work

Conversation

@grevaillot

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

2 participants