cancel
Showing results for 
Search instead for 
Did you mean: 

ST7789 spi dma library

Bicer
Associate II

Hi guys,

I want to do a dma with HAL library for a 1.3 inch st7798 driver display (uses stm32l476rg mcu)

https://github.com/Floyd-Fish/ST7789-STM32

I used the library in it works fine. but I want the screen to run faster (no scans should appear on the screen).

I made some changes in the st7789 library:

I set dma for spi2 from cube mx

I changed the HAL_SPI_Transmit() functions to HAL_SPI_Transmit_DMA() in the st7789.c file. Data was sent from dma, but there is a shift and color problem in the image on the screen. How can I solve this problem? thanks.

2 REPLIES 2
Gde S.3
Associate II

Hello!! I'm having the same issue, did you found any fix?

Dadigno
Associate II

Hi @Bicer  @Gde S.3 , this post might be a bit older, but I think it could still be helpful for others.

Have you verified that the SPI transfer rate is the maximum supported by the driver (15 MHz)? Using DMA will not significantly improve performance because the same (slow) communication bus is still being used, that is the bottleneck.

Regarding DMA, I using the middleware provided by MX and I have to put this two line at the and of ST7789V_Init() to reverse color.

// Display inversion ON
reg = ST7789V_DINVON;
ret += st7789v_write_reg(&pObj->Ctx, &reg, 1);

 

Otherwise color shifting can indicate a byte alignment issue during transmission. 

 

Reminder: In RGB565 format, each pixel is composed of 2 bytes (5 bits red, 6 bits green, 5 bits blue). Ensure the correct order of these bits for accurate color representation.

 

Regards