cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 FreeRTOS LL_ATON_OSAL_WFE

Tuomas95
Associate II

Hello,

Based on my understanding, in this code

  /* Run inference by executing epoch blocks until done */
  LL_ATON_RT_RetValues_t result;
  uint32_t total_run_ticks = 0u;
  uint32_t total_wfe_ticks = 0u;
  do {
    uint32_t run_start = tim2_get_count();
    result = LL_ATON_RT_RunEpochBlock(&NN_Instance_audio_network);
    uint32_t run_end = tim2_get_count();
    total_run_ticks += (uint32_t)(run_end - run_start);
    if (result == LL_ATON_RT_WFE) {
      uint32_t wfe_start = tim2_get_count();
      LL_ATON_OSAL_WFE();
      uint32_t wfe_end = tim2_get_count();
      total_wfe_ticks += (uint32_t)(wfe_end - wfe_start);
    }
  } while (result != LL_ATON_RT_DONE);
  uint32_t npu_end = tim2_get_count();
  uint32_t total_us = tim2_ticks_to_us((uint32_t)(npu_end - npu_start));
  uint32_t run_us = tim2_ticks_to_us(total_run_ticks);
  uint32_t wfe_us = tim2_ticks_to_us(total_wfe_ticks);
  LOGI_I32("NPU inference (us): ", (unsigned long)total_us);
  LOGI("NPU epoch time (us): run=%u wfe=%u", run_us, wfe_us);

calling LL_ATON_OSAL_WFE() does not give time for other tasks to run while the epoch is executing, but instead just calls __WFE() and sleeps the core, as i don't see an implementation of aton_osal_freertos_wfe()?


With the Yamnet1024 model, the time is split like this (printed by the code above): NPU epoch time (us): run=10480 wfe=7660

What would be the best way to let other tasks execute while the epoch is running?

CubeMX version 6.16.1

X-CUBE-AI version 10.2.0

X-CUBE-FREERTOS version 1.4.0

 

Thanks!

0 REPLIES 0