Thingy91X unable to build examples with Zephyr

Description

I’m trying to set up a Thingy91x to send location updates every x seconds to the LightDB Stream in Golioth. I followed golioth-firmware-sdk/examples/zephyr at main · golioth/golioth-firmware-sdk · GitHub to initialize a repo, and I do have the Zephyr SDK loaded. I currently have the firmware build from GitHub - golioth/thingy91-golioth on the device, which is working fine. But when I try to build the location example it seems to fail and I’m not quite sure why.

The command I’m running is west build -p -b nrf9151dk/nrf9151/ns examples/zephyr/location in the golioth-sdk/modules/lib/golioth-firmware-sdk directory. The build is failing due to Kconfig warnings, which are all seemingly related to the socs (I include those in the logs below).

Basically I’m trying to spin up what feels like a really simple use case, but this being my first foray into these boards + build system I’m feeling a little stuck.

Expected Behavior

Send logs including the current location every 15 seconds to my dashboard

Actual Behavior

Build errors

Environment

Building on Mac OSX (Sequoia)

Loading Zephyr default modules (Zephyr base).
– Application: /Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location
– CMake version: 4.0.2
– Found Python3: /Users/foyc/Workspace/zephyrproject/.venv/bin/python3 (found suitable version “3.12.4”, minimum required is “3.10”) found components: Interpreter
– Cache files will be written to: /Users/foyc/Library/Caches/zephyr
– Zephyr version: 4.1.0 (/Users/foyc/Workspace/golioth-sdk/zephyr)
– Found west (found suitable version “1.4.0”, minimum required is “0.14.0”)
– Board: nrf9151dk, qualifiers: nrf9151/ns
– ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
– Found host-tools: zephyr 0.17.1 (/Users/foyc/zephyr-sdk-0.17.1)
– Found toolchain: zephyr 0.17.1 (/Users/foyc/zephyr-sdk-0.17.1)
– Found Dtc: /opt/homebrew/bin/dtc (found suitable version “1.7.2”, minimum required is “1.4.6”)
– Found BOARD.dts: /Users/foyc/Workspace/golioth-sdk/zephyr/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns.dts
– Generated zephyr.dts: /Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/build/zephyr/zephyr.dts
– Generated pickled edt: /Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/build/zephyr/edt.pickle
– Generated devicetree_generated.h: /Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/build/zephyr/include/generated/zephyr/devicetree_generated.h
– Including generated dts.cmake file: /Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/build/zephyr/dts.cmake

Logs and Console Output

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:16: warning: attempt to assign the value ‘y’ to the undefined symbol NRF_MODEM_LIB

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:19: warning: attempt to assign the value ‘y’ to the undefined symbol NRF_MODEM_LIB_NET_IF

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:20: warning: attempt to assign the value ‘y’ to the undefined symbol NRF_MODEM_LIB_NET_IF_AUTO_START

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:21: warning: attempt to assign the value ‘y’ to the undefined symbol NRF_MODEM_LIB_NET_IF_AUTO_CONNECT

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:35: warning: attempt to assign the value ‘n’ to the undefined symbol NORDIC_SECURITY_BACKEND

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:36: warning: attempt to assign the value ‘y’ to the undefined symbol MBEDTLS_LEGACY_CRYPTO_C

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:46: warning: attempt to assign the value ‘y’ to the undefined symbol NETWORK_INFO

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:47: warning: attempt to assign the value ‘y’ to the undefined symbol MODEM_INFO

/Users/foyc/Workspace/golioth-sdk/modules/lib/golioth-firmware-sdk/examples/zephyr/location/socs/nrf9151_ns.conf:49: warning: attempt to assign the value ‘y’ to the undefined symbol LTE_LC_NEIGHBOR_CELL_MEAS_MODULE

Attempts to Resolve

I’ve tried clearing the Zephyr cache, ensuring I’m doing a pristine build, and even copying over the SOCs from thingy91-golioth/socs/nrf9151_ns.conf at main · golioth/thingy91-golioth · GitHub

1 Like

@cory_foy welcome to the forum and thanks for posting! Regarding your build issues, did you initialize with mainline Zephyr or with NCS? You can see where the thingy91-golioth repository references the latter in its west.yml here.

To use the Golioth Location service, you’ll need to be enrolled in the private access program. If you submit a request here we can make sure you are enrolled promptly.

Please feel free to reach out with any follow up questions!

Ah, so I guess I was misunderstanding that example. What I was trying to do was simply get the lat/long from the GNSS chip which is what it seemed like the output of that was. So it’s actually an API call? Is there a way to get the Lat/Lon from GNSS?

@cory_foy yes, you may use the nrf_modem_gnss library to obtain location information, then stream it to Golioth as you would any other data.

