[riot-notifications] [RIOT-OS/RIOT] usbus/dfu: add Device Firmware Upgrade support for USBUS (2nd attempt) (#15460)

Dylan Laduranty notifications at github.com
Sun Nov 29 11:10:27 CET 2020


@dylad commented on this pull request.



> +    for (unsigned i = 0; i < riotboot_slot_numof; i++) {
+        const riotboot_hdr_t *riot_hdr = riotboot_slot_get_hdr(i);
+        if (riotboot_slot_validate(i)) {
+            /* skip slot if metadata broken */
+            continue;
+        }
+        if (riot_hdr->start_addr != riotboot_slot_get_image_startaddr(i)) {
+            continue;
+        }
+        if (slot == -1 || riot_hdr->version > version) {
+            version = riot_hdr->version;
+            slot = i;
+        }
+    }

In theory, if there is no slot, we could flash the firmware right after the bootloader. The main issue I have with this now: If something is wrong with the firmware resulting in a unbootable app. We will have no way to retrigger the bootloader DFU as it is called by `dfu-utils` if it find a device declaring a dfu application interface. If the application doesn't boot, this interface will not exist.
Hopefully, we can add other way to trigger the bootloader DFU: douple-tap reset, GPIO state at boottime, etc. But I like to keep this for another PR.

-- 
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/15460#discussion_r532186472
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201129/da6a4a00/attachment.htm>


More information about the notifications mailing list