Determining RAM size at Runtime?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-29 2:42 PM
There's the Flash Size Register in the Device electronic signature.
Is there an equivalent for the onboard SRAM size? Any way to get the ACTUAL SRAM size at runtime?
- Labels:
-
Flash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-29 2:49 PM
Yes some STM32 have a register describe the RAM size.
Where they don't you can either use the FLASH size as a guide, or read the Device ID from one of the DBGMCU registers
As I recall there used to be package information in the UNIQUE ID, but I'm not sure how current that its or if it is well/openly documented.
I've use Device ID to determine CPU/BUS speeds within the F4 family
Cache sizes, and core sub-components can be fished out of the ROM TABLEs
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-29 2:52 PM
> Is there an equivalent for the onboard SRAM size?
No, unfortunately.
> Any way to get the ACTUAL SRAM size at runtime?
Here's an ugly hack:
https://stackoverflow.com/questions/23411824/determining-arm-cortex-m3-ram-size-at-run-time
