Goal
Hi guys,
is there an option to enable MBEDTLS debugging as with the CONFIG_MBEDTLS_DEBUG_LEVEL=4 for the MBEDTLS_BUILTIN? I am trying to setup a DTLS client based in order to establish a CoAP Secure Session via Openthread to a Borderrouter and I am struggling in the handshake process. It would be greatly helpful to have the Debugging Messages shown up.
As explained in the documentation for CONFIG_MBEDTLS_DEBUG i am calling the mentioned functions in my code:
However, when building in this setup I get:
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/jan-zephyr/echo_client/CoAPS_Client/ec1/build/zephyr/zephyr_pre0.map
: && ccache /home/jan-zephyr/zephyr-sdk-0.13.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++ zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -fuse-ld=bfd -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=/home/jan-zephyr/echo_client/CoAPS_Client/ec1/build/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a zephyr/lib/libc/newlib/liblib__libc__newlib.a zephyr/lib/posix/liblib__posix.a zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a zephyr/boards/arm/nrf5340dk_nrf5340/libboards__arm__nrf5340dk_nrf5340.a zephyr/subsys/net/libsubsys__net.a zephyr/subsys/net/l2/openthread/libsubsys__net__ip__l2__openthread.a zephyr/subsys/net/ip/libsubsys__net__ip.a zephyr/subsys/net/lib/config/libsubsys__net__lib__config.a zephyr/subsys/net/lib/conn_mgr/libsubsys__net__lib__conn_mgr.a zephyr/subsys/net/lib/openthread/platform/libopenthread_platform.a zephyr/subsys/random/libsubsys__random.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/ieee802154/libdrivers__ieee802154.a zephyr/drivers/ipm/libdrivers__ipm.a zephyr/drivers/flash/libdrivers__flash.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/entropy/libdrivers__entropy.a zephyr/drivers/timer/libdrivers__timer.a modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a modules/nrf/subsys/fw_info/lib..__nrf__subsys__fw_info.a modules/hal_nordic/nrf_802154/libnrf-802154-platform.a modules/nrfxlib/nrf_802154/nrf_802154/serialization/libnrf-802154-serialization.a modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a modules/libmetal/libmetal/lib/libmetal.a modules/open-amp/open-amp/lib/libopen_amp.a modules/nrfxlib/nrfxlib/nrf_security/src/zephyr/libmbedtls_zephyr.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a -L"/home/jan-zephyr/zephyr-sdk-0.13.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/thumb/v8-m.main/nofp" -L/home/jan-zephyr/echo_client/CoAPS_Client/ec1/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a modules/hal_nordic/nrf_802154/libnrf-802154-platform.a -no-pie -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn spm/libspmsecureentries.a -lm -Wl,-lc -L"/home/jan-zephyr/zephyr-sdk-0.13.2/arm-zephyr-eabi/arm-zephyr-eabi"/lib/thumb/v8-m.main/nofp -Wl,-lgcc -lc -specs=nano.specs modules/openthread/build/src/cli/libopenthread-cli-ftd.a modules/openthread/build/src/core/libopenthread-ftd.a modules/openthread/build/third_party/tcplp/libtcplp.a modules/openthread/build/src/core/libopenthread-mtd.a modules/openthread/build/src/core/libopenthread-ftd.a modules/openthread/build/third_party/tcplp/libtcplp.a modules/openthread/build/src/core/libopenthread-mtd.a modules/nrfxlib/nrfxlib/nrf_security/src/libmbedtls.a modules/nrfxlib/nrfxlib/nrf_security/src/libmbedx509.a modules/nrfxlib/nrfxlib/nrf_security/src/libmbedcrypto.a /home/jan-zephyr/echo_client/CoAPS_Client/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_psa_3.0.10.a /home/jan-zephyr/echo_client/CoAPS_Client/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_mbedtls_3.0.10.a modules/nrfxlib/nrfxlib/nrf_security/src/libmbedcrypto_base.a -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -lc /home/jan-zephyr/echo_client/CoAPS_Client/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_3.0.10.a && cd /home/jan-zephyr/echo_client/CoAPS_Client/ec1/build/zephyr && /usr/bin/cmake -E echo
/home/jan-zephyr/zephyr-sdk-0.13.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(echo-client.c.obj): in function `main':
/home/jan-zephyr/echo_client/CoAPS_Client/ec1/src/echo-client.c:349: undefined reference to `mbedtls_debug_set_threshold'
Can someone help me here with this problem? Am I missing a library or having a configuration set wrong?
Every help would be greatly appreciated!
best regards
Jan
Setup
OS: Ubuntu 20.04
Zephyr Version: 2.7.99
nRF Connect SDK: 1.9.0
Board: nRF5340dk
Sample: zephyr/samples/net/sockets/echo_client
Config-Files:
prj.conf:
overlay-ot.conf
Building it with:
west build -b nrf5340dk_nrf5340_cpuapp_ns . -DCONF_FILE="prj.conf overlay-ot.conf overlay-tls.conf" --pristine
Flashing:
west flash
Further Information
To keep it simple I am using the predefined PSK to establish DTLS. To start openthread I implemented the following code:
In order to send the CoAP request I changed the function send_udp_data a little: