ST7789V issue with DMA
Hello!
I'm using a 320x240 TFT display with ST7789V driver and SPI interface by X-CUBE-DISPLAY.
Pixel transfer works correctly when I use the BSP_LCD_WriteData function. I can also display images and animation using the TouchGFX framework.
However, when I use the BSP_LCD_WriteDataDMA function to perform the same process but with DMA, I encounter an anomalous behavior that I cannot explain.
The code transfers the data successfully and the display show the image during the first execution. Then, on the second execution, the display suddenly turns off, blacking out all pixels, as soon as the BSP_LCD_SetDisplayWindow function is called. Despite this, neither the driver nor the DMA reports any errors.
uint32_t Display_TransferData(uint8_t useDMA, uint8_t * data, uint32_t size)
{
uint8_t * ptr = data;
uint32_t i = 0;
while(i < size)
{
uint32_t n_byte = 65534;
if(size < i+n_byte)
n_byte = size - i;
uint32_t ret;
if(useDMA)
{
ret = BSP_LCD_WriteDataDMA(0, ptr, n_byte);
if(ret)
return ret;
BSP_LCD_WaitForTransferToBeDone(0);
} else
{
ret = BSP_LCD_WriteData(0, ptr, n_byte);
}
ptr += n_byte;
i += n_byte;
}
return 0;
}
Does anyone have any ideas or has anyone experienced similar problems?
