2025-09-28 4:17 PM
Hello,
I am currently using the STM32N657-DK board with X-CUBE-AI (ST Edge AI Core v2.2.0).
I have successfully converted a TensorFlow Lite model to run on the NPU and can build and flash the firmware without issues.
Problem
When I call the function
ret = LL_ATON_RT_RunEpochBlock(&NN_Instance_Default);
it never returns.
The variable ret never reaches LL_ATON_RT_DONE, and it seems that the NPU interrupt (NPU3_IRQn) is not triggered.
Current configuration
Clock and Reset
Enabled the NPU clock and released the reset:
In set_clk_sleep_mode(), the NPU sleep-mode clock is also enabled.
Interrupt routing
In the Secure project:
In the NonSecure project:
RIF / RISAF configuration
Configured NPU master/slave attributes to NonSecure + privileged.
Added RISAF regions so that NonSecure code can access NPU RAM3–RAM6 (0x3420_0000–0x343C_0000):
Activation buffer
Declared in the .noncacheable section with 32-byte alignment.
Questions
Is any additional RISAF or RIF configuration required to allow the NPU to generate interrupts in a NonSecure environment?
To enable Epoch Controller interrupts, do I need to explicitly configure ATON_INTCTRL registers (e.g. ATON_INTCTRL_CTRL_SET_EN, ATON_INTCTRL_INTORMSK0_SET), or should X-CUBE-AI handle this automatically?
Could this issue be related to the memory attributes of the NPU region (cacheable vs. non-cacheable)? If so, what configuration is recommended?
Are there any known issues with NPU interrupt routing (NPU3_IRQn) in Secure/NonSecure TrustZone projects on STM32N6?
Thank you very much for your support.
I am attaching all the files I have modified so far.
2025-09-28 4:19 PM
I have updated the post in English with the revised files.
Please help me resolve the issue.