Hello
I am testing a TFLite Micro model using the CMSIS-NN backend on a Cortex-M4-based board running FreeRTOS & I’ve encountered a puzzling issue: the inference call (interpreter->Invoke()
) stalls indefinitely when run from a non-blocking RTOS task.
It works perfectly in a blocking task or bare-metal setup; which leads me to suspect a timing/resource conflict / CMSIS-NN kernel state dependency.
The model is a basic keyword spotting network (Conv → Pool → Dense), quantized to INT8 & works well in isolation. However, in a multitasking environment especially with dynamic memory / DMA activity elsewhere the inference sometimes fails to return, without hitting any obvious assert or fault.
Checked https://github.com/ARM-software/CMSIS_5/issues/1487-Mulesoft Training guide related to this and found it quite informative.
I have checked stack usage and tried statically allocating the tensor arena; but the issue persists. Has anyone faced CMSIS-NN kernel reentrancy issues or tight timing sensitivity in FreeRTOS environments?
Would appreciate thoughts or debug tips.
Thank you !!