New target board w/ nRF Connect

I've got a new target board based on the nRF52810_xxAA_REV2. I can see it as a connected device in nRF Connect.

I built a new application called CM_Serial using the Nordic UART Bridge Service (NUS) sample as a template.

Then I built a new board called ChargeMate1 using the "Create new board" wizard and selecting the nRF52810 SoC.

My first build had a few configuration errors related to the UART Console and I fixed those using the Guiconfig (nice tool, by the way).

Now I'm getting the following error in the build log:

Executing task: nRF Connect: Build: CM_serial/build (active) 

Building CM_serial
west build --build-dir c:\Nordic\VS_Code\CM_serial\build c:\Nordic\VS_Code\CM_serial

[1/72] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
[2/72] Linking C static library zephyr\drivers\flash\libdrivers__flash.a
[3/72] Linking C static library modules\nrf\lib\fatal_error\lib..__nrf__lib__fatal_error.a
[4/72] Linking C static library modules\nrf\lib\dk_buttons_and_leds\lib..__nrf__lib__dk_buttons_and_leds.a
[5/72] Linking C static library modules\nrf\subsys\bluetooth\controller\lib..__nrf__subsys__bluetooth__controller.a
[6/72] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/mdk/system_nrf52810.c.obj
[7/72] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
[8/72] Building C object modules/nrf/drivers/mpsl/clock_control/CMakeFiles/..__nrf__drivers__mpsl__clock_control.dir/nrfx_clock_mpsl.c.obj
[9/72] Building C object modules/nrf/subsys/mpsl/init/CMakeFiles/..__nrf__subsys__mpsl__init.dir/mpsl_init.c.obj
[10/72] Building C object modules/nrf/subsys/mpsl/fem/CMakeFiles/..__nrf__subsys__mpsl__fem.dir/api_init/mpsl_fem_api_init.c.obj
[11/72] Building C object modules/nrf/drivers/mpsl/flash_sync/CMakeFiles/..__nrf__drivers__mpsl__flash_sync.dir/flash_sync_mpsl.c.obj
[12/72] Linking C static library zephyr\lib\libc\minimal\liblib__libc__minimal.a
[13/72] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/drivers/src/nrfx_nvmc.c.obj
[14/72] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/helpers/nrfx_flag32_allocator.c.obj
[15/72] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/drivers/src/nrfx_ppi.c.obj
[16/72] Building C object modules/segger/CMakeFiles/modules__segger.dir/SEGGER_RTT_zephyr.c.obj
[17/72] Linking C static library modules\nrf\subsys\mpsl\init\lib..__nrf__subsys__mpsl__init.a
[18/72] Linking C static library modules\nrf\drivers\mpsl\clock_control\lib..__nrf__drivers__mpsl__clock_control.a
[19/72] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj 
C:\ncs\toolchains\v2.2.0-rc1\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52810_XXAA -DUSE_PARTITION_MANAGER=0 -D__PROGRAM_START -D__ZEPHYR__=1 -I../. -IC:/ncs/v2.2.0-rc1/nrf/drivers/mpsl/clock_control -IC:/ncs/v2.2.0-rc1/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.2.0-rc1/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.2.0-rc1/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.2.0-rc1/zephyr/subsys/bluetooth -IC:/ncs/v2.2.0-rc1/zephyr/subsys/settings/include -IC:/ncs/v2.2.0-rc1/nrf/include -IC:/ncs/v2.2.0-rc1/nrf/lib/multithreading_lock/. -IC:/ncs/v2.2.0-rc1/nrf/subsys/bluetooth/controller/. -IC:/ncs/v2.2.0-rc1/zephyr/drivers/flash -IC:/ncs/v2.2.0-rc1/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx -IC:/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.2.0-rc1/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.2.0-rc1/modules/debug/segger/SEGGER -IC:/ncs/v2.2.0-rc1/modules/debug/segger/Config -IC:/ncs/v2.2.0-rc1/zephyr/modules/segger/. -IC:/ncs/v2.2.0-rc1/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.2.0-rc1/nrfxlib/mpsl/include -IC:/ncs/v2.2.0-rc1/nrfxlib/mpsl/include/protocol -IC:/ncs/v2.2.0-rc1/nrfxlib/softdevice_controller/include -isystem C:/ncs/v2.2.0-rc1/zephyr/lib/libc/minimal/include -isystem c:/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include -isystem c:/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include-fixed -fno-strict-aliasing -Os -imacros C:/Nordic/VS_Code/CM_serial/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.2.0-rc1/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Nordic/VS_Code/CM_serial=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.2.0-rc1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.2.0-rc1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
In file included from C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\toolchain\gcc.h:88,
                 from C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\toolchain.h:50,
                 from C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\devicetree\zephyr.h:15,
                 from C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\devicetree.h:3931,
                 from C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\device.h:12,
                 from c:\Nordic\VS_Code\CM_serial\src\uart_async_adapter.h:22,
                 from c:\Nordic\VS_Code\CM_serial\src\main.c:10:
