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.
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`.
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.
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.
- 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.
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.
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.
- 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
- 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
... 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.
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.)
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.
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.
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);`
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>