cancel
Showing results for 
Search instead for 
Did you mean: 

Determining RAM size at Runtime?

LMore.5
Associate II

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?

2 REPLIES 2

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

> 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

If you feel a post has answered your question, please click "Accept as Solution".