-
Notifications
You must be signed in to change notification settings - Fork 355
Fix RAM size of the STM32L476RG #162
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
Conversation
|
This is a tricky one... |
|
To be honest, I am not exactly a professional when it comes to working this close to the metal, and I have no idea whether parity checked ram is usually included in the general purpose RAM. To shortly summarize how I got to think that this change is correct:
Excerpt from STM32L476RGTX_RAM.ld |
|
@Hish15 I had a look at datasheet. this part has 128kB of SRAM in total the problem is that they are separated in 2 banks
So 96k is correct but there should be a way to declare the other section too. Edit: please see my review comment |
atsju
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened ALL datasheets TWICE (except 485 which seems not to exist from ST point of view, maybe a future part or one never released).
All parts have CCRAM on a second address but all except the five I corrected have also remapped this CCRAM to a second address contiguous to normal RAM. I also discovered 4A6 parts and up have a RAM3 zone wich is contiguous to the remapped CCRAM. This means all parts except the 5 corrections may work out of box with 1 big RAM zone.
Now you may make choices on how to handle this, to include or not to include in main ram, to split or not to split ...
Only 5 parts
|
Thanks @atsju |
Co-authored-by: Julien Staub <[email protected]>
cd6218f to
91ae846
Compare
Good day everyone,
this issue came up a long time ago in #71 and was never fixed.
STM advertises the STM32L476RG with a RAM size of 128K. This value, according to the Datasheet, already includes the hardware parity check ram. Thus the real general purpose RAM size of the STM32L476RG is 96K.
This value is also used by the STM Cube IDE. I can confirm that anything compiled for the L476RG with the current master will throw the application right into the hard fault handler. Changing the RAM size fixes this.