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

Fix: AT32F43x cleanup #1996

Merged
merged 2 commits into from
Nov 11, 2024
Merged

Conversation

ALTracer
Copy link
Contributor

Detailed description

  • The bank_split field of struct at32f43_flash can be eliminated from _probe/_add_flash if I can use a different method of accessing second bank in _mass_erase, checking that target->flash->next list has a non-NULL entry. No other functions need it because BMD API guarantees no operations span multiple banks. This change was rebased past AT32F405 merge.
  • Also, hook the STM32-generic UID printing command to this driver and introduce a meson dependency between these TUs. Move the macros for "engineering bytes"/UID into its own group.

Verified on AT-START-F437 to not break flashloading, a firmware spanning two banks was used.
This should bring a minor reduction to target_flash priv size, and it's a preparation to refactoring this driver to carry USD_BASE and FPEC_BASE in that priv such that targets in stm32f1.c can be migrated here.

Your checklist for this pull request

Closing issues

Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks reasonable, merging once rebased on main. In regards the mass erase point, once Perigoso's #1619 is merged, you'll be able to specify the mass erase function as flash->mass_erase, setting it to the bank mass erase function, and eliminating the custom mass erase implementation. That'll solve the bank split headache properly.

Thank you for the contribution!

@dragonmux dragonmux modified the milestones: v1.10, v2.0 release Nov 11, 2024
@dragonmux dragonmux added the Enhancement General project improvement label Nov 11, 2024
* This value was only used to detect second bank in _mass_erase
* Target Flash API already guarantees no cross-bank ops
* Rely on non-null flash->next instead
stm32_common: Provide as a meson dep to at32f43x
@ALTracer ALTracer force-pushed the fix/at32f43x-cleanup branch from 95e537c to d05953c Compare November 11, 2024 06:24
@dragonmux dragonmux merged commit d05953c into blackmagic-debug:main Nov 11, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement General project improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants