My set up is nRF52832 with a board very much like the PCA10040.
The SDK is version 16.0.0.
I am using Segger Embedded Studio version 5.60 and I am using the GCC compiler suite in the back end.
My boot loader is writing a constant integer value to a pre-defined location at the top of the RAM.
My goal is to protect this location after it is written by the boot loader and have it read by the main application.
I have defined the RAM area to end 16 bytes before the physical RAM end i.e. 0x2000FFEF.
I think I have set up everyting correctly and confirmed that the generated ELF files use 0x2000FFF0 as the top of the stack.....
I can see the boot loader write the correct value to the target location. However, the main application sees all 0's and it is almost as if the startup code (or some other agent) is clearing the RAM contents.
I have tried many different ways of carving out the top of the RAM.
- I have set the RAM_PH_SIZE and RAM_SIZE to 0xFFF0 (i.e. 16 less than 0x10000) and in my code I simply dereference the absolute address of 0x2000FFF0.
- I have set the RAM_PH_SIZE to 0x10000 and RAM_SIZE to 0xFFF0 and in my code I simply dereference the absolute address of 0x2000FFF0.
- I have repeated the above options but this time I use a named section '.non_init' and placed it at the addresses listed above.
No matter how I combine these, the application always sees all 0s in the location -- and what is even more troublesome is that there are non-zero values in other addresses of the 16 bytes that I assumed would be untouched by the main application.
Is this a known bug in the version 5.60 of Segger that I am using?
Cheers
RMV