The problem is that when you access something out of range, you get (probably) a BusFault interrupt, and I'm struggling to see a way to recover from it.
Somewhere there must be an example of doing it, but I can't find one.
By the way, you can also check if the RAM is Ok. It's possible that the chips were binned as the 'C' variant because there was a problem with the RAM or Flash higher up the address range:
for (var i=48*1024;i<64*1024;i+=4) {
poke32(0x20000000+i, 0xAAAAAAAA);
var v = peek32(0x20000000+i);
if (v != 0xAAAAAAAA) console.log("Got "+v+" not 0xAAAAAAAA");
poke32(0x20000000+i, 0x55555555);
var v = peek32(0x20000000+i);
if (v != 0x55555555) console.log("Got "+v+" not 0x55555555");
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
If anyone has any solutions for detecting the RAM automatically, I'd be really interested :)
I posted up here to see if anyone has any ideas:
http://stackoverflow.com/questions/23411824/determining-arm-cortex-m3-ram-size-at-run-time
The problem is that when you access something out of range, you get (probably) a BusFault interrupt, and I'm struggling to see a way to recover from it.
Somewhere there must be an example of doing it, but I can't find one.
By the way, you can also check if the RAM is Ok. It's possible that the chips were binned as the 'C' variant because there was a problem with the RAM or Flash higher up the address range: