-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usbus/dfu: do not create alt interface if NUM_SLOTS=1 #19386
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dylad
added
the
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
label
Mar 13, 2023
github-actions
bot
added
Area: sys
Area: System
Area: USB
Area: Universal Serial Bus
labels
Mar 13, 2023
benpicco
approved these changes
Mar 13, 2023
If riotboot is built with NUM_SLOTS=1, there is no reason to advertise a second slot in the bootloader Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
dylad
force-pushed
the
pr/dfu/limit_slot1_exposition
branch
from
March 13, 2023 20:52
eb41368
to
65475af
Compare
bors merge |
bors bot
added a commit
that referenced
this pull request
Mar 13, 2023
19382: tests/pkg_nanors: use static allocation r=benpicco a=benpicco 19386: usbus/dfu: do not create alt interface if NUM_SLOTS=1 r=benpicco a=dylad ### Contribution description In some cases, it is really useful to build `riotboot` with `NUM_SLOTS=1`. When use in combination with `riotboot_dfu`, there is no need to export the second slot if `riotboot` is built with `NUM_SLOTS=1`. Thus, prevent the alt interface declaration in dfu if `NUM_SLOTS=1` so that only slot0 can be used to flash. ### Testing procedure Add `NUM_SLOTS=1` to `bootloaders/riotboot_dfu/Makefile` Flash the riotboot DFU bootloader to any board supported by USBUS: `make BOARD=xxx -C bootloaders/riotboot_dfu flash` and run `dfu-util -l` With NUM_SLOTS=2 you will get: ``` dfu-util -l dfu-util 0.11 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2021 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ Found DFU: [1209:7d02] ver=0100, devnum=11, cfg=1, intf=0, path="1-4", alt=1, name="RIOT-OS Slot 1", serial="AB88DCAE80893484" Found DFU: [1209:7d02] ver=0100, devnum=11, cfg=1, intf=0, path="1-4", alt=0, name="RIOT-OS Slot 0", serial="AB88DCAE80893484" ``` with NUM_SLOTS=1 you will get: ``` dfu-util -l dfu-util 0.11 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2021 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ Found DFU: [1209:7d02] ver=0100, devnum=14, cfg=1, intf=0, path="1-4", alt=0, name="RIOT-OS Slot 0", serial="AB88DCAE80893484" ``` ### Issues/PRs references Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de> Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
bors bot
added a commit
that referenced
this pull request
Mar 13, 2023
19382: tests/pkg_nanors: use static allocation r=benpicco a=benpicco 19386: usbus/dfu: do not create alt interface if NUM_SLOTS=1 r=benpicco a=dylad ### Contribution description In some cases, it is really useful to build `riotboot` with `NUM_SLOTS=1`. When use in combination with `riotboot_dfu`, there is no need to export the second slot if `riotboot` is built with `NUM_SLOTS=1`. Thus, prevent the alt interface declaration in dfu if `NUM_SLOTS=1` so that only slot0 can be used to flash. ### Testing procedure Add `NUM_SLOTS=1` to `bootloaders/riotboot_dfu/Makefile` Flash the riotboot DFU bootloader to any board supported by USBUS: `make BOARD=xxx -C bootloaders/riotboot_dfu flash` and run `dfu-util -l` With NUM_SLOTS=2 you will get: ``` dfu-util -l dfu-util 0.11 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2021 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ Found DFU: [1209:7d02] ver=0100, devnum=11, cfg=1, intf=0, path="1-4", alt=1, name="RIOT-OS Slot 1", serial="AB88DCAE80893484" Found DFU: [1209:7d02] ver=0100, devnum=11, cfg=1, intf=0, path="1-4", alt=0, name="RIOT-OS Slot 0", serial="AB88DCAE80893484" ``` with NUM_SLOTS=1 you will get: ``` dfu-util -l dfu-util 0.11 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2021 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ Found DFU: [1209:7d02] ver=0100, devnum=14, cfg=1, intf=0, path="1-4", alt=0, name="RIOT-OS Slot 0", serial="AB88DCAE80893484" ``` ### Issues/PRs references Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de> Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Build failed (retrying...): |
Build succeeded: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: sys
Area: System
Area: USB
Area: Universal Serial Bus
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
In some cases, it is really useful to build
riotboot
withNUM_SLOTS=1
.When use in combination with
riotboot_dfu
, there is no need to export the second slot ifriotboot
is built withNUM_SLOTS=1
.Thus, prevent the alt interface declaration in dfu if
NUM_SLOTS=1
so that only slot0 can be used to flash.Testing procedure
Add
NUM_SLOTS=1
tobootloaders/riotboot_dfu/Makefile
Flash the riotboot DFU bootloader to any board supported by USBUS:
make BOARD=xxx -C bootloaders/riotboot_dfu flash
and run
dfu-util -l
With NUM_SLOTS=2 you will get:
with NUM_SLOTS=1 you will get:
Issues/PRs references