Skip to main content
Visitor II
November 28, 2021
Question

ST7789 spi dma library

  • November 28, 2021
  • 2 replies
  • 5934 views

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.

    This topic has been closed for replies.

    2 replies

    Visitor II
    February 24, 2023

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

    Graduate
    June 28, 2024

    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

    Graduate
    July 21, 2024

    Hi, What do you recommend to use to improve the speed of transfer so that no scans appear? I have used the max SPI transfer rate but its still too slow or I am missing something?

    Graduate
    July 23, 2024

    Hi @Sarim-Jalil 

    It's likely that you're not doing anything wrong, the SPI is just slow by nature. You can perform a signal check using a logic analyzer to see if the data is being transferred without interruptions.