1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

44 Commits

Author SHA1 Message Date
Fabian Hüßler
bb80878fad makefiles: add OPENOCD_DEBUG_ADAPTER and SLOT_AUX_LEN to riotboot build env. 2024-06-14 17:44:40 +02:00
Joshua DeWeese
7b66eb2c47 bootloaders/riotboot: add INCLUDES to build
If external boards defined in one of the EXTERNAL_BOARD_DIRS folders
pulls in a header file external to the RIOT tree and added to the build
via the INCLUDES macro, the build will fail to find the header.

This patch adds the INCLUDES macro to the bootloader build step so that
the headers can be found.
2023-12-21 16:33:02 -05:00
Gunar Schorcht
3d4e8d6a0d makefiles/boot/riotboot-dfu-util: add tinyusb_dfu support 2023-01-15 18:09:55 +01:00
Gunar Schorcht
3100345214 makefiles: add riotboot_dfu-util.mk to override board's dfu-util config
Boards that are shipped with a DFU bootloader define the `dfu-util` configuration in their `Makefile.include`. However, when `riotboot_dfu` is used as the DFU bootloader, the board's `dfu-util` configuration must be overridden by the configuration as required by `riotboot_dfu` to use it to flash applications. Therefore, all `dfu-util` configurations are defined as overridable in the board's `Makefile.include` and the configuration as required by `riotboot_dfu` is included before the board's `Makefile.include`.
2022-11-30 19:28:14 +01:00
benpicco
dd6b473a0f
Merge pull request #18138 from benpicco/makefiles/boot/riotboot-elffile
makefiles/boot/riotboot: set DEBUG_ELFFILE to slot0.elf
2022-06-02 16:10:09 +02:00
Francisco Molina
a945ea144f makefiles/tools/uf2conv.inc.mk: partial riotboot support
Individual files need to be converted to uf2 format, targets
flashing individual slots or the bootloader will work:

- riotboot/flash-slot%
- riotboot/flash-bootloader

'flash' also works by flashing both the bootloader and slot0
independently.

But not targets flashing combined/extended versions since conversion
of the blob is not possible with the uf2conv.py script.
2022-06-01 11:01:30 +02:00
Benjamin Valentin
1925c99436 makefiles/boot/riotboot: set DEBUG_ELFFILE to slot0.elf
When doing a `make debug` on a board with riotboot bootloader, the original
(non-offset) elf file gets selected.

This causes all ROM addresses to be at the wrong offset, leading to strange
debug behavior.

Set `DEBUG_ELFFILE` to the .elf file that already accounts for the bootloader
offset so the debugger gets the correct addresses.
2022-05-31 12:30:49 +02:00
Francisco Molina
76ee54e69c makefiles: use memoized for EPOCH, also define for suit
APP_VER must also be defined for suit.inc.mk in case non-fw payloads
are used (e.g. no riotboot)

