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

Juan I Carrano notifications at github.com
Tue May 7 12:20:23 CEST 2019


jcarrano requested changes on this pull request.

I think this is a nice feature to have. The main problem now is that variables placed in `.backup` will not get initialized (either with a value of zeroed out) which can be quite a surprising behaviour for users. I tried it on a saml21-xpro) 

Solutions, from worst to best:

1. Leave it as is, document it.
2. Place code in startup to unconditionally zero out the whole section. Document it.
3. Replicate the `.data` and `.bss` scheme in LPRAM.

(2) and (3) require modifying the startup sequence, but IMO make this feature friendlier and more usable. I'll look up if there's a simple way of implementing (3).

Also, there should be a feature test available for this.

> @@ -3,5 +3,17 @@ export CPU_FAM  = saml21
 
 USEMODULE += pm_layered
 
+ifneq (,$(filter saml21j18b saml21j18a samr30g18a,$(CPU_MODEL)))

The presence of this feature should be signalled by a FEATURE (we could name it, for example, "backup_ram"). This way the user is able to say FEATURES_REQUIRED="backup_ram" and not get unexpected results if the .backup section has no meaning in the target platform.

> + *
+ * @author          Benjamin Valentin <benjamin.valentin at ml-pa.com>
+ *
+ * @}
+ */
+
+ccmram_length = DEFINED( _lpsram_len ) ? _lpsram_len : 0x0 ;
+
+MEMORY
+{
+    lp-sram  : ORIGIN = 0x30000000, LENGTH = _lpsram_len
+}
+
+SECTIONS
+{
+    .bkup : {

For clarity, I'd rather have the output section named ".backup" too.

-- 
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#pullrequestreview-234422588
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190507/346b6c8a/attachment.html>


More information about the notifications mailing list