2023-10-03 06:06 AM
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:
And this is the clock configuration of the FMC module:
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?
2023-10-04 07:24 AM - edited 2023-10-04 07:25 AM
Hello,
Sorry I didn't understand. Your measurement is done on 1048576 iterations.
--> 170ms/1048576 ~ 162ns/iteration. Is that extremely high for you?
2023-10-05 12:31 AM
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?
2023-10-05 06:50 AM
Check your FMC Clock and timing configuration
2023-10-05 06:56 AM
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
2023-10-05 07:02 AM
...and optimizer setting ? -o2 ?