As an application developer, you must make sure that calls to the OpenThread API are not preempted by other calls to the OpenThread API.
main
function context. Do not call any OpenThread functions in ISRs or callbacks from ISR context. You can use the app_scheduler
module to execute callbacks from the app_timer
and the SoftDevice in the main context. Refer to the examples included in this SDK to see how the app_scheduler
module should be used with OpenThread.MbedTLS can utilize external implementation for mutexes when working in the RTOS environment. The freertos_mbedtls_mutex module enables usage of FreeRTOS mutexes with mbedTLS. For details and the list of modules with automatic locking protection, see MbedTLS Thread Safety and Multi Threading.
To enable Thread-safe MbedTLS in your FreeRTOS application:
mtls_ts
directory.<InstallFolder>/components/thread/freertos_mbedtls_mutex/
.freertos_mbedtls_mutex_init()
in the initialization of the application before initializing OpenThread and using any mbedTLS API.The USB variant of the nRF52840 platform library uses a feature called pseudo reset.
Pseudo reset causes the reinitialization of the OpenThread stack and certain peripherals. It is invoked instead of triggering a hardware reset when a reset from OpenThread stack is requested. The reason for such behavior is that when native USB CDC connectivity is used, performing a hardware reset would cause the device to reenumerate in the host system. As a result, this would impair the ongoing communication through CLI or Spinel. Any application that uses USB CDC for serial communication must use the pseudo reset feature instead of the hardware reset. Refer to Thread CLI Example or Thread NCP/RCP Example for an example implementation of this feature.