[riot-notifications] [RIOT-OS/RIOT] cpu/sam0_common: flashpage: add functions to write to user config area / AUX page (#14512)

benpicco notifications at github.com
Tue Nov 10 11:03:34 CET 2020


@benpicco commented on this pull request.



> +/**
+ * @brief   Write data to the user configuration area.
+ *          This will write data to the remaining space after @see nvm_user_page_t
+ *          The size of this area depends on the MCU family used.
+ *
+ *          Will only write bits 1 -> 0. To reset bits to 1, call @see sam0_flashpage_aux_reset
+ *          This will reset the whole user area configuration.
+ *
+ *          Arbitrary data lengths and offsets are supported.
+ *
+ * @param   offset  Byte offset after @see nvm_user_page_t
+ *                  must be less than `FLASH_USER_PAGE_AUX_SIZE`
+ * @param   data    The data to write
+ * @param   len     Size of the data
+ */
+void sam0_flashpage_aux_write_raw(uint32_t offset, const void *data, size_t len);

We need to use different commands to write to that flash area.
Internally they already share functions for the actual flash write logic (which means also normal flash writes can be unaligned now) but this is a different flash region and we really don't accidentally overwrite the CPU configuration, a separate function is more convenient as otherwise we would have to add a check for the address inside `flashpage_write_raw()`and change the behavior based on that.

-- 
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/14512#discussion_r520437102
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201110/27bfdcad/attachment.htm>


More information about the notifications mailing list