zephyr: add slot-1 in RAM confg for nrf52840dk_nrf52840

Added configuration for emulate the secondary image flash.
Thanks to that it is easy to test mcuboot behavior while
the secondary flash device stop working.
Need additionally to modify the zephyr/drivers/flash/flash_simulator.c
driver, soflash_sim_read() always returns an error e.g: -EINVAL.

For building mcuboot use following comand-line:
west build -d build/mcuboot_y -b nrf52840dk_nrf52840 \
bootloader/mcuboot/boot/zephyr/ -- \
-DDTC_OVERLAY_FILE=./boards/nrf52840dk_ram.overlay \
-DOVERLAY_CONFIG=./boards/flash_sim_driver.conf

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
Andrzej Puzdrowski 2021-06-30 09:44:45 +02:00 committed by David Brown
parent 85da97f2fb
commit d874417787
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,2 @@
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_UNALIGNED_READ=y

View File

@ -0,0 +1,57 @@
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/delete-node/ &slot1_partition;
/delete-node/ &slot0_partition;
/delete-node/ &boot_partition;
&flash0 {
partitions {
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x000000000 0x00010000>;
};
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x000010000 0x00000A000>;
};
};
};
/ {
soc {
flash_controller2: flash-controller@2 {
compatible = "zephyr,sim-flash";
reg = <0x00000000 DT_SIZE_K(40)>;
#address-cells = <1>;
#size-cells = <1>;
erase-value = <0xff>;
label = "flash_ctrl";
flash_sim0: flash_sim@0 {
status = "okay";
compatible = "soc-nv-flash";
label = "simulated_flash";
erase-block-size = <4096>;
write-block-size = <1>;
reg = <0x00000000 DT_SIZE_K(40)>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
slot1_partition: partition@0 {
label = "image-1";
reg = <0x00000000 0x00000A000>;
};
};
};
};
};
};