Use memoized so the shell call happens only if needed
2022-04-21 11:39:25 +02:00
Francisco Molina
17c6717093 makefiles/boot/riotboot: refactor file storage and naming
- rename riotboot files so that they are of the form: slot<n>.<version>.bin
- move all generated files under $(BINDIR)/riotboot_files (this can be
  overwritten.
2022-04-21 11:39:25 +02:00
Francisco Molina
ce35647f6a makefiles: allow to override suit manifest payloads
This adds:

* SUIT_MANIFEST_BASENAME: allow for non slotfiles payloads to have
different names that slotfiles payloads.
* SUIT_MANIFEST_PAYLOADS: firmware payloads to be published with the
manifest.
* SUIT_MANIFEST_SLOTFILES: firmware payloads referenced by the manifest
in the form 'filename:[offset]:[comp_name]' as expected by
gen_manifest.py.

With this the same recipes suit/publish suit/notify can be used with
non slotfiles payloads.
2022-04-21 11:39:25 +02:00
Francisco Molina
f74d8ea6bb
makefiles/boot/riotboot.mk: pass IOTLAB_NODE 2021-06-16 12:24:09 +02:00
Francisco Molina
edeacbf85a
makefiles/boot/riotboot: clean bootloader when cleaning application 2021-06-07 09:38:52 +02:00
eca4ff7a04 make: make riotboot target depend on pkg-prepare
When riotboot depends on a package for building that the main
application also depends on (e.g., gecko_sdk for efm32), previously,
that package would be checked out twice in parallel, which fails.

This commit adds pkg-prepare as dependency to the bootloader target,
ensuring any packages are already up-to-date before calling the
bootloader submake.
2021-04-09 11:12:58 +02:00
Dylan Laduranty
db7d0777b8
Merge pull request #16260 from dylad/pr/riotboot_dfu/auto_dfu_alt
riotboot_dfu: select DFU_ALT automatically when invoking make flash-slotX
2021-04-06 20:27:18 +02:00
dylad
7eae017d5d makefiles/dfu-util: add default DFU_ALT for riotboot/flash-slotX 2021-04-01 20:29:46 +02:00
chrysn
bf571ad7b2 riotboot: Build ARCHIVES
Like /Makefile.include builds ARCHIVES before ELFFILES.
2021-03-22 20:43:41 +01:00
af37f5b9bc
makefiles/boot: map PROGRAMMER_QUIET to riotboot/flash% 2021-02-25 12:59:40 +01:00
1a04e3c323
makefiles/boot: use same PROGRAMMER to flash riotboot 2021-02-18 14:34:17 +01:00
Leandro Lanzieri
c99559222f
makefiles/riotboot: ensure BUILDDEPS are built before riotboot targets 2021-01-26 18:04:22 +01:00
Bas Stottelaar
12e9818430 riotboot: quote PATH variable 2020-11-05 22:59:29 +01:00
Marian Buschsieweke
ba7815163c
Makefile*: Allow multiple external board dirs
- Add the new EXTERNAL_BOARD_DIRS variable that can contain a space separated
  list of folders containing external boards
- Introduce $(BOARDDIR) as shortcut for $(BOARDSDIR)/$(BOARD)
- Map the existing BOARDSDIR to the new approach
    - If BOARDSDIR is provided by the user, it will be added to
      EXTERNAL_BOARD_DIRS for backward compatibility. (And a warning is issued
      to encourage users migrating to EXTRA_BOARDS.)
    - BOARDSDIR is updated after the board is found to "$(BOARDDIR)/..".
        - Useful for `include $(BOARDSDIR)/common/external_common/Makefile.dep`
        - Provides backward compatibility
2020-04-29 18:32:39 +02:00
Sven Herrmann
9a58aaa354 riotboot: forward BOARDSDIR 2020-04-02 14:21:42 +00:00
14bdf8f46b
sys/suit: Add SUIT draft ietf-v3 firmware upgrade module
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2020-03-18 14:13:12 +01:00
Francisco Molina
aa5c6173eb makefiles/boot/riotboot.mk: exclude if RIOTBOOT_BUILD is set
- riotboot targets should not be needed for riotboot application
  so dont include it.
- also fixes #12003 by not setting FLASHFILE = $(RIOTBOOT_EXTENDED_BIN)
  when compiling riotboot application
2020-01-10 11:44:04 +01:00
Francisco Molina
12761934bc tests/riotboot: migrate to full python test script 2019-12-02 17:27:35 +01:00
fb12c4aa8d sys/suit: add SUIT draft v4 firmware upgrade module
This commit adds a sys module implementing SUIT draft v4 compatible
firmware updates.

Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Francisco Molina <femolina@uc.cl>
2019-10-09 11:05:01 +02:00
Francisco Molina
5790e061c7 makefiles/boot/riotboot.mk: use BUILD_FILES
- Fixes compiling in docker by using BUILD_FILES to define
  extra files to be built
2019-09-30 13:09:58 +02:00
Francisco Molina
c08801eb65 makefiles/riotboot: pass DEBUG_ADAPTER_ID to bootloader recipes 2019-07-24 16:27:37 +02:00
b4557eae16 make: riotboot: add $APP_VER to image file names 2019-07-15 13:38:37 +02:00
4546469e7b make: riotboot: ensure epoch in APP_VER is evaluated once 2019-07-15 13:38:37 +02:00
aaa187e871 riotboot: always link both slot .elf when linking
This enables "make test" and "make test-murdock" to rely on both images being
present and thus execute without re-compiling.
2019-07-15 11:30:49 +02:00
6b2727c693 make/riotboot: allow slot image creation without compiling 2019-07-15 11:30:49 +02:00
bb71e979f3 riotboot: set FLASHFILE to RIOTBOOT_EXTENDED_BIN
... if the riotboot feature is used.

Previously, even an application that had "FEATURES_REQUIRED += riotboot"
set would still flash the non-riotboot binary on "make flash".
This is usualy not what the user wants.

This commit set's the FLASHFILE variable to the combined "riotboot
bootloader + slot0 + empty slot1" binary. This has the effect that make
all, flash and flash-only will compile and/or flash a working riotboot
setup.

tests/riotboot and tests/riotboot_flashwrite now default to flashing the
riotboot-extended binary. tests/riotboot was previously configured to
use the riotboot-combined binary. This has been changed in order to not
behave differently than how usual riotboot applications do.
2019-07-08 16:33:01 +02:00
Gaëtan Harter
ff13208751
riotboot: remove compatibility for ELFFILE as file to flash
Openocd boards are now updated.
2019-03-26 19:26:42 +01:00
Gaëtan Harter
6e7982bf08
makefiles/boot/riotboot.mk: fix unrelated introduced change
This change was introduced by mistake by the `edbg` refactoring. This
restores the original value for openocd.
2019-03-26 16:36:16 +01:00
Gaëtan Harter
d4775ccf96
riotboot: remove compatibility for HEXFILE as file to flash
It is now the case for `edbg`.
Openocd support still needs special handling.
2019-03-26 13:35:04 +01:00
a15f07b04b riotboot: move slot variables to sys/riotboot/Makefile.include 2019-03-15 12:32:50 +01:00
09a40fb6fc riotboot: use epoch as APP_VER default 2019-03-14 12:04:56 +01:00
Juan Carrano
748bc6deee makefiles/riotboot: use canned recipe for flashing.
A canned recipe had previously been defined to perform the flashing
procedure. The canned recipe is preferred to calling $(FLASHER) $(FFLAGS)
as there might be additional steps involved in flashing (this is handled by
preflash currently but with the canned recipe we will be able to fix it.)
2019-03-05 14:39:57 +01:00
Gaëtan Harter
7a88bb4c1f
riotboot: prepare for when FLASHFILE is used
This currently does nothing but setting FLASHFILE when flashing.
This will allow passing the variable when flasher will use the FLASHFILE
variable.
2019-03-05 12:04:15 +01:00
Gaëtan Harter
240e4a3fe2
makefiles/riotboot.mk: slots only need to depend on BASELIBS
Using 'link' was working too but will introduce a circular dependency
when FLASHFILE is one of the slot files.

This trims down to the minimal required dependency to work. It is now
the same as `ELFFILE` dependencies.
2019-03-05 11:22:11 +01:00
Francisco Acosta
8a0a0be426 riotboot: allow to overwrite slot 1
By erasing slot 1 header the slot gets invalidated.
This is very useful while debugging, since we can
force the bootloader to ignore anything on that
slot.
2019-01-02 17:56:11 +01:00
Francisco Acosta
ec24ea49b1 riotboot: add support for multislot
riotboot looks for valid, available slots and compares its
version. The slot with the highest version is booted, otherwise
if no valid slot is found it loops on `while(1);`
2019-01-02 17:56:11 +01:00
Francisco Acosta
281d8084bf riotboot: add riot-based minimal bootloader
riotboot is introduced here and makes use of riotboot_hdr,
which indentifies the images encapsulated as slots.
The slot size and offset is configurable, which makes
slots extendable if needed, e.g. 2 or more slots can be
transparently added.

Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
Co-authored-by: Gaëtan Harter <gaetan.harter@fu-berlin.de>
2018-12-18 19:31:35 +01:00