Commit Graph

17 Commits

Author SHA1 Message Date
Torsten Rasmussen 82ee5d0bb9 zephyr: fix handling of devicetree overlays in mcuboot
The current specific setting of devicetree overlay files using `set()`
has a couple of built-in flaws.

It keeps readding the overlay file on each subsequent CMake invocation.
The build command (make/ninja), will automatically invoke CMake if there
are any changes to files used as configure time dependencies.

This can easily be seen by manually re-invoking CMake:
```
 # First invocation
$ cmake -DBOARD=nrf52840dk_nrf52840  -DDTC_OVERLAY_FILE=custom.dts ..
Loading Zephyr default modules (Zephyr workspace).
-- Application: /projects/github/ncs/bootloader/mcuboot/boot/zephyr
...
-- Found devicetree overlay: custom.dts
-- Found devicetree overlay: bootloader/mcuboot/boot/zephyr/dts.overlay

 # Second invocation
$ cmake -DBOARD=nrf52840dk_nrf52840  -DDTC_OVERLAY_FILE=custom.dts ..
Loading Zephyr default modules (Zephyr workspace).
-- Application: /projects/github/ncs/bootloader/mcuboot/boot/zephyr
...
-- Found devicetree overlay: custom.dts
-- Found devicetree overlay: mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: mcuboot/boot/zephyr/dts.overlay
```

Zephyr has built-in support for application specific overlay config
which gets automatically applied when the overlay file is named:
`app.overlay`.

Therefore rename `dts.overlay` to `app.overlay`.
Ref: https://docs.zephyrproject.org/3.2.0/build/dts/howtos.html \
  #set-devicetree-overlays

This change further allows users of mcuboot to place their mcuboot
configuration out-of-tree of the sample by using the
`APPLICATION_CONFIG_DIR` setting.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-11-24 08:55:20 +01:00
Andrzej Puzdrowski 6e116e4340 zephyr/sample.yaml Limit allowed build platforms
Building sample.bootloader.mcuboot for many platforms
is not possible (for instance a qemu). The limit is need
as otherwise zephyr-rtos/zephyr CI is failing on any push to
main branch or nightly CI run.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-09-19 09:48:56 +02:00
Fabio Utzig 4b90dfcf71 zephyr: ci: enable testing more watchdog paths
Enable tests to be run on frdm_k64f and disco_l475_iot1. The l475 uses
the STM32 IWDG by default, and the k64f can be used for the generic
watchdog path. Both boards also received a config to enable the
watchdog.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2022-09-12 11:13:54 +02:00
Andrzej Puzdrowski 1c150c6092 zephyr: direct inclusion of the hooks file
This patch removes CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE option
which was used to point to hooks implementation file.
It is better that the project customization is up to add required
files instead. This gives more flexibility in provisioning these
sources (there may be multiple files).
This also simplifies Kconfig options.

In order to keep possibility for build-test the Hooks feature
hooks_sample.c will be included into the build if commandline
will specify -DTEST_BOOT_IMAGE_ACCESS_HOOKS=Y option.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-08-04 11:17:19 +02:00
Johan Öhman b588907ab1 zephyr: Wrapped the RAM loading mode in Zephyr configs.
The RAM loading mode wasn't wrapped in Zephyr configs like the other boot modes.
Added a config to enable RAM loading as well as two configs to set
IMAGE_EXECUTABLE_RAM_START and IMAGE_EXECUTABLE_RAM_SIZE, respectively. These
two values default to the values from the chosen node sram in the dts.

