cancel
Showing results for 
Search instead for 
Did you mean: 

detect sram size at run time

bart2399
Associate II
Posted on August 30, 2012 at 14:12

Hi,

is there a way to detect the SRAM size of a stm32 (F1, connectivity line) at run time?

I found a register with the flash size and a so called device identifier (only tells you e.g. connectivity line), but not the SRAM size.

I suspect it should be somewhere in the flash ''information block'', where also this flash size 'register' resides, but i did not find any documentation of this information block.

3 REPLIES 3
Posted on August 30, 2012 at 15:57

It used to be

        flash_kb = *((unsigned short *)0x1FFFF7E0);

        ram_kb = *((unsigned short *)0x1FFFF7E2);

Which worked on the F103's

ST sells more part markings than physical die. The low end parts typically have more RAM than expected. Time on the tester can be reduced by not bothering to test it.

The other method would be to set some values into SRAM, and figure out the shadow/ghost locations, or Hard Fault points.

Look in ''ROM'' beyond the system loader, around the area containing the unique id.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
emalund
Associate III
Posted on August 30, 2012 at 18:55

 Time on the tester can be reduced by not bothering to test it.

 

not to mention that (it used to be?) the practice of seelin parts where the memory fails outside what is stated available for a 'lower' part as that 'lower' part.

Thus, checking available memory (and using ir) may lead you to hit a soft spot in the RAM

Erik
bart2399
Associate II
Posted on August 31, 2012 at 11:29

thanks clive1,

the flash address is valid for all chips, it is also in the user manual.

i tried out addres 1FFFF7E2 for sram, but the value is FFFF

i think the information block is different for connectivity line devices (which i use), the information block is much bigger (18kB vs 2kB if i remember correctly)

in the area around i could not find any other register with the expected value 30 (48kB or 40 (64kB)

duh

i know the practice of selling multiple products from one die.

for st it is even stranger:

we bought some stm32f107vbt6 wich were listed with 48kB ram, now the exact same product is listed as having 64kB ram. the datasheet changed in 2011.

maybe they had yield issues?

but i find it bizarre they use the same product number for different specs.

i tesed a few of my vbt6, they look to have 64kB ram.

But i don't know what the testing practices are, so i'd like  to use only the ''official'' ram so i know it is fully tested.