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 Reply Children
    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!

Related