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: Declare correct RAM sizes for STM32F7 #2075

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ALTracer
Copy link
Contributor

@ALTracer ALTracer commented Feb 12, 2025

Detailed description

  • No new features.
  • The existing problem is RTT Auto Search triggering lots of SWD Fault past end of physical SRAM on STM32F722.
  • This PR solves it by shrinking declared memory map and dispatching datasheet values per-family.

As I've tried to inspect/debug a project on a board involving STM32F722, the RTT Auto Search feature (which is supposed to be plug&play without configuration) started scrubbing available RAM but fell off the 192 KiB cliff trying to scan all 384 KiB of AHB SRAM which should be present on STM32F777. Confirmed with blackpill-f411ce and BMDA. I know about mon rtt mem ranges but this sounds more like a workaround rather than fix, BMD should provide knowledge of DUT flash and RAM maps and sizes.

Note this was not rigorously tested with a real project yet. I don't like the seven function calls, this can be further reduced to three via stack locals, should be cheaper than a full LUT. Update: reduced, was +80, now is +48 bytes size-diff.
Tested on STM32F722RE to no longer generate "SWD access resulted in fault" messages during reads outside RAM bounds, and to create a smaller correct RAM map.

Your checklist for this pull request

Closing issues

Fixes #2006.

@ALTracer ALTracer marked this pull request as ready for review February 13, 2025 17:56
@ALTracer
Copy link
Contributor Author

Seven function calls costed more flash than two calls, so the #1710 approach is not optimal either.
Clarify whether I should also add the 8 datasheets and 3 reference manuals (RM0385, RM0410, RM0431) for STM32F7 to top of file.
I also have a minor fix for ITCM inconsistency for a follow-up PR, but it worsens blank_check behaviour (will check twice). Finally, I also will have a medium fix for STM32F4 RAM being pinned to 320kiB which is too blanket, in another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[STM32F72x] Incorrect memory map
1 participant