Persistent RAM - ADL_MEM_UNINIT

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?

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?

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.

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

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

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

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

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…

Here: How to customise gcc.lkopt ? - thanks!

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