After chatting with the team I tried going through Set up Nordic nRF Connect SDK (NCS) | Golioth. Unfortunately when I get to the final step it’s failing to build:

(.venv) (base) zephyr HEAD % west build -p auto -b  nrf9160dk/nrf9160/ns samples/basic/minimal
[0/5] Performing build step for 'minimal'
[0/88] Performing build step for 'tfm'
ninja: no work to do.
[2/88] Performing install step for 'tfm'
-- Install configuration: "MinSizeRel"
----- Installing platform NS -----
[12/88] Building C object zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/locks.c.obj
FAILED: zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/locks.c.obj 
ccache /Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=512 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build/minimal/zephyr/include/generated/zephyr -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build/minimal/zephyr/include/generated -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/soc/nordic -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/soc/nordic/nrf91/. -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/soc/nordic/common/. -I/Users/foyc/Workspace/golioth-ncs-workspace/nrf/include -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build/minimal/tfm/api_ns/interface/include -I/Users/foyc/Workspace/golioth-ncs-workspace/nrf/modules/trusted-firmware-m/. -I/Users/foyc/Workspace/golioth-ncs-workspace/nrf/include/tfm -I/Users/foyc/Workspace/golioth-ncs-workspace/nrf/tests/include -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/hal/cmsis/CMSIS/Core/Include -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/modules/cmsis/. -I/Users/foyc/Workspace/golioth-ncs-workspace/nrf/modules/hal_nordic/. -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/hal/nordic/nrfx -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/hal/nordic/nrfx/drivers/include -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/hal/nordic/nrfx/mdk -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/modules/hal_nordic/nrfx/. -I/Users/foyc/Workspace/golioth-ncs-workspace/nrfxlib/nrf_modem/include -I/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build/minimal/generated/interface_nrf_security_psa -I/Users/foyc/Workspace/golioth-ncs-workspace/nrf/subsys/nrf_security/include -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/crypto/oberon-psa-crypto/include -I/Users/foyc/Workspace/golioth-ncs-workspace/nrf/subsys/nrf_security/src/utils -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/crypto/oberon-psa-crypto/library -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/crypto/mbedtls/library -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/crypto/mbedtls/include -I/Users/foyc/Workspace/golioth-ncs-workspace/modules/crypto/mbedtls/include/library -I/Users/foyc/Workspace/golioth-ncs-workspace/nrfxlib/crypto/nrf_oberon/include -I/Users/foyc/Workspace/golioth-ncs-workspace/nrfxlib/crypto/nrf_oberon/include/mbedtls -isystem /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/common/include -Wshadow -fno-strict-aliasing -Os -imacros /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build/minimal/zephyr/include/generated/zephyr/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/arm-zephyr-eabi -imacros /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -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=/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/samples/basic/minimal=CMAKE_SOURCE_DIR -fmacro-prefix-map=/Users/foyc/Workspace/golioth-ncs-workspace/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/Users/foyc/Workspace/golioth-ncs-workspace=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -fno-lto -MD -MT zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/locks.c.obj -MF zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/locks.c.obj.d -o zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/locks.c.obj -c /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c
In file included from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/device.h:17,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/sw_isr_table.h:18,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/arch/arm/irq.h:19,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/arch/arm/arch.h:24,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/arch/cpu.h:19,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/kernel_includes.h:36,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/kernel.h:17,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/posix/posix_types.h:30,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/posix/sys/stat.h:40,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/picolibc-hooks.h:13,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:7:
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:11:16: error: conflicting types for '__lock___libc_recursive_mutex'; have 'struct k_mutex'
   11 | K_MUTEX_DEFINE(__lock___libc_recursive_mutex);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/sys/iterable_sections.h:43:28: note: in definition of macro 'TYPE_SECTION_ITERABL'
   43 |         Z_DECL_ALIGN(type) varname \
      |                            ^~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/sys/iterable_sections.h:217:9: note: in expansion of macro 'STRUCT_SECTION_ITERABLE_ALTERNATE'
  217 |         STRUCT_SECTION_ITERABLE_ALTERNATE(struct_type, struct_type, varname)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/include/zephyr/kernel.h:3068:9: note: in expansion of macro 'STRUCT_SECTION_ITERABLE'
 3068 |         STRUCT_SECTION_ITERABLE(k_mutex, name) = \
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:11:1: note: in expansion of macro 'K_MUTEX_DEFINE'
   11 | K_MUTEX_DEFINE(__lock___libc_recursive_mutex);
      | ^~~~~~~~~~~~~~
In file included from /Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/stdio.h:48,
                 from /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/picolibc-hooks.h:11:
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:58:1: note: previous declaration of '__lock___libc_recursive_mutex' with type 'struct __lock'
   58 | __LOCK_INIT_RECURSIVE(__libc_recursive_mutex)
      | ^~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:29:6: error: conflicting types for '__retarget_lock_init_recursive'; have 'void(void **)'
   29 | void __retarget_lock_init_recursive(_LOCK_T *lock)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:35:6: note: previous declaration of '__retarget_lock_init_recursive' with type 'void(struct __lock **)'
   35 | void __retarget_lock_init_recursive(_LOCK_T *lock);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:45:6: error: conflicting types for '__retarget_lock_init'; have 'void(void **)'
   45 | void __retarget_lock_init(_LOCK_T *lock)
      |      ^~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:34:6: note: previous declaration of '__retarget_lock_init' with type 'void(struct __lock **)'
   34 | void __retarget_lock_init(_LOCK_T *lock);
      |      ^~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:51:6: error: conflicting types for '__retarget_lock_close_recursive'; have 'void(void *)'
   51 | void __retarget_lock_close_recursive(_LOCK_T lock)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:37:6: note: previous declaration of '__retarget_lock_close_recursive' with type 'void(struct __lock *)'
   37 | void __retarget_lock_close_recursive(_LOCK_T lock);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:62:6: error: conflicting types for '__retarget_lock_close'; have 'void(void *)'
   62 | void __retarget_lock_close(_LOCK_T lock)
      |      ^~~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:36:6: note: previous declaration of '__retarget_lock_close' with type 'void(struct __lock *)'
   36 | void __retarget_lock_close(_LOCK_T lock);
      |      ^~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:68:6: error: conflicting types for '__retarget_lock_acquire_recursive'; have 'void(void *)'
   68 | void __retarget_lock_acquire_recursive(_LOCK_T lock)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:39:6: note: previous declaration of '__retarget_lock_acquire_recursive' with type 'void(struct __lock *)'
   39 | void __retarget_lock_acquire_recursive(_LOCK_T lock);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:75:6: error: conflicting types for '__retarget_lock_acquire'; have 'void(void *)'
   75 | void __retarget_lock_acquire(_LOCK_T lock)
      |      ^~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:38:6: note: previous declaration of '__retarget_lock_acquire' with type 'void(struct __lock *)'
   38 | void __retarget_lock_acquire(_LOCK_T lock);
      |      ^~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:94:6: error: conflicting types for '__retarget_lock_release_recursive'; have 'void(void *)'
   94 | void __retarget_lock_release_recursive(_LOCK_T lock)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:41:6: note: previous declaration of '__retarget_lock_release_recursive' with type 'void(struct __lock *)'
   41 | void __retarget_lock_release_recursive(_LOCK_T lock);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/Workspace/golioth-ncs-workspace/zephyr/lib/libc/picolibc/locks.c:101:6: error: conflicting types for '__retarget_lock_release'; have 'void(void *)'
  101 | void __retarget_lock_release(_LOCK_T lock)
      |      ^~~~~~~~~~~~~~~~~~~~~~~
/Users/foyc/zephyr-sdk-0.17.1/arm-zephyr-eabi/picolibc/include/sys/lock.h:40:6: note: previous declaration of '__retarget_lock_release' with type 'void(struct __lock *)'
   40 | void __retarget_lock_release(_LOCK_T lock);
      |      ^~~~~~~~~~~~~~~~~~~~~~~
[25/88] Building C object modules/hal_nordic/modules/hal_nordic/nrfx/CMa...ioth-ncs-workspace/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
ninja: build stopped: subcommand failed.
FAILED: _sysbuild/sysbuild/images/minimal-prefix/src/minimal-stamp/minimal-build /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build/_sysbuild/sysbuild/images/minimal-prefix/src/minimal-stamp/minimal-build 
cd /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build/minimal && /opt/homebrew/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/homebrew/bin/cmake --build /Users/foyc/Workspace/golioth-ncs-workspace/zephyr/build

I’m not quite sure what’s causing that - I did set up a clean virtual environment before running to make sure there were no other conflicts.

@cory_foy it appears as though you are using Zephyr SDK 0.17.1, which was released last week and includes a new version of picolibc. Updates to picolibc have to be propagated to Zephyr, which was done last week as well (modules: Update picolibc to 1.8.10 by keith-packard · Pull Request #87784 · zephyrproject-rtos/zephyr · GitHub), but is not included in the release of Zephyr that you are using (via the fork bundled with NCS 3.0.1). If you install Zephyr SDK 0.17.0 using the instructions in the Golioth docs I suspect that this build issue will be resolved.

Ah! I definitely missed that it was a point release off. Pulling down 17.0 now. Thanks for the pointer!

1 Like

Perfect, it works! As a side note - if you’ve tried to build with a different version of the Zephyr SDK, it’s not enough to do a pristine build with the -p option - you have to delete the build directory.

Thank you all so much for helping get this built to this stage.

1 Like