This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SoftDevice S110: 0x20000000 - 0x20000003 is special?

Hi there,

We're looking to use the entire 16 KB of RAM on the nRF51822 when the S110 is disabled. We've come across an odd case, where doing this:


memset(0x20000004, 0x0, 0x1FFC);

works OK: that successfully zeroes all the memory from 0x20000004-0x20002000.

However, any of these statements cause an immediate hard fault:


memset(0x20000000, 0x0, 0x4);

memset(0x20000000, 0x0, 0x1);
memset(0x20000001, 0x0, 0x1);
memset(0x20000002, 0x0, 0x1);
memset(0x20000003, 0x0, 0x1);

*(unsigned*)0x20000000 = 0xDEADBEEF;

Is there anything special about the first 32 bits of RAM that would cause the hard fault?

We're doing almost immediately in our boot loader's _start() function before doing anything else, so the SoftDevice isn't active yet. (I've double-checked this; sd_softdevice_is_enabled() says no).

Note that I can read that memory region fine. (For the record, it reports 0x00 0x60 0x03 0x00).

Related