Hi,
I need to save a 16 bit counter into a retained register.
I cannot use the 2 GPRETREG since they are already used and I cannot write internal flash.
I cannot use RAM retained.
Is there any other register suitable for this purpose?
Hi,
I need to save a 16 bit counter into a retained register.
I cannot use the 2 GPRETREG since they are already used and I cannot write internal flash.
I cannot use RAM retained.
Is there any other register suitable for this purpose?
Hi,
The GPREGRET registers are the only supported way to retain data that is not in flash during a reset. Other than that, the only approach that works reliably is to store the data in flash. However, you can also store data data in non-initialized RAM together with a checksum and read that data after reset. If the checksum is valid, it can be used. In most cases this will be fine, as the RAM content is never cleared by a reset, it is just not guaranteed to be intact. Note however that if you have a bootloader that runs first, you must make sure that this does not use the same memory region as that would overwrite it during boot. See this thread for details about that.
Hi, Einar! Are there any examples of how to write & read to & from the GPREGRET2 register the best way in nrfConnect SDK 3.0?
This works for me:
Hi,
Please see this post.
Thanks, Einar. I guess this is exactly what I was looking for.
Thanks, Einar. I guess this is exactly what I was looking for.