how to enable GPIO+SPI mode on ble application

Hi,

I am using NCS v2.4.2 and nRF5340DK + nRF21540EK but I can not enable GPIO+SPI mode.

for example, I use nrf/samples/bluetooth/central_and_peripheral_hr application.

I built the following.

west build -p -b nrf5340dk_nrf5340_cpuapp -d build-ble-hrs nrf/samples/bluetooth/central_and_peripheral_hr -- \
-DSHIELD=nrf21540_ek_fwd -Dhci_rpmsg_SHIELD=nrf21540_ek

I checked netcpu config but GPIO+SPI mode was not enabled. I did not modify NCS code.

what should I do?

 

also, I tried to add child/hci_rpmsg.conf and add the folloing in the conf file.

CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y

I could enable GPIO+SPI mode by the conf file but the following error output.

It seems netcpu side is crushed. Please help me.

Parents
    1. please let me know your using ncs version. I am using ncs v2.4.1.
    2. please comfirm whether 10dbm and 20dgm are controled by 
      BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL command.
       
  • Hi Sorry, I had to delete my previous reply as it was wrong.

    You need to still use this below

    west build -b nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf21540ek_fwd -Dhci_ipc_SHIELD=nrf21540ek

  • I updated ncs version to v2.7.0. I tried your the build way.
    but the build was not success.

    devicetree error: /home/user/ncs/nrf/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay:16 (column 1): parse error: undefined node label 'gpio_fwd'
    I used nrf/samples/bluetooth/peripheral_uart sample.
    your env is no problem?

  • I tried it long ago, but I had no problem running this sample with the command I shown in my previous reply.

  • it is strange. I re-checked by fresh wsl2 ubuntu22 env. I could not build. what wrong ?
    I did not change the following install step.
    Installing the nRF Connect SDK (nordicsemi.com)

    ~/tmp/ncs$ west build -p -b nrf5340dk/nrf5340/cpuapp -d build-peri-uart nrf/samples/bluetooth/peripheral_uart -- -DSHIELD=nrf21540ek_fwd -Dhci_ipc_SHIELD=nrf21540ek
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3.9 (found suitable version "3.9.18", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Shield(s): nrf21540ek_fwd
    Parsing /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/Kconfig.sysbuild
    Loaded configuration '/home/user/tmp/ncs/build-peri-uart/_sysbuild/empty.conf'
    Merged configuration '/home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/sysbuild.conf'
    Configuration saved to '/home/user/tmp/ncs/build-peri-uart/zephyr/.config'
    Kconfig header saved to '/home/user/tmp/ncs/build-peri-uart/_sysbuild/autoconf.h'
    -- 
       *************************************
       * Running CMake for peripheral_uart *
       *************************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.6.20240605.1004412633878 for building. (/home/user/ncs/toolchains/e9dba88316/cmake)
    -- Found Python3: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3 (found suitable version "3.9.18", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 3.6.99 (/home/user/tmp/ncs/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Shield(s): nrf21540ek_fwd
    -- Found host-tools: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/user/tmp/ncs/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: /home/user/tmp/ncs/nrf/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay
    -- Found devicetree overlay: /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/app.overlay
    -- Generated zephyr.dts: /home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/dts.cmake
    Parsing /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/Kconfig
    Loaded configuration '/home/user/tmp/ncs/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/prj.conf'
    Merged configuration '/home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/.config.sysbuild'
    Configuration saved to '/home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/.config'
    Kconfig header saved to '/home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- libmetal version: 1.5.0 (/home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart)
    -- Build type:  
    -- Host:    Linux/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- Looking for include file stdatomic.h
    -- Looking for include file stdatomic.h - found
    -- open-amp version: 1.5.0 (/home/user/tmp/ncs/modules/lib/open-amp/open-amp)
    -- Host:    Linux/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    -- Looking for include file fcntl.h
    -- Looking for include file fcntl.h - found
    -- Using ccache: /home/user/ncs/toolchains/e9dba88316/usr/bin/ccache
    CMake Warning at /home/user/tmp/ncs/zephyr/kernel/CMakeLists.txt:170 (message):
      
    
              CONFIG_HEAP_MEM_POOL_SIZE is less than requested minimum:
                2048 < 4096
              Setting the system heap size to 4096
    
    
    CMake Warning at /home/user/tmp/ncs/zephyr/CMakeLists.txt:2027 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/user/tmp/ncs/build-peri-uart/peripheral_uart
    -- 
       *******************************
       * Running CMake for ipc_radio *
       *******************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/tmp/ncs/nrf/applications/ipc_radio
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.6.20240605.1004412633878 for building. (/home/user/ncs/toolchains/e9dba88316/cmake)
    -- Found Python3: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3 (found suitable version "3.9.18", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 3.6.99 (/home/user/tmp/ncs/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpunet
    -- Shield(s): nrf21540ek_fwd
    -- Found host-tools: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/user/tmp/ncs/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts
    -- Found devicetree overlay: /home/user/tmp/ncs/nrf/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay
    devicetree error: /home/user/tmp/ncs/nrf/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay:16 (column 1): parse error: undefined node label 'gpio_fwd'
    -- In: /home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr, command: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3;/home/user/tmp/ncs/zephyr/scripts/dts/gen_defines.py;--dts;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;/home/user/tmp/ncs/nrf/dts/bindings;/home/user/tmp/ncs/zephyr/dts/bindings;--header-out;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/include/generated/devicetree_generated.h.new;--dts-out;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/zephyr.dts.new;--edt-pickle-out;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/edt.pickle;--vendor-prefixes;/home/user/tmp/ncs/nrf/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;/home/user/tmp/ncs/zephyr/dts/bindings/vendor-prefixes.txt
    CMake Error at /home/user/tmp/ncs/zephyr/cmake/modules/dts.cmake:296 (message):
      gen_defines.py failed with return code: 1
    Call Stack (most recent call first):
      /home/user/tmp/ncs/zephyr/cmake/modules/zephyr_default.cmake:132 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:9 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:486 (message):
      CMake configure failed for Zephyr project: ipc_radio
    
      Location: /home/user/tmp/ncs/nrf/applications/ipc_radio
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:19 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /home/user/tmp/ncs/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!

Reply
  • it is strange. I re-checked by fresh wsl2 ubuntu22 env. I could not build. what wrong ?
    I did not change the following install step.
    Installing the nRF Connect SDK (nordicsemi.com)

    ~/tmp/ncs$ west build -p -b nrf5340dk/nrf5340/cpuapp -d build-peri-uart nrf/samples/bluetooth/peripheral_uart -- -DSHIELD=nrf21540ek_fwd -Dhci_ipc_SHIELD=nrf21540ek
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3.9 (found suitable version "3.9.18", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Shield(s): nrf21540ek_fwd
    Parsing /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/Kconfig.sysbuild
    Loaded configuration '/home/user/tmp/ncs/build-peri-uart/_sysbuild/empty.conf'
    Merged configuration '/home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/sysbuild.conf'
    Configuration saved to '/home/user/tmp/ncs/build-peri-uart/zephyr/.config'
    Kconfig header saved to '/home/user/tmp/ncs/build-peri-uart/_sysbuild/autoconf.h'
    -- 
       *************************************
       * Running CMake for peripheral_uart *
       *************************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.6.20240605.1004412633878 for building. (/home/user/ncs/toolchains/e9dba88316/cmake)
    -- Found Python3: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3 (found suitable version "3.9.18", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 3.6.99 (/home/user/tmp/ncs/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Shield(s): nrf21540ek_fwd
    -- Found host-tools: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/user/tmp/ncs/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: /home/user/tmp/ncs/nrf/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay
    -- Found devicetree overlay: /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/app.overlay
    -- Generated zephyr.dts: /home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/dts.cmake
    Parsing /home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/Kconfig
    Loaded configuration '/home/user/tmp/ncs/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart/prj.conf'
    Merged configuration '/home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/.config.sysbuild'
    Configuration saved to '/home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/.config'
    Kconfig header saved to '/home/user/tmp/ncs/build-peri-uart/peripheral_uart/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- libmetal version: 1.5.0 (/home/user/tmp/ncs/nrf/samples/bluetooth/peripheral_uart)
    -- Build type:  
    -- Host:    Linux/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- Looking for include file stdatomic.h
    -- Looking for include file stdatomic.h - found
    -- open-amp version: 1.5.0 (/home/user/tmp/ncs/modules/lib/open-amp/open-amp)
    -- Host:    Linux/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    -- Looking for include file fcntl.h
    -- Looking for include file fcntl.h - found
    -- Using ccache: /home/user/ncs/toolchains/e9dba88316/usr/bin/ccache
    CMake Warning at /home/user/tmp/ncs/zephyr/kernel/CMakeLists.txt:170 (message):
      
    
              CONFIG_HEAP_MEM_POOL_SIZE is less than requested minimum:
                2048 < 4096
              Setting the system heap size to 4096
    
    
    CMake Warning at /home/user/tmp/ncs/zephyr/CMakeLists.txt:2027 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/user/tmp/ncs/build-peri-uart/peripheral_uart
    -- 
       *******************************
       * Running CMake for ipc_radio *
       *******************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/tmp/ncs/nrf/applications/ipc_radio
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.6.20240605.1004412633878 for building. (/home/user/ncs/toolchains/e9dba88316/cmake)
    -- Found Python3: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3 (found suitable version "3.9.18", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 3.6.99 (/home/user/tmp/ncs/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpunet
    -- Shield(s): nrf21540ek_fwd
    -- Found host-tools: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (/home/user/ncs/toolchains/e9dba88316/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/user/tmp/ncs/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts
    -- Found devicetree overlay: /home/user/tmp/ncs/nrf/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay
    devicetree error: /home/user/tmp/ncs/nrf/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay:16 (column 1): parse error: undefined node label 'gpio_fwd'
    -- In: /home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr, command: /home/user/ncs/toolchains/e9dba88316/usr/local/bin/python3;/home/user/tmp/ncs/zephyr/scripts/dts/gen_defines.py;--dts;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;/home/user/tmp/ncs/nrf/dts/bindings;/home/user/tmp/ncs/zephyr/dts/bindings;--header-out;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/include/generated/devicetree_generated.h.new;--dts-out;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/zephyr.dts.new;--edt-pickle-out;/home/user/tmp/ncs/build-peri-uart/ipc_radio/zephyr/edt.pickle;--vendor-prefixes;/home/user/tmp/ncs/nrf/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;/home/user/tmp/ncs/zephyr/dts/bindings/vendor-prefixes.txt
    CMake Error at /home/user/tmp/ncs/zephyr/cmake/modules/dts.cmake:296 (message):
      gen_defines.py failed with return code: 1
    Call Stack (most recent call first):
      /home/user/tmp/ncs/zephyr/cmake/modules/zephyr_default.cmake:132 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:9 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:486 (message):
      CMake configure failed for Zephyr project: ipc_radio
    
      Location: /home/user/tmp/ncs/nrf/applications/ipc_radio
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:19 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /home/user/tmp/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /home/user/tmp/ncs/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!

Children
  • Hmm, I see the same error now that you see. But I did have this compiled properly.

    Can you please try to build this in NCSv2.7.0. I took clean sdk and sourced the zephyr\zephyr-env.sh and compiled the project.

    Things have improved in terms of ease of build in this revision. I used this command 

    west build -p -b nrf5340dk/nrf5340/cpuapp -- -Dcentral_and_peripheral_hr_SHIELD=nrf21540ek_fwd -Dipc_radio_SHIELD=nrf21540ek

    and I get this output

    $ west build -p -b nrf5340dk/nrf5340/cpuapp -- -Dcentral_and_peripheral_SHIELD=nrf21540ek_fwd -Dipc_radio_SHIELD=nrf21540ek
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/Python/python.exe (found suitable version "3.12.3", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: E:/ncs/2.7.0/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    Parsing E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/Kconfig.sysbuild
    Loaded configuration 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/_sysbuild/empty.conf'
    Merged configuration 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/_sysbuild/empty.conf'
    Configuration saved to 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/zephyr/.config'
    Kconfig header saved to 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/_sysbuild/autoconf.h'
    --
       ***********************************************
       * Running CMake for central_and_peripheral_hr *
       ***********************************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr
    -- CMake version: 3.22.0
    -- Using NCS Toolchain 2.6.20240605.885759407716 for building. (E:/ncs/toolchains/ce3b5ff664/cmake)
    -- Found Python3: E:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: E:/ncs/2.7.0/zephyr/.cache
    -- Zephyr version: 3.6.99 (E:/ncs/2.7.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 0.16.5 (E:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (E:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found Dtc: E:/ncs/toolchains/ce3b5ff664/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: E:/ncs/2.7.0/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr/zephyr/include/generated/devicetree_ge
    nerated.h
    -- Including generated dts.cmake file: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr/zephyr/dts.cmake
    Parsing E:/ncs/2.7.0/zephyr/Kconfig
    Loaded configuration 'E:/ncs/2.7.0/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/prj.conf'
    Merged configuration 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr/zephyr/.config.sysbuild'
    Configuration saved to 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr/zephyr/.config'
    Kconfig header saved to 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: e:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: E:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- libmetal version: 1.5.0 (E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr)
    -- Build type:
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- Looking for include file stdatomic.h
    -- Looking for include file stdatomic.h - found
    -- open-amp version: 1.5.0 (E:/ncs/2.7.0/modules/lib/open-amp/open-amp)
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    -- Looking for include file fcntl.h
    -- Looking for include file fcntl.h - found
    CMake Warning at E:/ncs/2.7.0/zephyr/kernel/CMakeLists.txt:170 (message):
    
    
              CONFIG_HEAP_MEM_POOL_SIZE is less than requested minimum:
                1024 < 4096
              Setting the system heap size to 4096
    
    
    CMake Warning at E:/ncs/2.7.0/zephyr/CMakeLists.txt:2027 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr
    --
       *******************************
       * Running CMake for ipc_radio *
       *******************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: E:/ncs/2.7.0/nrf/applications/ipc_radio
    -- CMake version: 3.22.0
    -- Using NCS Toolchain 2.6.20240605.885759407716 for building. (E:/ncs/toolchains/ce3b5ff664/cmake)
    -- Found Python3: E:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: E:/ncs/2.7.0/zephyr/.cache
    -- Zephyr version: 3.6.99 (E:/ncs/2.7.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpunet
    -- Shield(s): nrf21540ek
    -- Found host-tools: zephyr 0.16.5 (E:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (E:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found Dtc: E:/ncs/toolchains/ce3b5ff664/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: E:/ncs/2.7.0/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts
    -- Found devicetree overlay: E:/ncs/2.7.0/nrf/boards/shields/nrf21540ek/nrf21540ek.overlay
    -- Generated zephyr.dts: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio/zephyr/dts.cmake
    Parsing E:/ncs/2.7.0/nrf/applications/ipc_radio/Kconfig
    Loaded configuration 'E:/ncs/2.7.0/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet_defconfig'
    Merged configuration 'E:/ncs/2.7.0/nrf/applications/ipc_radio/prj.conf'
    Merged configuration 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/sysbuild/ipc_radio.conf'
    Merged configuration 'E:/ncs/2.7.0/nrf/applications/ipc_radio/overlay-bt_hci_ipc.conf'
    Merged configuration 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio/zephyr/.config.sysbuild'
    Configuration saved to 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio/zephyr/.config'
    Kconfig header saved to 'E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: e:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: E:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- libmetal version: 1.5.0 (E:/ncs/2.7.0/nrf/applications/ipc_radio)
    -- Build type:
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- Looking for include file stdatomic.h
    -- Looking for include file stdatomic.h - found
    -- open-amp version: 1.5.0 (E:/ncs/2.7.0/modules/lib/open-amp/open-amp)
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    -- Looking for include file fcntl.h
    -- Looking for include file fcntl.h - found
    CMake Warning at E:/ncs/2.7.0/zephyr/CMakeLists.txt:895 (message):
      No SOURCES given to Zephyr library: drivers__console
    
      Excluding target from build.
    
    
    CMake Warning at E:/ncs/2.7.0/zephyr/CMakeLists.txt:2027 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio
    -- Configuring done
    -- Generating done
    -- Build files have been written to: E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build
    ←[92m-- west build: building application
    [9/20] Performing build step for 'central_and_peripheral_hr'
    [4/255] Generating include/generated/version.h
    -- Zephyr version: 3.6.99 (E:/ncs/2.7.0/zephyr), build: 100befc70c74
    [255/255] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      152700 B      1008 KB     14.79%
                 RAM:       33828 B       448 KB      7.37%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/central_and_peripheral_hr/zephyr/zephyr.elf for board: nrf5340dk
    [11/20] Performing build step for 'ipc_radio'
    [5/202] Generating include/generated/version.h
    -- Zephyr version: 3.6.99 (E:/ncs/2.7.0/zephyr), build: 100befc70c74
    [202/202] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      183860 B       256 KB     70.14%
                 RAM:       55448 B        64 KB     84.61%
               SRAM1:          0 GB        64 KB      0.00%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from E:/ncs/2.7.0/nrf/samples/bluetooth/central_and_peripheral_hr/build/ipc_radio/zephyr/zephyr.elf for board: nrf5340dk
    [20/20] Generating ../merged_CPUNET.hex
    

    With sysbuild which is now default the -DSHIELD=nrf21540ek_fwd  alone causes the SHIELD variable to be defined to the value nrf21540ek_fwd within all images in the build for all cores. So when you build with

    west build -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf21540ek_fwd

    the SHIELD=nrf21540ek_fwd is defined in peripheral_uart application that is build for nrf5340dk/nrf5340/cpuapp

    and within ipc_radio image which is built automatically for nrf5340dk/nrf5340/cpunet.

    The proper approach is to provide nrf21540k_fwd only to the image for cpuapp and the nrf21540ek to the cpunet image.

    For each application you must know the image names produced for cpuapp and cpunet and provide appropriate namespace prefixing when running west build. In general it should be

    west build -p -b nrf5340dk/nrf5340/cpuapp -- -D<image_name_for_cpuapp>_SHIELD=nrf21540ek_fwd -D<image_name_for_cpunet>_SHIELD=nrf21540ek



  • yes, I could build, but cpunet fem configration is not available. how about your build result?

Related