Relation between frame buffer and display width
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-08 06:12 AM
Hello everyone,
I am using STM32L4R9AII with my custom board.
When i start to develop my project, cubemx didn't support my MCU. So, I got discovery board project from Touchgfx and changed a lots of things to adapt it to my custom board.
Now cubemx supports my MCU. I started to pass my project to cubemx project. My screen resolution is 400x400px via MIPI dsi. When i established my project from cubemx, it didnt work well. I put a box on screen, i could see the box color but every lines were different places.
I digged down deep:
I passed display width as 400px to cubemx. So, Touchgfx passed BlitOp.nSteps=400 to DMA2D.
But GFXMMU module knows evey line has 1024px, but display is 400px. BlitOp.nSteps must be 1024. When i check my old project and discovery board project from new version of cubemx, i found code below to fix it:
#define BSP_LCD_IMAGE_WIDTH (3072 / 2)
#ifndef GUI_FRAME_BUFFER_WIDTH
#define GUI_FRAME_BUFFER_WIDTH BSP_LCD_IMAGE_WIDTH
void TouchGFXHAL::setFrameBufferStartAddresses(void* frameBuffer, void* doubleBuffer, void* animationStorage)
{
bool useDoubleBuffering = (doubleBuffer != 0);
bool useAnimationStorage = (animationStorage != 0);
uint8_t* buffer = static_cast<uint8_t*>(frameBuffer);
frameBuffer0 = reinterpret_cast<uint16_t*>(buffer);
if (useDoubleBuffering)
{
buffer += GUI_FRAME_BUFFER_SIZE;
frameBuffer1 = reinterpret_cast<uint16_t*>(buffer);
}
else
{
frameBuffer1 = 0;
}
if (useAnimationStorage)
{
buffer += GUI_FRAME_BUFFER_SIZE;
frameBuffer2 = reinterpret_cast<uint16_t*>(buffer);
}
else
{
frameBuffer2 = 0;
}
USE_DOUBLE_BUFFERING = useDoubleBuffering;
USE_ANIMATION_STORAGE = useAnimationStorage;
FRAME_BUFFER_WIDTH = GUI_FRAME_BUFFER_WIDTH; //gui_frame_buffer_width is 1024
FRAME_BUFFER_HEIGHT = GUI_FRAME_BUFFER_HEIGHT;
// Make note of whether we are using double buffering.
doubleBufferingEnabled = useDoubleBuffering;
currFbBase = frameBuffer0;
}
as you can see FRAME_BUFFER_WIDTH was changed with GUI_FRAME_BUFFER_WIDTH. GUI_FRAMEBUFFER_WIDTH came from GFXMMU that is (3072/3) 1024. So everything is OK.
the frame buffer was calculated and allocated memory according to 400x400px. But we said to toucghgfx, FRAME_BUFFER_WIDTH is 1024. At that moment i confused.
Depending on code above, do i need allocate extra memory for frame buffer? If no need, how can touchgfx deal with?
Best regards,
Murat
Solved! Go to Solution.
- Labels:
-
STM32L4 Series
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-08 09:24 AM
1 STM32 Chrom-GRCâ„¢ (GFXMMU) introduction The GFXMMU is a graphical oriented memory management unit which aims to optimize the memory usage depending on the display shape. This peripheral allows the microcontroller to store only the visible parts of non-rectangular displays in a contiguous physical memory area, reducing the framebuffer memory footprint. By enabling the framebuffer to be stored in the internal RAM and eliminating the need for external RAM, the GFXMMU provides a highly integrated solution for graphic applications. This peripheral leads to better performance, lower power consumption and lower system cost.
BUT Your question is size of buffer and this is size not width
buffer += GUI_FRAME_BUFFER_SIZE;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-08 09:24 AM
1 STM32 Chrom-GRCâ„¢ (GFXMMU) introduction The GFXMMU is a graphical oriented memory management unit which aims to optimize the memory usage depending on the display shape. This peripheral allows the microcontroller to store only the visible parts of non-rectangular displays in a contiguous physical memory area, reducing the framebuffer memory footprint. By enabling the framebuffer to be stored in the internal RAM and eliminating the need for external RAM, the GFXMMU provides a highly integrated solution for graphic applications. This peripheral leads to better performance, lower power consumption and lower system cost.
BUT Your question is size of buffer and this is size not width
buffer += GUI_FRAME_BUFFER_SIZE;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-10 11:53 PM
Thanks for your reply. I understood better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-11 12:46 AM
Hi MuratUnal,
If this has answered your question, Could you select MM.1's message as "Best Answer" ?
/Romain