Skip to main content
SBébi.1
Associate
January 12, 2025
Question

X-Cube-AI OCTOSPI External Memories

  • January 12, 2025
  • 1 reply
  • 562 views

Hi,

 

I'm using the B-U585I-IOT02A development board and I have some problems using external memories with AI. The board has an external PSRAM memory in OCTO SPI and a NOR FLASH in OCTO SPI (quad?) but this seems impossible to use with X-Cube-AI. I am stuck today and I cannot find the information through the various documents that I have seen on internet.

 

1. Is it possible to use OCTO-SPI PSRAM to extend RAM for AI ?

On ST cloud developer, all boards with OCTO-SPI PSRAM seem not to work to expand RAM. On the AI ​​configuration window in CubeMX, it is impossible to choose PSRAM memory because it's not  "physical" memory.

I made different attempts, I set the PSRAM in Memory Mapped Mode, I assigned it in the linker, I assigned the AI ​​activation buffer on the PSRAM, but in addition to being slow, the AI results are incorrect. I know there is a time between a valid write and a read, is this the problem ?

 

2. How to program the model binary into OCTO-SPI External NOR Flash ?

The "Getting started with X-CUBE-AI Expansion Package for Artificial Intelligence (AI)" (UM2526) said "The network_data.bin file must be programmed on the external Flash memory on the board manually
using a tool such as STM32CubeProgrammer (STM32CubeProg)".

I configured my OCTO External NOR Flash in Memory Mapped Mode, however it seems impossible to send the binary through "STM32CubeProgrammer", writing does not work leaving all bytes at 0.

 

Thanks,

1 reply

Julian E.
Technical Moderator
January 16, 2025

Hello @SBébi.1,

 

 

Q1 :

Indeed, external PSRAM memory of the B-U585I-IOT02A is not available in the latest X-CUBE-AI version (v10.0.0).

You can choose the Custom memory option, with Start Address = 0x90000000.

In your firmware project, I recommend you to use the BSP library (GitHub repository: https://github.com/STMicroelectronics/b-u585i-iot02a-bsp) and use functions declared in "b_u585i_iot02a_ospi".c / .h files.

You can see in the header file that external flash (mx25lm51245g) & RAM (aps6408) components are used, also available on GitHub.

 

Q2 :

I confirm that you should use STM32CubeProgrammer to program both internal and external flash.

To use an external flash, you need to use an external loader (EL icon on the bottom left).

Then, for the B-U585I-IOT02A, select MX25LM51245G_STM32U585I-IOT02A. You can now flash your binary file.

 

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.