[riot-notifications] [RIOT-OS/RIOT] cpu/saml21: Make Low-Power SRAM available to programs (#11486)

benpicco notifications at github.com
Mon Sep 30 22:18:19 CEST 2019


benpicco commented on this pull request.



> +{
+    /* We keep a copy of counter in the .noinit section (normal RAM).
+     * In the deepest sleep normal RAM is not retained, so if it matches
+     * counter anyway after wakeup, we did not sleep properly.
+     */
+    static int counter_noinit __attribute__((section(".noinit")));
+    static int counter __attribute__((section(".backup.bss")));
+
+    if (counter == 0) {
+        puts("\nBackup RAM test\n");
+        printf("This test will increment the counter by 1, "
+               "then enter deep sleep for %ds\n", SLEEP_SEC);
+    } else if (counter_noinit == counter) {
+        puts("WARNING: non-backup memory retained - did we really enter deep sleep?");
+    }
+

I think we should at least once access that memory to make sure it doesn't crash & burn when doing so.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11486#discussion_r329767049
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190930/87d9cd18/attachment.htm>


More information about the notifications mailing list