2023-07-02 04:44 AM
Hi All, I'm using an STM32F1 with a 240x240 LCD screen that comunicates with the micro by SPI (with DMA). The screen uses the ST7789 driver (I supose it is not important). I'm working with RGB565 color format.
The problem that I have is, for example, when I'm using the ST7789_Fill_Color(YELLOW); the SPI uses the DMA and the LCD shoul be yellow but it's not. If yellow is 0b1111 1111 1110 0000 the DMA only sends to SPI the LSB (0b0000 0000 1110 0000) witch is a wrong color.
When I do the same without DMA it work's fine!
The DMA is configures this way:
I tried every configuration possible but nothing works. My question is why the DMA only graps the first byte of a color and what I have to change in order to send the real color.
Thanks in advance!!!
Solved! Go to Solution.
2023-07-02 11:53 AM - edited 2023-07-02 11:54 AM
Sorry for wasting your time. I found the problem. It is not the DMA fault. The problem is with the library of the LCD.
Thanks all for the help!!
2023-07-02 05:40 AM
Hi.
Is your spi peripheral configured correctly?
Do you see any DMA error?
Could you share code?
2023-07-02 06:02 AM
2023-07-02 06:10 AM
As i can see the spi is configured as 8 bit data size and your dma is 16bits.
Make spi 16 bits and see if it works.
Maybe sharing inside of the function st7768_writedata would help much better.
2023-07-02 07:01 AM
you didnt set memory increment - so dma just doing 1 transfer . not very useful...
check "memory" !
2023-07-02 10:23 AM
Initially I had it marked. I have been doing tests and it stayed unchecked. But the same thing happens.
2023-07-02 10:26 AM
Initially the DMA was configured at 8 bit but doing tests I changed It. The st7769_witedata():
2023-07-02 11:01 AM
How is "disp_buf" declared? You may need to use "&" when calling ST7789_Write_Date ... like :
ST7789_Write_Date(&disp_buf,...
2023-07-02 11:53 AM - edited 2023-07-02 11:54 AM
Sorry for wasting your time. I found the problem. It is not the DMA fault. The problem is with the library of the LCD.
Thanks all for the help!!
2023-07-18 05:38 AM
Hello @BTurc.2 .
I'm having the same problem as you. And I'm thinking it's the ST7789 library because everything else in my code is correct or as in the example. So you changed the library?
Would it be possible for you to send me your library? Or would it be possible to send me a github link?