Skip to main content
Associate
January 7, 2026
Solved

Inference Blocking on LL_ATON_OSAL_WFE() with ThreadX

  • January 7, 2026
  • 3 replies
  • 334 views
Hello,
 
I am working on implementing an object detection application for the STM32N6570-DK, starting from the reference projects:
 
I'm encountering a blocking issue when implementing the inference pipeline:
 
During debugging, I found that the inference execution blocks indefinitely at LL_ATON_OSAL_WFE() on line 105 of Appli\App\Src\app_nn.c. The code is stuck in the following loop:
static void NN_RunInference(void) {
 LL_ATON_RT_RetValues_t ret;

 do {
 ret = LL_ATON_RT_RunEpochBlock(&NN_Instance_od_yolo_x_person);

 if (ret == LL_ATON_RT_WFE) {
 LL_ATON_OSAL_WFE(); // <-- Blocks here
 }
 } while (ret != LL_ATON_RT_DONE);

 LL_ATON_RT_Reset_Network(&NN_Instance_od_yolo_x_person);
}
 
I've reviewed similar posts in the community
, but it didn't resolve my issue.
 
Questions:
What could be the issue that blocks inference indefinitely at `LL_ATON_OSAL_WFE()`, and how to fix it?
 
Source Code:
My current implementation is available at: https://github.com/Foahh/stm32n6-ai-camera.git
Best answer by Foahh

The problem fixed by adding the code below.

void HAL_CACHEAXI_MspInit(CACHEAXI_HandleTypeDef *hcacheaxi)
{
 __HAL_RCC_CACHEAXIRAM_MEM_CLK_ENABLE();
 __HAL_RCC_CACHEAXI_CLK_ENABLE();
 __HAL_RCC_CACHEAXI_FORCE_RESET();
 __HAL_RCC_CACHEAXI_RELEASE_RESET();
}

void HAL_CACHEAXI_MspDeInit(CACHEAXI_HandleTypeDef *hcacheaxi)
{
 __HAL_RCC_CACHEAXIRAM_MEM_CLK_DISABLE();
 __HAL_RCC_CACHEAXI_CLK_DISABLE();
 __HAL_RCC_CACHEAXI_FORCE_RESET();
}

I compared it with other projects, and it looks like I forgot to implement something for enabling the CACHEXI.

I found npu_cache_init() calls HAL_CACHEAXI_Init() and the latter one internally calls HAL_CACHEAXI_MspInit(),

but HAL_CACHEAXI_MspInit() is not implemented in my code.

3 replies

FoahhAuthor
Associate
January 9, 2026

Update: I initially used STEdgeAI 3.0. I later switched to STEdgeAI 2.2, but the issue persisted.

FoahhAuthor
Associate
January 9, 2026
 .text.NPU0_IRQHandler
 0x340322d8 0x124 CMakeFiles/Firmware_Appli.dir/.../ll_aton/ll_aton_runtime.c.obj
 0x340322d8 NPU0_IRQHandler

The furthest I’ve been able to debug is that NPU0_IRQHandler (expanded by ATON_STD_IRQHandler macro in ll_aton_runtime.c) never fires.

FoahhAuthorBest answer
Associate
January 9, 2026

The problem fixed by adding the code below.

void HAL_CACHEAXI_MspInit(CACHEAXI_HandleTypeDef *hcacheaxi)
{
 __HAL_RCC_CACHEAXIRAM_MEM_CLK_ENABLE();
 __HAL_RCC_CACHEAXI_CLK_ENABLE();
 __HAL_RCC_CACHEAXI_FORCE_RESET();
 __HAL_RCC_CACHEAXI_RELEASE_RESET();
}

void HAL_CACHEAXI_MspDeInit(CACHEAXI_HandleTypeDef *hcacheaxi)
{
 __HAL_RCC_CACHEAXIRAM_MEM_CLK_DISABLE();
 __HAL_RCC_CACHEAXI_CLK_DISABLE();
 __HAL_RCC_CACHEAXI_FORCE_RESET();
}

I compared it with other projects, and it looks like I forgot to implement something for enabling the CACHEXI.

I found npu_cache_init() calls HAL_CACHEAXI_Init() and the latter one internally calls HAL_CACHEAXI_MspInit(),

but HAL_CACHEAXI_MspInit() is not implemented in my code.