We ran into issues enabling CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED on a MTD device. The device fails to join the network. Oddly enough, exit seems to be called ("exit" is outputted on the console) and the device just stalls as it attempts to join the Thread network.
uart:~$ *** Booting Zephyr OS build v3.3.99-ncs1-1 *** exit
The issue can be reproduced on a nrf5340dk_nrf5340_cpuapp board using the openthread/cli sample and the following configuration:
# # Copyright (c) 2020 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Network shell CONFIG_SHELL=y CONFIG_OPENTHREAD_SHELL=y CONFIG_SHELL_ARGC_MAX=26 CONFIG_SHELL_CMD_BUFF_SIZE=416 # Enable OpenThread features set CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n CONFIG_OPENTHREAD_JOINER=y CONFIG_OPENTHREAD_MANUAL_START=n CONFIG_OPENTHREAD_JOINER_AUTOSTART=y CONFIG_OPENTHREAD_JOINER_PSKD="J01NU5" CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED=y CONFIG_NET_L2_OPENTHREAD=y # Generic networking options CONFIG_NETWORKING=y CONFIG_MBEDTLS_SHA1_C=n CONFIG_FPU=y CONFIG_GPIO_SHELL=y
Removing CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED=y or using CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER=y fixes the issue.