<p><b>@dylad</b> commented on this pull request.</p>

<p>I guess this PR is almost good to go !<br>
Just some comments</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11486#discussion_r329752297">tests/periph_backup_ram/main.c</a>:</p>
<pre style='color:#555'>> +
+    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?");
+    }
+
+    printf("counter: %d\n", ++counter);
+    counter_noinit = counter;
+
+    /* Some tools have trouble flashing MCUs in deep sleep.
+     * Wait a bit to make re-flashing / debugging easier.
+     */
+    xtimer_sleep(3);
</pre>
<p>This traditional delay is troublesome because you're suppose to see the counter increments by one every second but currently this is not the case.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11486#discussion_r329753156">tests/periph_backup_ram/main.c</a>:</p>
<pre style='color:#555'>> +{
+    /* 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?");
+    }
+
</pre>
<p>My personal taste would have place <code>#ifndef CPU_BACKUP_RAM_NOT_RETAINED</code> here so SAML21 platform doesn't display the counter before saying "aborting test". You may ignore this comment if you're fine this way.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11486?email_source=notifications&email_token=ABE7WYD7FCYHQLNUFGVNHKDQMJJH3A5CNFSM4HKVC6W2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGMHXPY#pullrequestreview-295205823">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCMRMYHT3FKQZHMSF3QMJJH3ANCNFSM4HKVC6WQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYAHDQDNKDD7A75CFCTQMJJH3A5CNFSM4HKVC6W2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGMHXPY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11486?email_source=notifications\u0026email_token=ABE7WYD7FCYHQLNUFGVNHKDQMJJH3A5CNFSM4HKVC6W2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGMHXPY#pullrequestreview-295205823",
"url": "https://github.com/RIOT-OS/RIOT/pull/11486?email_source=notifications\u0026email_token=ABE7WYD7FCYHQLNUFGVNHKDQMJJH3A5CNFSM4HKVC6W2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGMHXPY#pullrequestreview-295205823",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>