[riot-notifications] [RIOT-OS/RIOT] FIDO2 support in RIOT (#16489)

benpicco notifications at github.com
Fri Aug 27 13:57:55 CEST 2021


@benpicco commented on this pull request.



> +#ifndef FIDO2_CTAP_CTAP_MEM_H
+#define FIDO2_CTAP_CTAP_MEM_H
+
+#include <stdint.h>
+
+#include "fido2/ctap/ctap.h"
+#include "periph/flashpage.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Start page for storing resident keys
+ */
+#define CTAP_FLASH_RK_START_PAGE 15U

Hm maybe we should have that. For `cpu/cortexm_common` it would be

```C
unsigned flashpage_first_free(void)
{
    const uint32_t *end_fw = &_etext + (&_erelocate - &_srelocate);
    return flashpage_page(&end_fw) + 1;
}
```

but then why not start at the end of the flash and subtract as much space as you need (`FLASHPAGE_NUMOF - x`).

But then again why do you need multiple flashpages / a whole flashpage for each struct?
We could reasonably well place a memory region at the end of flash with the linker script, but that would make no guarantees about what number of flash pages you get.
Is this some attempt at wear-leveling? 

-- 
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/16489#discussion_r697382718
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210827/21bcede4/attachment-0001.htm>


More information about the notifications mailing list