The drop down does not list the nrf5340dk.
Using nRF Connect Toolchain Manager I open a command prompt in the v1.5.0 sdk,
cd zephyr\samples\drivers\spi_flash
I did:
west build -b nrf5340dk_nrf5340_cpuappns
and got:
Kconfig header saved to 'C:/ncs/v1.5.0/zephyr/samples/drivers/spi_flash/build/spm/zephyr/include/generated/autoconf.h' -- The C compiler identification is GNU 9.2.1 -- The CXX compiler identification is GNU 9.2.1 -- The ASM compiler identification is GNU -- Found assembler: C:/ncs/v1.5.0/toolchain/opt/bin/arm-none-eabi-gcc.exe -- Configuring done -- Generating done -- Build files have been written to: C:/ncs/v1.5.0/zephyr/samples/drivers/spi_flash/build/spm === child image spm - end === -- Configuring done CMake Error at ../../../cmake/extensions.cmake:416 (add_library): No SOURCES given to target: drivers__spi Call Stack (most recent call first): ../../../cmake/extensions.cmake:393 (zephyr_library_named) ../../../drivers/spi/CMakeLists.txt:3 (zephyr_library) CMake Generate step failed. Build files cannot be regenerated correctly.
Looking at the spi_flash\boards directory I didn't find nrf5340dk_nrf5340_cpuappns .conf I found nrf5340dk_nrf5340_cpuapp.conf
I copied nrf5340dk_nrf5340_cpuapp.conf to nrf5340dk_nrf5340_cpuappns.conf
and
west build -b nrf5340dk_nrf5340_cpuappns --pristine
then programmed the DK:
JEDEC QSPI-NOR SPI flash testing
==========================
Test 1: Flash erase
Flash erase succeeded!
Test 2: Flash write
Attempting to write 4 bytes
Data read matches data written. Good!!
My thanks to jeff4BLE https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/adding-a-peripheral-to-an-ncs-zephyr-project
and the walk through devicetree, kconfig, api searching
The zephyr/samples/drivers/spi_flash/boards folder needs a nrf5340dk_nrf5340_cpuappns.conf file placed there unless this was a test to see who is awake.
And there is no nRF5340-DK in the tags