tests: storage: flash_map: adding qemu platform

Added QEMU platform to the Flash Map test and defined partitions for
QEMU dts.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This commit is contained in:
Kamil Piszczek 2019-04-18 14:56:14 +02:00 committed by Carles Cufí
parent 6ae532a328
commit dae15fa736
14 changed files with 162 additions and 15 deletions

View file

@ -26,12 +26,13 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,flash = &flash_sim0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-uart = &uart1;
zephyr,uart-pipe = &uart1;
zephyr,bt-mon-uart = &uart1;
zephyr,code-partition = &slot0_partition;
};
soc {
@ -56,3 +57,30 @@
status = "ok";
current-speed = <115200>;
};
&flash_sim0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Storage partition will be used by FCB/NFFS/NVS if enabled. */
storage_partition: partition@1000 {
label = "storage";
reg = <0x00001000 0x00010000>;
};
slot0_partition: partition@11000 {
label = "image-0";
reg = <0x00011000 0x00010000>;
};
slot1_partition: partition@21000 {
label = "image-1";
reg = <0x00021000 0x00010000>;
};
};
};

View file

@ -9,9 +9,19 @@
*/
/ {
sim_flash: sim-flash {
sim_flash {
compatible = "sim-flash";
label = "FLASH_SIMULATOR";
#address-cells = <1>;
#size-cells = <1>;
flash_sim0: flash_sim@0 {
compatible = "soc-nv-flash";
reg = <0x00000000 DT_FLASH_SIZE>;
erase-block-size = <1024>;
write-block-size = <4>;
};
};
};

View file

@ -6,8 +6,6 @@ project(multi-fs)
zephyr_compile_definitions(
-DTEST_FLASH_OFFSET=0
-DDT_FLASH_AREA_STORAGE_OFFSET=0
-DDT_FLASH_AREA_STORAGE_SIZE=1048576
)
FILE(GLOB app_sources src/*.c)

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/delete-node/ &storage_partition;
&flash_sim0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x100000>;
};
};
};

View file

@ -11,8 +11,6 @@ project(basic)
if(BOARD STREQUAL qemu_x86)
zephyr_compile_definitions(
-DTEST_FLASH_OFFSET=0
-DDT_FLASH_AREA_STORAGE_OFFSET=0
-DDT_FLASH_AREA_STORAGE_SIZE=1048576
)
elseif(BOARD STREQUAL nrf52840_pca10056)
zephyr_compile_definitions(

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/delete-node/ &storage_partition;
&flash_sim0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x100000>;
};
};
};

View file

@ -11,8 +11,6 @@ project(cache)
if(BOARD STREQUAL qemu_x86)
zephyr_compile_definitions(
-DTEST_FLASH_OFFSET=0
-DDT_FLASH_AREA_STORAGE_OFFSET=0
-DDT_FLASH_AREA_STORAGE_SIZE=1048576
)
elseif(BOARD STREQUAL nrf52840_pca10056)
zephyr_compile_definitions(

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/delete-node/ &storage_partition;
&flash_sim0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x100000>;
};
};
};

View file

@ -11,8 +11,6 @@ project(large)
if(BOARD STREQUAL qemu_x86)
zephyr_compile_definitions(
-DTEST_FLASH_OFFSET=0
-DDT_FLASH_AREA_STORAGE_OFFSET=0
-DDT_FLASH_AREA_STORAGE_SIZE=1048576
)
elseif(BOARD STREQUAL nrf52840_pca10056)
zephyr_compile_definitions(

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/delete-node/ &storage_partition;
&flash_sim0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x100000>;
};
};
};

View file

@ -11,8 +11,6 @@ project(performance)
if(BOARD STREQUAL qemu_x86)
zephyr_compile_definitions(
-DTEST_FLASH_OFFSET=0
-DDT_FLASH_AREA_STORAGE_OFFSET=0
-DDT_FLASH_AREA_STORAGE_SIZE=1048576
)
elseif(BOARD STREQUAL nrf52840_pca10056)
zephyr_compile_definitions(

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/delete-node/ &storage_partition;
&flash_sim0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x100000>;
};
};
};

View file

@ -2,4 +2,3 @@ CONFIG_ZTEST=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

View file

@ -1,5 +1,5 @@
tests:
storage.flash_map:
platform_whitelist: nrf52840_pca10056 nrf52_pca10040 nrf51_pca10028
frdm_k64f hexiwear_k64
frdm_k64f hexiwear_k64 qemu_x86
tags: flash_map