2024-05-15 12:12 AM
Dear STM32 community
I am trying to setup the ST7735 Display (ST7735) with SPI and DMA for a faster refresh rate. Without DMA everything works fine. When i setting up DMA nothing is displayed on the Display.
My DMA and SPI Settings are:
I want to fill the Screen with black color, for this i use the function fillScreen() from GFX_FUNCTIONS.c. To Transmit the data via DMA i have replaced the old functions in ST7735.c with the DMA Transmit function in ST7735_FillRectangle(), ST7735_WriteCommand() and ST7735_WriteData().
For detail view i have attached the main.c file and the library files from the Display (ST7735.c and GFX_FUNCTIONS.c). I am using a Nucleo-G474RE Boeard with STM32 Version 1.15.1.
I really someone of you guys could help me.
Thanks a lot for your time!
Best regards,
Raphael
Solved! Go to Solution.
2024-05-19 05:33 AM
I guess the issue is where you put in a loop to write the DMA request.. Here you have to wait for first DMA to complete before sending the next request. You need to use HAL_DMA_PollForTransfer() function to check if the previous DMA is complete or not. Alternatively, you need to enable the SPI and DMA interrupt and use void HAL_SPI_TxCpltCallback (SPI_HandleTypeDef * hspi) to write the bytes, but then the logic has to be re-arranged.
2024-05-19 05:33 AM
I guess the issue is where you put in a loop to write the DMA request.. Here you have to wait for first DMA to complete before sending the next request. You need to use HAL_DMA_PollForTransfer() function to check if the previous DMA is complete or not. Alternatively, you need to enable the SPI and DMA interrupt and use void HAL_SPI_TxCpltCallback (SPI_HandleTypeDef * hspi) to write the bytes, but then the logic has to be re-arranged.
2024-05-19 06:25 AM
Seems you completely misunderstand how DMA works and where you read , that one pixel DMA make better refresh rate??? Your DMA code when works after mistakes removed, will slower as original without DMA.
2024-05-19 06:54 AM - edited 2024-05-19 07:14 AM
Hi,
how much time it needs for cls, black screen fill ?
btw.
I tried also to speed it up by using DMA (on H743 cpu, DMA only used for "fill", if more than 4 pix to write, otherwise DMA would be slower than a direct SPI write) , but the St7735 TFT not so happy with my test: at first seems to work fine, but after cold start it had a strange effect: the black was not "really black", it had some strange colored touch, when looking with some angle to the display. So i took again the HAL_SPI write and display full black again.
2024-05-21 12:05 AM
Hi Techn
This helps. I have adapted my code as follows:
Thank you!