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

Dylan Laduranty notifications at github.com
Tue Nov 17 20:34:02 CET 2020


### Contribution description

This is the second attempt to add Device Firmware Upgrade (DFU) support to USBUS and thus replace #13856 
This PR provides the same features from the previous one but with the following additions/changes:
- DFU feature is no more an experimental feature
- DFU integration to riotboot was added
- Dedicated bootloader app was created
- Kconfig support was also added.
- `no_idle_thread` feature is now needed by riotboot when DFU is used

Currently, the DFU bootloader mode is triggered by `dfu_utils` only and riotboot checks the last 4-bytes of RAM for a magic word to enter in DFU mode (otherwise we skip it)
Of course, other mechanisms could be implement in follow-up PRs.

This PR was tested with SAME54-XPRO and a Linux host machine. It would be great to test on nRF52 and STM32 but I don't own such hardware.
Note: periph_flashpage must be supported by your MCU to use DFU.


### Testing procedure

**#FLASH RIOTBOOT BOOTLOADER**
`USEMODULE=riotboot_usb_dfu BOARD=same54-xpro make -C bootloaders/riotboot_dfu flash`
**#FLASH INITIAL APP**
`APP_VER=3 BOARD=same54-xpro USEMODULE=usbus_dfu make -C tests/leds riotboot/flash-slot0`
**#COMPILE NEW APP TO UPLOAD THROUGH DFU**
`APP_VER=4 BOARD=same54-xpro USEMODULE=usbus_dfu make -C tests/shell riotboot/slot1 `
**#FLASH USING DFU**
`sudo dfu-util -a 0 -R -D tests/shell/bin/same54-xpro/tests_shell-slot1.4.riot.bin`


### Issues/PRs references

Replaces #13856 

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/15460

-- Commit Summary --

  * usbus/dfu: introduce initial Device Firmware Upgrade support for USBUS
  * cpu/cortexm_common: increase RIOTBOOT_LEN size when usbus_dfu is used
  * sys/auto_init: add support for DFU
  * sys/riotboot: add DFU support to riotboot
  * bootloader: create new bootloader application with DFU support
  * Kconfig: add Kconfig support for DFU

-- File Changes --

    A bootloaders/riotboot_dfu/Makefile (40)
    A bootloaders/riotboot_dfu/main.c (67)
    M cpu/cortexm_common/Makefile.include (8)
    M sys/Makefile.dep (13)
    M sys/Makefile.include (5)
    M sys/auto_init/usb/auto_init_usb.c (8)
    A sys/include/riotboot/usb_dfu.h (40)
    A sys/include/usb/dfu.h (176)
    A sys/riotboot/usb_dfu.c (41)
    M sys/usb/usbus/Kconfig (1)
    M sys/usb/usbus/Makefile (3)
    A sys/usb/usbus/dfu/Kconfig (34)
    A sys/usb/usbus/dfu/Makefile (4)
    A sys/usb/usbus/dfu/dfu.c (260)
    M sys/usb/usbus/usbus_control.c (17)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/15460.patch
https://github.com/RIOT-OS/RIOT/pull/15460.diff

-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201117/986825a4/attachment.htm>


More information about the notifications mailing list