cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 PSRAM speed

sbi
Associate III

Referring to this discussion: https://community.st.com/t5/stm32-mcus-touch-gfx-and-gui/slow-fade-with-touchgfx/td-p/591072 I try to ask here since the problem seems not to be related to touchgfx. I try to riassume my problem.
It seems that the access to the psram is slow. My micontroller is a STM32H7ZIT6 in lqfp 144 pins package.
I interfaced a sram with two transparent d-type latches (and inverter for nadv) in order to match a psram connection. I'm not able to find a psram so I used this solution and it seems it works. The sram I use is this: https://www.issi.com/WW/pdf/61-64WV102416FALL-BLL.pdf
The FMC module is configured in this way:

FMC Configuration.jpg

 And this is the clock configuration of the FMC module:

FMC Clock.jpg

The cpu frequency is set to 480MHz and it seems correct because I see a 48MHz on MCO1 output (with a 10/ divisor).
Using this simple benchmark:

 

uint16_t psramRead = 0 ;
int begin;
int end;
int TimeRead;
int TimeWrite;
int TimeModify;
uint16_t *psram = 0x60000000;

begin = HAL_GetTick();

for (uint32_t i=0; i<1048576; i++){
	  psram[i] = 0x0;
}

TimeWrite = HAL_GetTick() - begin;

begin = HAL_GetTick();

for (uint32_t i=0; i<1048576; i++){
  psramRead = psram[i];
	 }

TimeRead = HAL_GetTick() - begin;

begin = HAL_GetTick();

for (uint32_t i=0; i<1048576; i++){
  psram[i] += 2 ;
	 }

TimeModify = HAL_GetTick() - begin;

 

I see these times:

TimeWrite is around 170ms
TimeRead is around 100ms
TimeModify is around 188ms

Which seems extremely high to me.
Where it could be the problem? Any help?

5 REPLIES 5
SofLit
ST Employee

Hello,

Sorry I didn't understand. Your measurement is done on 1048576 iterations.

--> 170ms/1048576 ~ 162ns/iteration. Is that extremely high for you?

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.
sbi
Associate III

Hi @SofLit 
The ram has an access time of 10ns. It is not possible to reach this goal since the ram is multiplexed but I think that 162ns is quite high. A part my rough test, as you see in the link I posted above, I have a big problem on refreshing my screen. Do you think that there is something wrong in my settings?
Or 160ns per write is the maximum I can achieve?

SofLit
ST Employee

Check your FMC Clock and timing configuration

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.
sbi
Associate III

I've checked them many times and seems correct to me. I've copy/paste my configuration in my first post. Do you see anything wrong or strange?
Thank you

...and optimizer setting ?  -o2 ?

If you feel a post has answered your question, please click "Accept as Solution".