cancel
Showing results for 
Search instead for 
Did you mean: 

X-Cube-AI Used RAM and Used FLASH modification

Z-YF
Associate III

I am using the STM32N6570-DK board to run AI model on it. And I have modified the stm32n6.mpool file because the board actually have a 1‑Gbit Octo‑SPI flash memory, which is 128MB instead of 64MB.  But even if I have already adjusted it, the cubemx still shows "Used Flash:3.51MB(.00B over 64.00 MiB xSPI2)". Is there a problem and how I can fix it? By the way, I want to know that where I can get some examples about using AI on the STM32N6570-DK board, and the correct way to modify the files so that I can use the external memory on the board.

3 REPLIES 3
Julian E.
ST Employee

Hello @Z-YF,

 

First, note that if you work with the external memory, the performance of your model in terms of inference time will reduce drastically.

 

Then you are right, there is indeed 128MB on the DK. 64 is for the Nucleo.

From my understanding, it should be fixed next release.

I think it is only a interface issue, when you do a validate, here is what I get:

JulianE_0-1745422493973.png

 

For examples using AI, you can look at the getting started:

https://www.st.com/en/development-tools/stm32n6-ai.html#overview 

 

Note on the memory pool:

When the NPU compiler can use two memory locations to fit, for example, an activation buffer, it decides which location is ‘the best’ based on estimated data access time. For this allocation algorithm to perform well, it is then required to describe the memory with as much accuracy as possible.
The example mpool files are written for STM32N6 and contain descriptions for each internal memory cuts + external memories accessed through XSPI:

  • Disposable AXISRAM is definitely slower than NPU-RAMs. The NPU compiler prefers using NPU-RAMs to allocate buffers and uses the AXISRAM if the NPU-RAMs are full.
  • External memories are even slower than AXISRAM. NPU compiler allocates data in external memories as a last resort.

 

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.

Thank you, but I still want to confirm that if I use the configuration according to the picture above, the 3.51MiB used FLASH will be stored in the external 1Gbit FLASH, right?

Hello @Z-YF,

 

Yes, I think.

I would advise you to look at the table I sent in my last message.

When you do a Analyse, you get the exact detail of the memory used.

 

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.