Signed-off-by: Johan Öhman <johan.ohman@softube.com>
2022-05-31 10:20:19 -06:00
Johann Fischer faf9cbe0f6 zephyr: CDC ACM UART node to specific overlays
Move CDC ACM UART node from common DTC overlay to
specific overlays, nrf52840_big.overlays and
usb_cdc_acm.overlays.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-27 15:21:39 +02:00
Andrzej Puzdrowski 1fceb9bdba zephyr: Added hooks for example
Example (very basic) hook implementation.
Added case description for test-build with these hooks
and multi-image feature.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 16:22:04 -06:00
Ioannis Glaropoulos eb4c2fe3b2 boot: zephyr: add integration platforms to the allow list
The platforms that are listed as integration platforms in
the Zephyr boot sample need to be included in the platform
allow list, otherwise zephyr CI will throw an error. This
commit removes the common list of integration platforms and
adds integration platform entries in each test variant, in
accordance with the allow-list in each of the variants.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-29 11:40:37 +02:00
Andrzej Puzdrowski 680ed07e42 zephyr: allow to build nRF52840 targets in zephyr-rtos CI
MCUboot was build only for frdm_k64f in zephyr CI.
Extended Zephyr-RTOS integration platform by nrf52840dk_nrf52840
and nrf52840dongle_nrf52840 which allow to build MCUBoot on
these platform in Zephyr-RTOS CI.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-06-09 15:41:04 +02:00
Fabio Utzig 6871992b5e boot: zephyr: add nrf52840 QSPI NOR overlays
Add configuration and DTS overlays to run MCUboot + smp_svr on the
nrf52840dk using the secondary slot in the external QSPI NOR flash.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-11-10 08:52:25 -03:00
Andrzej Puzdrowski 03d96ad1f6 boot/zephyr: Added single-slot Zephyr-RTOS test build
Added configuration for build in Zephyr-RTOS CI MCUBoot
in CONFIG_SINGLE_APPLICATION_SLOT=y mode.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-09-16 12:09:43 +02:00
Anas Nashif 74fc8ed1b5 sample: inclusive language: whitelist -> allow
Change whitelist->allow to be compatible with sanitycheck in zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-26 22:10:17 -03:00
Andrzej Puzdrowski 97e966a226 zephyr: fix zephyr testcase extra_tags
dtc overlay should be transfered via DTC_OVERLAY_FILE,
not by DTC_OVERLAY.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-06-05 13:30:40 -06:00
Andrzej Puzdrowski 41c5d50ec7 zephyr:boards nrf52840_pca10059 rename to nrf52840dongle_nrf52840
Board was renamed here:
zephyrproject-rtos/zephyr#24049

Patch aligns the name in MCUBoot.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-04-06 11:14:25 +02:00
Andrzej Puzdrowski fefdea20d2 zephyr:boards nrf52840_pca10056 rename to nrf52840dk_nrf52840
Board was renamed here:
https://github.com/zephyrproject-rtos/zephyr/pull/23524/

Patch aligns the name in MCUBoot and decouples one of nrf52840 dedicated
overlay from exact board name.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-03-27 15:35:23 -06:00
Andrzej Puzdrowski 3f092bd313 zephyr: allow recovery over usb cdc-acm with logs enabled
Modified serial_adapter so log are allowed when using USB
CDC ACM serial port emulation.

Added dedicated thread for log processing of the highest application
priority. This allows to transmit all logs without adding k_sleep
anywhere else int the code.

Introduced boot log thread is simpler than the default log threat
which decreases flash footprint by a few dozen bytes.
Added configuration for nrf52840_pca10056 which shows how
to enable looging along with USB - among other, thread log
processing is required.

build command (form zephyr-project root directory)
west build -d build/mcuboot/nrf52840_pca10056 -b nrf52840_pca10056
./bootloader/mcuboot/boot/zephyr/
 -- -DDTC_OVERLAY_FILE=./boards/nrf52840_pca10056_big.overlay
-DOVERLAY_CONFIG=./usb_cdc_acm_log_recovery.conf

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-02-27 10:01:25 +01:00
Andrzej Puzdrowski 6210164f71 zephyr: add zephyr's sanitycheck description
Added sample.yaml which is required for automatic building
mcuboot using zephyr sanitycheck.

Can be run by zephyr sanitycheck locally using
--testcase-root=/path/to/mcuboot/boot/zephyr
to make it detect the sample.yaml added.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-12-16 18:40:34 +01:00