Skip to main content
Associate III
March 25, 2025
Solved

ll-aton Running a model but always get Nans as the result

  • March 25, 2025
  • 1 reply
  • 893 views

I used the N6 to run the mobilenet_v1_0.25_224_fft_int8.tflite, input is correctly put into the input buffer, memory map activated, NPU RAM enabled, AXICACHE enabled, everything seems to be right, the input I also test the input inside the PC in python, and the model can output things right.

I dot know why, but in some steps it either jumps in to HardFault_Handler (if I directly start the debugging process without any break point)

or runs everything right (using some breakpoints inside the runtime and network.c) but outputs are all Nans

do you have any ideas how I can fix them ?

Best answer by Julian E.

Hello @Einstein_rookie_version ,

 

Can you explain further what you mean by "outputs are all Nans".

If the results are inconsistent, a common issue is the need to properly configure the RIF.
Don't forget to enable the clocks (for the NPU, RAM, etc.) during WFE operations.

 

This documents presents most of the matters to be careful with:

STM32N6 Example projects & tips for creating new projects

 

Have a good day,

Julian

 

1 reply

Julian E.
Julian E.Best answer
Technical Moderator
March 26, 2025

Hello @Einstein_rookie_version ,

 

Can you explain further what you mean by "outputs are all Nans".

If the results are inconsistent, a common issue is the need to properly configure the RIF.
Don't forget to enable the clocks (for the NPU, RAM, etc.) during WFE operations.

 

This documents presents most of the matters to be careful with:

STM32N6 Example projects & tips for creating new projects

 

Have a good day,

Julian

 

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Associate III
March 26, 2025

Thank you for the documentation, It's really helpful.

I found the problem, and It might because I was using UART to transfer a more than 100KB image to the in_buffer in the AXIRAM, so, the HAL_receive itself can not receive so much once, and I wrote a while fo it, to receive it seperately, with every timne 64KB max.

And the aligment of the data some how get wrong, do you have idea how I can use DMA of the N6 to directly transfer a more than 64KB data to the AXIRAM5 directly with only one time HALDMA beginning? the size is uint16, so max 64KB, I heard I might can use LLI of the HPDMA to do this, but I haven't learnd any thing about that, in university 64KB is far from enough, so have no experience on how to do that with LLI, do you have any documentations regarding that ?

Julian E.
Technical Moderator
March 26, 2025

Hello @Einstein_rookie_version ,

 

I don't have much knowledge about that kind of things.

I found this that may help you:

https://www.st.com/resource/en/application_note/an5593-how-to-use-the-gpdma-for-stm32-mcus-stmicroelectronics.pdf 

 

I think my colleagues answering questions for hardware will know much more that I do, please try asking them with the tag STM32N6 here: 

STM32 MCUs Boards and hardware tools - STMicroelectronics Community 

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.