nrf5340DK Custom board fails creation via VSCode extension

Hi,

I am starting from the following example: "Bluetooth Low Energy UART service sample", sdk version v2.6.0
I am trying to add a custom board (using VSCode NRF CONNECT extension). The creation works, I get the files in (project-path)/boards/arm/my-custom-board but this configuration is unable to build and I get the following error that I'm unable to understand and fix.

warning: UART_CONSOLE (defined at drivers/console/Kconfig:43) was assigned the value 'y' but got the
value 'n'. Check these unsatisfied dependencies: SERIAL_HAS_DRIVER (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UART_CONSOLE and/or look up UART_CONSOLE in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


warning: UART_ASYNC_API (defined at drivers/serial/Kconfig:66) was assigned the value 'y' but got
the value 'n'. Check these unsatisfied dependencies: SERIAL_SUPPORT_ASYNC (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UART_ASYNC_API and/or look up
UART_ASYNC_API in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


/Users/work/5340-can-ble/can-ble/boards/arm/can_ble_board/can_ble_board_cpuapp_ns_defconfig:12: warning: ignoring malformed line 'UART_CONSOLE=y'

/Users/work/5340-can-ble/can-ble/boards/arm/can_ble_board/can_ble_board_cpuapp_ns_defconfig:13: warning: ignoring malformed line 'UART_ASYNC_API=y'

error: Aborting due to Kconfig warnings
.............<some output that's irrelevant>............
CMake Error at /opt/nordic/ncs/v2.6.0/nrf/cmake/multi_image.cmake:208 (message):
  No board specified for domain 'CPUNET'.  This configuration is typically
  defined in
  /Users/work/5340-can-ble/can-ble/boards/arm/can_ble_board/Kconfig
Call Stack (most recent call first):
  /opt/nordic/ncs/v2.6.0/nrf/cmake/multi_image.cmake:178 (add_child_image_from_source)
  /opt/nordic/ncs/v2.6.0/nrf/samples/CMakeLists.txt:148 (add_child_image)


-- Configuring incomplete, errors occurred!

Parents
  • As a general ideea as to where I am trying to get.

    I have a 5340DK that right now runs an app I wrote and interacts with some peripherals via iic and spi. The data is processed and sent via UART to a PC.
    I want to send that data from the 5340DK to a mobile phone via BLE therefore I am looking at the BLE UART service sample as a reference to get me started. Therefore, I thought that having a custom board config in the BLE UART service example would be a good first step to figure out what prj.conf/Kconfig/etc. modifications I need to make in my app to enable BLE.

    If I go the other way around and I try to set the BLE specific configs to my non-BLE iic/spi peripherals only project

    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    
    # Enable the NUS service
    CONFIG_BT_NUS=y
    
    # Enable bonding
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
     by adding these configurations to my
    - prj.conf
    - custom_board_nrf5340_cpuapp_defconfig
    - custom_board_nrf5340_cpuapp_ns_defconfig
    - custom_board_nrf5340_cpunet_defconfig

    It appears to me that still there are not enough to inficate my config since I get other errors (no code changes, just configs)
    FAILED: zephyr/CMakeFiles/zephyr.dir/opt/nordic/ncs/v2.6.0/nrf/subsys/bluetooth/services/nus.c.obj 
    ccache /opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF5340_XXAA_NETWORK -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/opt/nordic/ncs/v2.6.0/zephyr/kernel/include -I/opt/nordic/ncs/v2.6.0/zephyr/arch/arm/include -I/opt/nordic/ncs/v2.6.0/nrf/drivers/mpsl/clock_control -I/opt/nordic/ncs/v2.6.0/zephyr/include -I/Users/work/5340-iic-scanner/s/build/hci_ipc/zephyr/include/generated -I/opt/nordic/ncs/v2.6.0/zephyr/soc/arm/nordic_nrf/nrf53 -I/opt/nordic/ncs/v2.6.0/zephyr/soc/common/nordic_nrf/. -I/opt/nordic/ncs/v2.6.0/zephyr/soc/arm/nordic_nrf/common/. -I/opt/nordic/ncs/v2.6.0/zephyr/subsys/bluetooth -I/opt/nordic/ncs/v2.6.0/zephyr/subsys/settings/include -I/opt/nordic/ncs/v2.6.0/nrf/include -I/opt/nordic/ncs/v2.6.0/nrf/lib/multithreading_lock/. -I/opt/nordic/ncs/v2.6.0/nrf/subsys/bluetooth/controller/. -I/opt/nordic/ncs/v2.6.0/zephyr/drivers/flash -I/opt/nordic/ncs/v2.6.0/nrf/tests/include -I/opt/nordic/ncs/v2.6.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v2.6.0/zephyr/modules/cmsis/. -I/opt/nordic/ncs/v2.6.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v2.6.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v2.6.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v2.6.0/zephyr/modules/hal_nordic/nrfx/. -I/Users/work/5340-iic-scanner/s/build/hci_ipc/modules/libmetal/libmetal/lib/include -I/opt/nordic/ncs/v2.6.0/modules/lib/open-amp/open-amp/lib/include -I/opt/nordic/ncs/v2.6.0/modules/crypto/tinycrypt/lib/include -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/fem/common/include -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/fem/nrf21540_gpio/include -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/fem/nrf21540_gpio_spi/include -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/fem/simple_gpio/include -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/fem/include -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/fem/include/protocol -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/include -I/opt/nordic/ncs/v2.6.0/nrfxlib/mpsl/include/protocol -I/opt/nordic/ncs/v2.6.0/nrfxlib/softdevice_controller/include -isystem /opt/nordic/ncs/v2.6.0/zephyr/lib/libc/common/include -fno-strict-aliasing -Os -imacros /Users/work/5340-iic-scanner/s/build/hci_ipc/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33+nodsp -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v2.6.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/opt/nordic/ncs/v2.6.0/zephyr/samples/bluetooth/hci_ipc=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v2.6.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v2.6.0=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT zephyr/CMakeFiles/zephyr.dir/opt/nordic/ncs/v2.6.0/nrf/subsys/bluetooth/services/nus.c.obj -MF zephyr/CMakeFiles/zephyr.dir/opt/nordic/ncs/v2.6.0/nrf/subsys/bluetooth/services/nus.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/opt/nordic/ncs/v2.6.0/nrf/subsys/bluetooth/services/nus.c.obj -c /opt/nordic/ncs/v2.6.0/nrf/subsys/bluetooth/services/nus.c
    In file included from /opt/nordic/ncs/v2.6.0/nrf/subsys/bluetooth/services/nus.c:9:
    /opt/nordic/ncs/v2.6.0/zephyr/include/zephyr/bluetooth/gatt.h:780:34: error: 'CONFIG_BT_MAX_PAIRED' undeclared here (not in a function); did you mean 'CONFIG_BT_RX_PRIO'?
      780 |         #define BT_GATT_CCC_MAX (CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN)
          |                                  ^~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.6.0/zephyr/include/zephyr/bluetooth/gatt.h:798:36: note: in expansion of macro 'BT_GATT_CCC_MAX'
      798 |         struct bt_gatt_ccc_cfg cfg[BT_GATT_CCC_MAX];
          |                                    ^~~~~~~~~~~~~~~
    [97/230] Building C object zephyr/subsys/random/CMakeFiles/subsys__random.dir/rand32_entropy_device.c.obj
    [98/230] Building C object zephyr/subsys/bluetooth/common/CMakeFiles/subsys__bluetooth__common.dir/dummy.c.obj
    [99/230] Building C object CMakeFiles/app.dir/src/main.c.obj
    [100/230] Building C object zephyr/subsys/bluetooth/common/CMakeFiles/subsys__bluetooth__common.dir/bt_str.c.obj
    [101/230] Building C object zephyr/arch/arch/arm/core/mpu/CMakeFiles/arch__arm__core__mpu.dir/arm_mpu.c.obj
    [102/230] Building C object zephyr/subsys/bluetooth/common/CMakeFiles/subsys__bluetooth__common.dir/rpa.c.obj
    [103/230] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_common.c.obj
    [104/230] Building C object zephyr/subsys/net/CMakeFiles/subsys__net.dir/buf_simple.c.obj
    [105/230] Building C object zephyr/subsys/net/CMakeFiles/subsys__net.dir/buf.c.obj
    [106/230] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_raw.c.obj
    [107/230] Building C object zephyr/soc/soc/arm/nordic_nrf/CMakeFiles/soc__arm__nordic_nrf.dir/nrf53/soc.c.obj
    ninja: build stopped: subcommand failed.
    [14/354] Generating ../../tfm/CMakeCache.txt
    CMake Warning at cmake/version.cmake:22 (message):
      Actual TF-M version is not available from Git repository.  Settled to
      v2.0.0
    Call Stack (most recent call first):
      CMakeLists.txt:22 (include)
    
    
    -- Found Git: /opt/nordic/ncs/toolchains/580e4ef81c/bin/git (found version "2.37.3") 
    -- 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: /opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Found Python3: /opt/nordic/ncs/toolchains/580e4ef81c/opt/[email protected]/bin/python3.9 (found version "3.9.6") found components: Interpreter 
    CMake Deprecation Warning at /opt/nordic/ncs/v2.6.0/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
      'PYTHON_PREFER' variable is deprecated.  Please use Python3_EXECUTABLE
      instead.
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.6.0/zephyr/cmake/modules/python.cmake:16 (find_package)
      /opt/nordic/ncs/v2.6.0/zephyr/cmake/modules/user_cache.cmake:30 (include)
      /opt/nordic/ncs/v2.6.0/zephyr/cmake/modules/extensions.cmake:5 (include)
      /opt/nordic/ncs/v2.6.0/nrf/subsys/nrf_security/tfm/CMakeLists.txt:38 (include)
    
    
    -- Found Python3: /opt/nordic/ncs/toolchains/580e4ef81c/opt/[email protected]/bin/python3.9 (found suitable version "3.9.6", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /Users/Library/Caches/zephyr
    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        CRYPTO_RNG_MODULE_ENABLED
        MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE
        PYTHON_PREFER
    
    
    -- Build files have been written to: /Users/work/5340-iic-scanner/s/build/tfm
    [19/354] No configure step for 'tfm'
    FAILED: modules/nrf/samples/hci_ipc_subimage-prefix/src/hci_ipc_subimage-stamp/hci_ipc_subimage-build hci_ipc/zephyr/zephyr.hex hci_ipc/zephyr/zephyr.elf hci_ipc/zephyr/merged_CPUNET.hex /Users/work/5340-iic-scanner/s/build/modules/nrf/samples/hci_ipc_subimage-prefix/src/hci_ipc_subimage-stamp/hci_ipc_subimage-build /Users/work/5340-iic-scanner/s/build/hci_ipc/zephyr/zephyr.hex /Users/work/5340-iic-scanner/s/build/hci_ipc/zephyr/zephyr.elf /Users/work/5340-iic-scanner/s/build/hci_ipc/zephyr/merged_CPUNET.hex 
    cd /Users/work/5340-iic-scanner/s/build/hci_ipc && /opt/nordic/ncs/toolchains/580e4ef81c/Cellar/cmake/3.21.0/bin/cmake --build . --
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/580e4ef81c/bin/cmake --build /Users/work/5340-iic-scanner/s/build
    It is unclear to me where these configurations should be added and why adding them still does not make them visible.

     

  • Hi,

    If you are using a DK, I recommend using the DK's board files and creating overlays if you want to make any changes to the devicetree rather than creating a custom board. You can look at Set devicetree overlays for more information.

    Regarding the build log, you get an error that CONFIG_BT_MAX_PAIRED is undeclared:

    /opt/nordic/ncs/v2.6.0/zephyr/include/zephyr/bluetooth/gatt.h:780:34: error: 'CONFIG_BT_MAX_PAIRED' undeclared here (not in a function); did you mean 'CONFIG_BT_RX_PRIO'?
      780 |         #define BT_GATT_CCC_MAX (CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN)
          |      

    To fix this, you must set CONFIG_BT_MAX_PAIRED in prj.conf, for example, CONFIG_BT_MAX_PAIRED=1.

    Best regards,
    Marte

  • Hi,

    Does CAN work when you are not using Bluetooth in v2.9.0?

    Can you test the CAN counter sample?

    Best regards,
    Marte

  • It worked without Bluetooth in v2.9.0

    So, I figured out the problem.
    In the app.overlay file I had to define everything. Once more define uarts, iics, etc.
    Therefore maybe a more extensive guide on how to user overlays would be nice.
    For example, app.overlay seems to be related to the app core. How to I make a overlay for the network core?

  • Hi,

    Great to hear that you figured it out!

    To make an overlay for the network core, you need to create it in the subdirectory of the network core image. For example, for the peripheral_uart sample this would be inside peripheral_uart/sysbuild/ipc_radio. You can call it app.overlay, or you can name it after the board target, e.g., nrf5340dk_nrf5340_cpunet.overlay.

    You can find some information about how to use overlays on the following pages:

    The first link is to a lesson on the topic in our DevAcademy course nRF Connect SDK Fundamentals. The others are to our documentation.

    Best regards,
    Marte

  • So, if I understand correctly
    app.overlay + prj.conf in top project directory are for the app core
    app.overlay + prj.conf in the <project_directory>/sysbuild/ipc_radio are for the network core

    I have completed the tutorials on the dev academy and I have read the documentation provided, but it is generally pretty narrow compared to the multitude of possible scenarios when developing real "life size" projects since they combine multiple resources and types of configurations.

  • adsa said:
    So, if I understand correctly
    app.overlay + prj.conf in top project directory are for the app core
    app.overlay + prj.conf in the <project_directory>/sysbuild/ipc_radio are for the network core

    That is correct.

    The same goes for other images added to the project, such as MCUboot. In that case, app.overlay + prj.conf (or an overlay Kconfig file) in <project_directory>/sysbuild/mcuboot will be applied to the MCUboot image.

Reply
  • adsa said:
    So, if I understand correctly
    app.overlay + prj.conf in top project directory are for the app core
    app.overlay + prj.conf in the <project_directory>/sysbuild/ipc_radio are for the network core

    That is correct.

    The same goes for other images added to the project, such as MCUboot. In that case, app.overlay + prj.conf (or an overlay Kconfig file) in <project_directory>/sysbuild/mcuboot will be applied to the MCUboot image.

Children
No Data
Related