cancel
Showing results for 
Search instead for 
Did you mean: 

FrameBuffer corrupted (shifted horizontally to the bottom, and the part exceeding appears on top (the frame buffer rotated??) with STM32L4P5

Gasparini Gabriele
Associate

 I need assistance on a problem that we’ve been facing several weeks so far.

I state that I do not use freeRTOS and I have a main function with an infinite while where every cycle calls:

- MX_TouchGFX_Process() always called

- When the screen must be redrawn a variable is set from the following function:

void TouchGFXHAL::flushFrameBuffer(const touchgfx::Rect& rect)

which activates this call sequence:

if((BSP_LCD_GetXSize(0, &sizex) != BSP_ERROR_NONE) || (BSP_LCD_GetYSize(0, &sizey) != BSP_ERROR_NONE))

{

Error_Handler();

}

if(BSP_LCD_SetDisplayWindow(0, 0, 0, sizex, sizey)!= BSP_ERROR_NONE)

{

Error_Handler();

}

if(BSP_LCD_FillRGBRect(0, 0, 0, frameBuffer, sizex, sizey) != BSP_ERROR_NONE)

{

Error_Handler();

}

- every 20 ms (when DMA completes the image transfer to the LCD controller) the following sequence call is executed:

HAL::getInstance()->vSync();

OSWrappers::signalVSync();

OSWrappers::giveFrameBufferSemaphore();

OSWrappers::giveFrameBufferSemaphoreFromISR();

  

This procedure correctly works, and the screen is correctly displayed, generated by TouchGFX.

When I now add some global variables in my source code, as the application is run, the first image displayed is immediately wrong: it is shifted horizontally to the bottom, and the part exceeding appears on top (the frame buffer rotated??)

Please note that the global variable that is changed has nothing to do with the display and it’s not used as the application starts. It’s an array of struct that I increase from 2 elements to 3 or more.

I state that the main cycle calls nothing but TouchGFX functions, and global variables are not used yet when the problem appears (immediately when the display is first drawn)

  

This is my configuration

  

- STM32CubeIDE 1.9.0

- TouchGFX 4.19.0

- STM32L4P5ZETX

- FLASH SPI 8 Mbytes per immagini TouchGFX

- DISPLAY 320x240 16 Bit (RGB565)

  

Have you got any clue on this problem?

1 REPLY 1
MM..1
Chief II

Hi you dont write how interface you use for LCD but my tip SPI. Then your code

if(BSP_LCD_SetDisplayWindow(0, 0, 0, sizex, sizey)!= BSP_ERROR_NONE)
{
Error_Handler();
}

set window start always from 0,0 and change only size = this cant work good.