This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NCS Open Thread Project fails to compile in SES, but compiles with west

Dear Nordic Team,

i could not find a good and clean starting point for a development of a simple Open Thread application, which is not bases on CLI in the examples. Therefore i took the CLI example and started to modify the config-file, as mentioned in the docs.

My prj.conf, now looks like:

# Kernel options
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_INIT_STACKS=y

CONFIG_NETWORKING=y

# Disable TCP and IPv4 (TCP disabled to avoid heavy traffic)
CONFIG_NET_TCP=n
CONFIG_NET_IPV4=n

CONFIG_NET_IPV6_NBR_CACHE=n
CONFIG_NET_IPV6_MLD=n
CONFIG_NET_CONFIG_NEED_IPV4=n
CONFIG_NET_CONFIG_MY_IPV4_ADDR=""
CONFIG_NET_CONFIG_PEER_IPV4_ADDR=""

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# A sample configuration to enable Thread Joiner, uncomment if needed
CONFIG_OPENTHREAD_JOINER=y
CONFIG_OPENTHREAD_JOINER_AUTOSTART=y

# Increase set for threads with meta-irq priority
CONFIG_NUM_METAIRQ_PRIORITIES=1

# Logging
CONFIG_NET_LOG=y
CONFIG_NET_STATISTICS=y

# Disable certain parts of Zephyr IPv6 stack
CONFIG_NET_IPV6_NBR_CACHE=n
CONFIG_NET_IPV6_MLD=n

# Stack sizes configuration
CONFIG_NET_TX_STACK_SIZE=1200
CONFIG_NET_RX_STACK_SIZE=1500

# Network buffers
CONFIG_NET_PKT_RX_COUNT=10
CONFIG_NET_PKT_TX_COUNT=16
CONFIG_NET_BUF_RX_COUNT=16
CONFIG_NET_BUF_TX_COUNT=16

CONFIG_NET_SOCKETS=y

# L2 OpenThread enabling
CONFIG_NET_L2_OPENTHREAD=y
CONFIG_OPENTHREAD_DEBUG=y
CONFIG_OPENTHREAD_L2_DEBUG=y
CONFIG_OPENTHREAD_L2_LOG_LEVEL_INF=y

# Disable OpenThread autostart
CONFIG_OPENTHREAD_MANUAL_START=y

# Disable vanilla mbedtls in favor of custom backends
CONFIG_OPENTHREAD_MBEDTLS=n

# Disable unneeded mbedtls modules
CONFIG_MBEDTLS_CIPHER_MODE_CBC=n
CONFIG_MBEDTLS_CIPHER_MODE_CTR=n
CONFIG_MBEDTLS_CIPHER_MODE_CFB=n
CONFIG_MBEDTLS_CIPHER_MODE_OFB=n
CONFIG_MBEDTLS_CIPHER_MODE_XTS=n
CONFIG_MBEDTLS_GCM_C=n
CONFIG_MBEDTLS_CHACHA20_C=n
CONFIG_MBEDTLS_POLY1305_C=n
CONFIG_MBEDTLS_CHACHAPOLY_C=n
CONFIG_MBEDTLS_DHM_C=n
CONFIG_MBEDTLS_RSA_C=n
CONFIG_MBEDTLS_SHA1_C=n
CONFIG_MBEDTLS_SHA512_C=n
CONFIG_MBEDTLS_HEAP_SIZE=10240

# mbedTLS tweaks
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=768

The K-Config

menu "Zephyr Kernel"
source "Kconfig.zephyr"
endmenu

When i try to build this with the SES, deep within the librarys it fails:

But when i build it with the west toolchain via command line, it builds!

"west build -b nrf52840dongle_nrf52840 -d build_openthread_example"

What is the problem? How can i get this running in SES?

BTW the code:

Thanks

  • Hi SoerenBirth,

    Please be aware that Zephyr project samples are not supported by SES by default. West is the default building management tool for Zephyr samples. Only samples in NCS nrf folder and the supported boards as mentioned on NCS document can use SES to build and debug. From this error report, I guess the SES did not find the path of mbedtls library, because the CMakeList.txt file structure in NCS project sample is different from the Zephyr one. I strongly suggest you modify from an NCS OpenThread sample if you prefer to use SES as your debug tool.

    Best regards,

    Charlie

  • Hi Charlie,

    thank for your recommendation, but the CLI project is a (in my understanding) a ncs project.

    The CLI project is located in "..\v1.5.1\nrf\samples\openthread\cli".

    Best regards,

    Sören

    Btw: Is there a ready to build configured project, where i can use the "Open Thread" API on the nrf52840 Dongle? Or could you provide anything like this? Cause i really struggeling to find a proper configuration, to start my development.

  • Hi Sören,

    I see, so you already start from the CLI example. Fro my understanding, you have two requests:

    1) simple application that sends UDP packages based on OT stack(Thread devices only use UDP by far).

    2) running the above application on nRF52840 Dongle.

    The suggestions for them are:

    1) You can use UDP APIs provide by OT protocol, but CoAP as an application protocol based on UDP designed for resource-limited devices is a better start point, that's the reason we provide CoAP client/sever examples directly. If you do want to know how to use the UDP socket, you can refer to CoAP implementation.

    2) I have checked with our development team, we do have a plan to add support for nRF52840 Dongle in a future release, but not in a short time. The nRF52840 Dongle needs to use USB peripheral instead of UART on nRF52840DK. It also does not have an external flash on board, so you may have issues with your application code growth. I strongly suggest you start with the nRF52840DK board for your development. 

    Best regards,

    Charlie

Related