Could not be able to configure Thingy53 server as MTD

Hi,

i'm trying to creating a project where my thingy53 is a coap_server thread node that sends environmental data to a coap_client (nRF5340).

The problem is that i'm trying to configure the thingy53 as a minimal thread device, so i added to Cmakelist.txt this line:

cmake_minimum_required(VERSION 3.20.0)
set(CONF_FILE "overlay-mtd.conf")
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(NONE)
where overlay-mtd.conf is a conf file taken by the coap_client sample, but i don't know if this is the correct way to do this.
when i build nothing change...
so i tried to modify the build configuration over the GUI, but something went wrong:
[846/858] Linking CXX executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
cmd.exe /C "cd . && C:\ncs\toolchains\v2.1.2\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\build\zephyr && C:\ncs\toolchains\v2.1.2\opt\bin\cmake.exe -E echo ""
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(main.c.obj): in function `temperature_request_handler':
C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:185: undefined reference to `otCoapMessageGetType'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:185: undefined reference to `otCoapMessageGetCode'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(main.c.obj): in function `temperature_response_send':
C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:215: undefined reference to `otCoapNewMessage'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:221: undefined reference to `otCoapMessageInit'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:227: undefined reference to `otCoapMessageInitResponse'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:232: undefined reference to `otCoapMessageGetToken'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:232: undefined reference to `otCoapMessageGetTokenLength'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:232: undefined reference to `otCoapMessageSetToken'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:238: undefined reference to `otCoapMessageSetPayloadMarker'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(main.c.obj): in function `otCoapSendResponse':
C:\ncs\v2.1.2\modules\lib\openthread\include\openthread\coap.h:1135: undefined reference to `otCoapSendResponseWithParameters'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(main.c.obj): in function `coap_init':
C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:277: undefined reference to `otCoapStart'
c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:282: undefined reference to `otCoapAddResource'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.1.2\opt\bin\cmake.EXE' --build 'c:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\build'

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
it doesn't recognize the coap functions anymore...
 
If i reset te build configuration through GUI and start the build again, this is the result:
Executing task: nRF Connect: Build: thingy_coap_rec_myserver/build (active)

Building thingy_coap_rec_myserver
west build --build-dir c:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\build c:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver

[0/1] Re-running CMake...
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver
-- Cache files will be written to: C:/ncs/v2.1.2/zephyr/.cache
-- Zephyr version: 3.1.99 (C:/ncs/v2.1.2/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: thingy53_nrf5340_cpuapp
-- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.1.2/opt/zephyr-sdk)
-- Found dtc: C:/ncs/toolchains/v2.1.2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.1.2/opt/zephyr-sdk)
-- Found BOARD.dts: C:/ncs/v2.1.2/zephyr/boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpuapp.dts
-- Found devicetree overlay: c:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/app.overlay
-- Generated zephyr.dts: C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build/zephyr/dts.cmake
Parsing C:/ncs/v2.1.2/zephyr/Kconfig
Loaded configuration 'C:/ncs/v2.1.2/zephyr/boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpuapp_defconfig'
Merged configuration 'C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/overlay-mtd.conf'
Configuration saved to 'C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build/zephyr/.config'
Kconfig header saved to 'C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build/zephyr/include/generated/autoconf.h'

warning: OPENTHREAD_MTD_SED (defined at C:/ncs/v2.1.2/zephyr/modules/openthread\Kconfig.thread:53,
modules\openthread\Kconfig.thread:53) was assigned the value 'y' but got the value 'n'. Check these
unsatisfied dependencies: ((OPENTHREAD_MTD && OPENTHREAD) || (OPENTHREAD_MTD && OPENTHREAD && 0))
(=n). See docs.zephyrproject.org/.../kconfig.html and/or look up
OPENTHREAD_MTD_SED 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: OPENTHREAD_POLL_PERIOD (defined at
C:/ncs/v2.1.2/zephyr/modules/openthread\Kconfig.thread:57, modules\openthread\Kconfig.thread:57) was
assigned the value '30000' but got the value ''. Check these unsatisfied dependencies:
((OPENTHREAD_MTD_SED && OPENTHREAD) || (OPENTHREAD_MTD_SED && OPENTHREAD && 0)) (=n). See
docs.zephyrproject.org/.../kconfig.html and/or look up
OPENTHREAD_POLL_PERIOD 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: The choice symbol OPENTHREAD_MTD (defined at
C:/ncs/v2.1.2/zephyr/modules/openthread\Kconfig.thread:49, modules\openthread\Kconfig.thread:49) was
selected (set =y), but no symbol ended up as the choice selection. See
docs.zephyrproject.org/.../kconfig.html and/or look up
OPENTHREAD_MTD 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.

-- Configuring done
-- Generating done
-- Build files have been written to: C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build
[1/183] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[2/183] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[3/183] Generating include/generated/offsets.h
[4/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[5/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
[6/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
[7/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
[8/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[9/183] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj
C:\ncs\toolchains\v2.1.2\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.1.2/zephyr/include/zephyr -IC:/ncs/v2.1.2/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.1.2/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/ncs/v2.1.2/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.1.2/nrf/include -IC:/ncs/v2.1.2/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.1.2/modules/hal/nordic/nrfx -IC:/ncs/v2.1.2/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.1.2/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.1.2/zephyr/modules/hal_nordic/nrfx/. -isystem C:/ncs/v2.1.2/zephyr/lib/libc/minimal/include -isystem c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include -isystem c:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include-fixed -isystem C:/ncs/v2.1.2/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.1.2/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-asynchronous-unwind-tables -fno-pie -fno-pic -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/progetti/nexter/VS/esempi/server-send__client-receive/thingy_coap_rec_myserver=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.1.2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.1.2=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:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\src\main.c:16:
C:\ncs\v2.1.2\zephyr\include\zephyr\net\openthread.h:25:10: fatal error: openthread/instance.h: No such file or directory
25 | #include <openthread/instance.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[10/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
[11/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
[12/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[13/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
[14/183] Building C object CMakeFiles/app.dir/src/sensor.c.obj
[15/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[16/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[17/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
[18/183] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.1.2\opt\bin\cmake.EXE' --build 'c:\progetti\nexter\VS\esempi\server-send__client-receive\thingy_coap_rec_myserver\build'

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
How could i fix these problems? is the correct way to enamble the MTD mode in my thingy?
this is the project
thanks a lot
simon
Parents Reply
  • Hi Simon,

    NCSv2.1.0 openthread coap server sample building with the following configuration. You can compare the original sample with your codes to find the cause.

    For NCSv2.3.0, the Thingy53 board device reserved limited Flash and RAM for the application CPU, so it will report overflow errors during building time, you may encounter more issues further since this is no supported board for this sample, I suggest you switch to officially supported nRF5340DK or other boards required in the sample document and use them as your HW reference design and software prototyping.

    Best regards,

    Charlie

Children
Related