2024-01-09 10:13 AM
Hello,
I have a STM32H747I-DISCO touchGFX project that has a 8-bit color depth and it is working very well, when I use external RAM for frame buffer. But when I disable external RAM and use internal RAM for the frame buffer by applying these instructions in the link below, I see partly corrupted screen.
Ref:https://support.touchgfx.com/docs/development/board-bring-up/how-to/03-display-internal
and this is the original screen:
Should I do something else that is not written in the 'Display with framebuffer in internal RAM' instruction?
Thanks for the answers
2024-01-10 03:39 AM
Hello again,
Do you have any suggestion for this?
2024-01-10 04:42 AM
Your controller has multiple internal RAM blocks. Can you try anther one? Looks like an alignment problem
2024-01-10 05:05 AM - edited 2024-01-10 05:59 AM
@MMenz.1 Thank you for your reply but I can not use other RAM blocks because of frame buffer size. What do you mean with alignment problem? Can you explain? Thanks!
2024-01-10 05:11 AM
By the way, this is another example.
2024-01-10 06:27 AM
DMA often can only access 32bit aligned addresses. When your buffer starts at another address it may lead to shredded images.
2024-01-10 07:00 AM
Are you sure that you have only changed the location of the buffer? it locks a bit like your array dimensions are incorrect. I find it easier to identify when you place small squares with different colors in each corner.
2024-01-10 07:54 AM - edited 2024-01-10 08:01 AM
@MMenz.1 I just set frame buffer in internal RAM in a specific address (0x240000EC) and also disabled DMA2D. Can 'Disabling the DMA2D' be the reason? If yes, I had disabled the DMA2D, when I used external RAM and it was working without any problem. Should I enable it, when I use internal RAM.
2024-01-10 01:42 PM
One more update... It seems the problem is not about frame buffer. I connected to the MCU with debugger to review frame buffer memory region (in internal RAM). Every byte is in correct place. But I found something else. When I comment out LCD_SetUpdateRegionLeft() in HAL_DSI_TearingEffectCallback() (TouchGFXHAL.cpp), half of the screen is working without any problem.
void HAL_DSI_TearingEffectCallback(DSI_HandleTypeDef* hdsi)
{
GPIO::set(GPIO::VSYNC_FREQ);
HAL::getInstance()->vSync();
OSWrappers::signalVSync();
// In single buffering, only require that the system waits for display update to be finished if we
// actually intend to update the display in this frame.
HAL::getInstance()->lockDMAToFrontPorch(refreshRequested);
if (refreshRequested && !displayRefreshing)
{
// Update region 0 = first area of display (First quarter for 16bpp, first half for 24bpp)
updateRegion = 0;
// LCD_SetUpdateRegionLeft();
// Transfer a quarter screen of pixel data.
HAL_DSI_Refresh(hdsi);
displayRefreshing = true;
}
else
{
GPIO::clear(GPIO::VSYNC_FREQ);
}
}
But when I uncomment it, screen is not working. Here is the result images:
Original image (from touchGFX designer):
When I comment out LCD_SetUpdateRegionLeft(), right side of the screen is working without any problem:
When I uncomment LCD_SetUpdateRegionLeft(), screen is not working. Pixels are not at correct places:
What can be the possible reasons of this situation? I would be grateful if you have any suggestions. Thanks!
2024-01-10 11:05 PM
RAM Address appears to be fine. You could try an even more even address such as 0x24010000.
Why did you disable the DMA2D? Performance is much worse when you do that. Definitely try to enable it. It alone should not break your application however.