From a905091666a34123f176ff268369082f96d96c08 Mon Sep 17 00:00:00 2001 From: Hendrik Sauer Date: Wed, 21 Jul 2021 14:15:00 +0200 Subject: [PATCH] Simulate flash for native posix --- .gitignore | 2 +- zephyr/CMakeLists.txt | 2 +- zephyr/boards/native_posix_64.conf | 7 ++++--- zephyr/native_posix_64.overlay | 12 ++++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 zephyr/native_posix_64.overlay diff --git a/.gitignore b/.gitignore index 163fd9e..b5e3776 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ build/ - +flash.bin # Random seed file created by test scripts and sample programs seedfile diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 638e388..9425a7b 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -15,7 +15,7 @@ if(DEFINED NATIVE_POSIX) endif () target_include_directories(app PUBLIC ${exposure-notification_SOURCE_DIR}/include) - FILE(GLOB app_sources ../src/*.c* ${exposure-notification_SOURCE_DIR}/src/*.c*) + FILE(GLOB app_sources ../src/*.c* ../src/ens/*.c* ${exposure-notification_SOURCE_DIR}/src/*.c*) else() FILE(GLOB app_sources ../src/*.c*) endif() diff --git a/zephyr/boards/native_posix_64.conf b/zephyr/boards/native_posix_64.conf index 0a31b86..a24c0db 100644 --- a/zephyr/boards/native_posix_64.conf +++ b/zephyr/boards/native_posix_64.conf @@ -17,7 +17,8 @@ CONFIG_DISPLAY=y CONFIG_DISPLAY_LOG_LEVEL_ERR=y CONFIG_BT=n -CONFIG_FLASH=n -# TODO: Add configuration for flash emulation +# CONFIG_FLASH=n +CONFIG_FLASH_SIMULATOR=y -CONFIG_HEAP_MEM_POOL_SIZE=32768 +CONFIG_HEAP_MEM_POOL_SIZE=8192 +# CONFIG_HEAP_MEM_POOL_SIZE=32768 diff --git a/zephyr/native_posix_64.overlay b/zephyr/native_posix_64.overlay new file mode 100644 index 0000000..ee29a41 --- /dev/null +++ b/zephyr/native_posix_64.overlay @@ -0,0 +1,12 @@ +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ens_storage"; + reg = <0x0 0x00004000>; + }; + }; +};