cancel
Showing results for 
Search instead for 
Did you mean: 

I can't figure how to use external SDRAM for camera&LCD buffer and AI can someone help me please ? (STM32F769I-EVAL)

Bastien.I
Associate II

Hello,

I used the example DCMI_CaptureMode for the STM32F769I-EVAL and the CubeMX generator with CubeAI in order to make an object classifier on board. It worked well with the internal RAM for 28*28*1 pictures but now that I want it to work for 128*128*3 pictures, it needs more RAM, but I can't achieve to use the external SDRAM:

The issue is: if I use MX_X_CUBE_AI_Process(); the screen freezes, and if I don't use it, I still have issues calling BSP_LCD_FillRect() => it doesn't show a rectangle whereas on other projects, it did.

Question 1: Can we see how much of the external RAM is reserved to CubeAI ? (in order to use the rest of the external RAM for peripherals)

Question 2: Do you have an idea on how to deal with my issue ? Anything would be welcome.

Here is the way I tried to tackle the issue:

-> I used the advanced option to use the external SDRAM for CubeAI, but it comes in conflict with the camera and LCD buffers (LCD_FRAME at 0xC0000000, Camera_FRAME at 0xC0177000, and I believe RAM allocated to AI started at 0xC0000000 too).

-> I tried to move the LCD/Camera buffer and it didn't help, same when I moved the MPU_InitStruct.BaseAddress that was generated by CubeMX with CubeAI using external RAM. (I believe because of this change, that "MPU_InitStruct.BaseAddress" is the value that change where the AI starts using RAM but I'm certainly wrong).

+ Reading "Application Note - Managing memory protection unit in STM32 MCUs", the part 3.4 says "When a speculative prefetch happens, it may impact

memories or devices which are sensitive to multiple accesses (such as FIFOs, LCD controller)." but I don't really get the explanation on how to configure it...

 [Edit: write the end of the issue as I posted the question while writing it]

1 ACCEPTED SOLUTION

Accepted Solutions
fauvarque.daniel
ST Employee

In CubeAI, when you do an analyze, it will show you the amount of RAM needed for the activation buffer

In the advanced settings window it will show in the size field the amount of RAM needed

You can specify any address for the starting address of the buffer, for example you could use end of ram address - size of activation buffer. It is actually up to you to verify if the LCD buffer is not overlapping with the spaces needed for AI.

Regards

Daniel


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.

View solution in original post

1 REPLY 1
fauvarque.daniel
ST Employee

In CubeAI, when you do an analyze, it will show you the amount of RAM needed for the activation buffer

In the advanced settings window it will show in the size field the amount of RAM needed

You can specify any address for the starting address of the buffer, for example you could use end of ram address - size of activation buffer. It is actually up to you to verify if the LCD buffer is not overlapping with the spaces needed for AI.

Regards

Daniel


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.