Persistent RAM - ADL_MEM_UNINIT


#1

This is a fairly recent introduction - SDK 2.10 with firmware 7.2, according to viewtopic.php?f=19&t=2679&p=9781&hilit=ADL_MEM_UNINIT#p9781

But it’s actually just a macro:

#define ADL_MEM_UNINIT ( _X ) _X __attribute__((section("UNINIT")));

So my question is: if I were to define that “manually” (or just apply the section attribute “manually”) in an SDK before v2.10 and/or firmware before R7.2, would it work?


#2

And my answer is: No. :cry:

The appropriate entries appear in the map file, but variables defined with this attribute are zeroed when the unit (re)starts.

So my question now is: what else is additionally required to get this to work in an SDK before v2.10 and/or firmware before R7.2 :question:
(specifically, v6.63g)

Is it just a matter of getting the linker script (and whatever else) right, or does it actually rely upon features within the firmware itself?


#3

I think it is a matter of linker section with attribute “do not initialize” (for IAR compiler). For GCC there should be another linker script options. And also you sholud know where in memory to place this section and mark your variables to put them into that section.


#4

Yes, all that is happening - but the “persistent” data does not “persist”


#5

I think I need to modify gcc.lkopt - but how does one do that?

It seems to be automatically generated…

See: viewtopic.php?f=108&t=5049


#6

Why don’t you use OS higher than R7.2? :slight_smile:


#7

Because the upgrade is not an option in this particular case!


#8

I answered on how to use a custom link script.

However, I’m afraid this won’t be enough…
Indeed, as soon as you use Developer Studio, the generated linker script always contains the uninitialized area, even for applications built on top of “old” OS versions.
It’s not only a matter of link, but also updates implemented at Firmware/OS level to take care of this area…


#9

Here: https://forum.sierrawireless.com/t/how-to-customise-gcc-lkopt/4578/1 - thanks!


#10

See https://forum.sierrawireless.com/t/whats-wrong-with-this-linker-script/4598/1 for problems with the Linker script.