Nordic UART Service sample

When trying to build the sample project linked to in the blogpost regarding streaming of classification results using the Nordic UART service, I get the following error:

CMake Error at C:/ncs/zephyr/cmake/kconfig.cmake:264 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  C:/ncs/zephyr/cmake/app/boilerplate.cmake:555 (include)
  C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:6 (find_package)

Then I commented out “CONFIG_LOG_IMMEDIATE=y” on line 30 in “prj.conf”. This enabled the build to continue, but it was then stopped by the following error:

In file included from C:/ncs/zephyr/include/sys/cbprintf_internal.h:55,
                 from C:/ncs/zephyr/include/sys/cbprintf.h:38,
                 from C:/ncs/zephyr/include/logging/log_msg2.h:11,
                 from C:/ncs/zephyr/include/logging/log_msg.h:12,
                 from C:/ncs/zephyr/include/logging/log_core.h:9,
                 from C:/ncs/zephyr/include/logging/log.h:11,
                 from ../edge-impulse/ingestion-sdk-platform/NordicSemi-nrf52/ble_nus.h:21,
                 from ../edge-impulse/ingestion-sdk-platform/NordicSemi-nrf52/ble_nus.cpp:1:
C:/ncs/zephyr/include/sys/cbprintf_cxx.h: In instantiation of 'size_t z_cbprintf_cxx_arg_size(T) [with T = bt_conn*; size_t = unsigned int]':
../edge-impulse/ingestion-sdk-platform/NordicSemi-nrf52/ble_nus.cpp:428:9:   required from here
C:/ncs/zephyr/include/sys/cbprintf_cxx.h:79:20: error: invalid use of incomplete type 'struct bt_conn'
   79 |  return sizeof(arg + 0);
      |               ~~~~~^~~~

Anyone with an idea of what may be the problem here? Maybe you, @mathijs?

Hey Mathais,

Are you building in your local environment or with Docker? I ask as I just checked and was able to build within the Docker environment out of the box, as it has the nRF dependencies pre-configured. I suspect if you are building locally you are running into a missing dependency in the nRF SDK.

Just in case you are unfamiliar with and hadn’t tried the docker build instructions yet, it would be worthwhile to compare. You just install Docker Desktop the follow the readme instructions in the repo. If that builds, next take a look at the Dockerfile, and double check that the installation steps and paths/variables line up with what you did locally.

If you already are familiar and tried all this let me know and I can look further!


Hello, David!

Thank you so much for your swift response! Very much appreciated!

Guided by your answer it turned out that I was using a too recent version of nRF Connect SDK. The project wouldn’t build when being on the master branch, v1.6.1 or v1.6.0, but when using v1.5.1 it built just fine.

All the best,

@mathias interesting! Have pinged the embedded team to update this to nCS 1.6!

1 Like

As the sample now builds I tried updating it with my own model, by changing out the folders “edge-impulse-sdk”, “model-parameters” and “tflite-model” with the equally named folders from the C++ library downloaded from the studio’s deployment section.

However this produces some errors I find rather confusing, as the file they appear in is identical to the file in the sample, which builds.

The errors produced:

../edge-impulse/ingestion-sdk-c/ei_run_impulse.cpp: In function 'void run_nn_continuous(bool)':
../edge-impulse/ingestion-sdk-c/ei_run_impulse.cpp:331:33: error: a function-definition is not allowed here before '{' token
  331 | void run_nn_continuous_normal() {
      |                                 ^
../edge-impulse/ingestion-sdk-c/ei_run_impulse.cpp:339:26: error: a function-definition is not allowed here before '{' token
  339 | void run_nn_normal(void) {
      |                          ^
../edge-impulse/ingestion-sdk-c/ei_run_impulse.cpp:341:1: error: expected '}' at end of input
  341 | }
      | ^

Might be something obvious I’m missing here, but I can’t really see why this is happening. :sweat_smile:

Hmm… Now I see that this is a different repo maintained by IRNAS. That’s naturally unmaintainable (and their repo does not go through CI)… This functionality should be merged into our main repo.

edit: Quick fix: add an extra } on line 300 (right after the #endif and before the /*BLE PRINTF*/ to make this compile. I’ve filed a ticket for the embedded team to merge this.

The quick fix worked. Thank you so much, @janjongboom!

1 Like