[riot-notifications] [RIOT-OS/RIOT] drivers/periph: define rtc_mem and implement it for sam0_common (#16758)

Antonio Galea notifications at github.com
Mon Aug 23 14:33:57 CEST 2021


> 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.

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.

>     * [ ]  saml21

Your RTC test passes and prints "RTC mem OK" on saml21 (well, samr34 as said above). 

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:
```
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
```

If I add your new module, I can flash the board but initialization fails somewhere  - I don't see the standard RIOT banner.

> alternative to #16757 - @ant9000 does this work for your use-case?

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).

A small note: you're intercepting _rtt_init()_, but the RTC memory is cleared also by calling _rtc_init()_. 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?


-- 
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/16758#issuecomment-903722963
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210823/46cf4251/attachment-0001.htm>


More information about the notifications mailing list