C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\device.h:83:41: error: '__device_dts_ord_43' undeclared here (not in a function); did you mean '__device_dts_ord_3'?
   83 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                         ^~~~~~~~~
C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\toolchain\common.h:132:26: note: in definition of macro '_DO_CONCAT'
  132 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\device.h:83:33: note: in expansion of macro '_CONCAT'
   83 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                 ^~~~~~~
C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\device.h:209:37: note: in expansion of macro 'DEVICE_NAME_GET'
  209 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
      |                                     ^~~~~~~~~~~~~~~
C:\ncs\v2.2.0-rc1\zephyr\include\zephyr\device.h:226:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
  226 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
c:\Nordic\VS_Code\CM_serial\src\main.c:62:36: note: in expansion of macro 'DEVICE_DT_GET'
   62 | static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(nordic_nus_uart));
      |                                    ^~~~~~~~~~~~~
../src/main.c: In function 'uart_test_async_api':
c:\Nordic\VS_Code\CM_serial\src\main.c:230:20: error: 'const struct uart_driver_api' has no member named 'callback_set'
  230 |         return (api->callback_set != NULL);
      |                    ^~
[20/72] Linking C static library modules\nrf\subsys\mpsl\fem\lib..__nrf__subsys__mpsl__fem.a
[21/72] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
[22/72] Building C object zephyr/subsys/net/CMakeFiles/subsys__net.dir/buf.c.obj
[23/72] Linking C static library modules\nrf\drivers\mpsl\flash_sync\lib..__nrf__drivers__mpsl__flash_sync.a
[24/72] Building C object modules/segger/CMakeFiles/modules__segger.dir/C_/ncs/v2.2.0-rc1/modules/debug/segger/SEGGER/SEGGER_RTT.c.obj
[25/72] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
[26/72] Building C object zephyr/kernel/CMakeFiles/kernel.dir/main_weak.c.obj
[27/72] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
[28/72] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/keys.c.obj
[29/72] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
[30/72] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/drivers/src/nrfx_uarte.c.obj
[31/72] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/l2cap.c.obj
[32/72] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
[33/72] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
[34/72] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
[35/72] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/att.c.obj
[36/72] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/smp.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.2.0-rc1\opt\bin\cmake.EXE' --build 'c:\Nordic\VS_Code\CM_serial\build'

What should be my next step to fix this?

Parents
  • Hello,

    Could you please look at the sample ncs\nrf\samples\bluetooth\peripheral_uart, and look at the app.overlay file. Do you have that in your application folder?

    If you do, I am not sure exactly what is missing, but it is something with your nus uart that isn't configured correctly. Perhaps you are missing the uart0 in your board files. If you are stuck, can you please try to upload the project that you are working on (or at least one that will replicate the issue), and your board file, and I can have a look.

    Best regards,

    Edvin

  • It turns out that the failure in main.c for api->callback_set was due to the following flag being undefined: CONFIG_UART_ASYNC_API.

    I can get that flag to be defined by setting the "Asynchronous UART API" in kconfig. Again, I think this is a bug in the template, since it should have been copied over.
    The next error I see is this:
    c:\ncs\v2.2.0-rc1\zephyr\soc\arm\nordic_nrf\common\soc_nrf_common.h:218:9: error: static assertion failed: "/soc/uart@40002000 defined without required pin configuration"
      218 |         BUILD_ASSERT((IS_ENABLED(CONFIG_PINCTRL) && 
    Which looks like a problem with pin assignments. But this should have been taken care of by the SoC dts file, since the UART pins are in a fixed location.
    It looks like the "nRF pin controller driver" is associated with the CONFIG_PINCTRL flag so I enabled that in Kconfig under the nRF UART nrfx drivers section. That didn't change the error.
    While looking at the UART0 stuff, I see that there are many other flags that I think should have been copied over from the template - parity, ram buffer size, etc. This looks like another bug in the template copy process.
Reply
  • It turns out that the failure in main.c for api->callback_set was due to the following flag being undefined: CONFIG_UART_ASYNC_API.

    I can get that flag to be defined by setting the "Asynchronous UART API" in kconfig. Again, I think this is a bug in the template, since it should have been copied over.
    The next error I see is this:
    c:\ncs\v2.2.0-rc1\zephyr\soc\arm\nordic_nrf\common\soc_nrf_common.h:218:9: error: static assertion failed: "/soc/uart@40002000 defined without required pin configuration"
      218 |         BUILD_ASSERT((IS_ENABLED(CONFIG_PINCTRL) && 
    Which looks like a problem with pin assignments. But this should have been taken care of by the SoC dts file, since the UART pins are in a fixed location.
    It looks like the "nRF pin controller driver" is associated with the CONFIG_PINCTRL flag so I enabled that in Kconfig under the nRF UART nrfx drivers section. That didn't change the error.
    While looking at the UART0 stuff, I see that there are many other flags that I think should have been copied over from the template - parity, ram buffer size, etc. This looks like another bug in the template copy process.
Children
Related