[riot-notifications] [RIOT-OS/RIOT] cpu/stm32f3: add support for flashpage and flashpage_raw (#11749)

Francisco notifications at github.com
Fri Jun 28 15:01:22 CEST 2019


fjmolinas commented on this pull request.



> @@ -43,6 +43,20 @@ extern "C" {
 #define CPU_FLASH_BASE                  FLASH_BASE
 /** @} */
 
+/**
+ * @name    Flash page configuration
+ * @{
+ */
+#define FLASHPAGE_SIZE      (2048U)
+#define FLASHPAGE_NUMOF     (STM32_FLASHSIZE / FLASHPAGE_SIZE)
+
+/* The minimum block size which can be written is 2B. However, the erase
+ * block is always FLASHPAGE_SIZE.
+ */
+#define FLASHPAGE_RAW_BLOCKSIZE    (2U)
+/* Writing should be always 4 bytes aligned */
+#define FLASHPAGE_RAW_ALIGNMENT    (4U)

I found the answer to this in a comment in `tests/periph_flashpage`:

```
The flash page in RAM must be correctly aligned, even in RAM, when
 *          using flashpage_raw. This is because some architecture uses
 *          32 bit alignment implicitly and there are cases (stm32l4) that
 *          requires 64 bit alignment.
```

So its an architecture requirement, and does need to be 32b aligned.

-- 
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/11749#discussion_r298583875
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190628/35c97f02/attachment.html>


More information about the notifications mailing list