<p></p>
<blockquote>
<p>The data sheet for SAM L1x and SAM L2x do not mention such limitations, but according to the data sheet SAM L21 only has 2 General Purpose registers whereas the vendor files have definitions for 4. I didn't yet test if they do indeed all work.</p>
</blockquote>
<p>I've tested with a SAMR34 chip, which consists of a SAML21 CPU (rev B) plus a SX1276 radio. I can read and write all 4 registers without problems.</p>
<blockquote>
<pre><code>* [ ]  saml21
</code></pre>
</blockquote>
<p>Your RTC test passes and prints "RTC mem OK" on saml21 (well, samr34 as said above).</p>
<p>Iv'e tried compiling one of my firmwares (that makes use of ztimer module) against this PR. Without adding module periph_rtc_mem I get the following error:</p>
<pre><code>RIOT/cpu/sam0_common/periph/rtc_rtt.c: In function 'rtt_init':
RIOT/cpu/sam0_common/periph/rtc_rtt.c:329:21: error: 'RTC_GPR_NUM_AVAIL' undeclared (first use in this function); did you mean 'RTC_GPR_NUM'?
     uint32_t backup[RTC_GPR_NUM_AVAIL];
                     ^~~~~~~~~~~~~~~~~
                     RTC_GPR_NUM
</code></pre>
<p>If I add your new module, I can flash the board but initialization fails somewhere  - I don't see the standard RIOT banner.</p>
<blockquote>
<p>alternative to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="974530468" data-permission-text="Title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/16757" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/16757/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/16757">#16757</a> - <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/ant9000/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ant9000">@ant9000</a> does this work for your use-case?</p>
</blockquote>
<p>The API would perfectly solve my problem - I just need to figure out why my own code breaks just by compiling against it (without further changes).</p>
<p>A small note: you're intercepting <em>rtt_init()</em>, but the RTC memory is cleared also by calling <em>rtc_init()</em>. To keep things more readable, I'd rather save/restore the bytes in __rtt_reset()_, so you get all the possible paths at once. What do you think?</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/16758#issuecomment-903722963">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYDOJECA4SEFLSNPQ6LT6I53LANCNFSM5COT725A">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email">Android</a>.<img src="https://github.com/notifications/beacon/ABE7WYGDQV7GK2LWWIJVUV3T6I53LA5CNFSM5COT725KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGXO3PUY.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/16758#issuecomment-903722963",
"url": "https://github.com/RIOT-OS/RIOT/pull/16758#issuecomment-903722963",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>