2025-04-09 10:06 AM - last edited on 2025-04-09 10:09 AM by Andrew Neil
Hi everybody,
I training today to the screen qith the driver ILI9341.
I use a library find the net.If i use the SPI in normal mode (pooling) everyhting it's ok.
But the time to fill is very long ( like 2 second aprox.). SO i would like use the DMA to see if I can increse the speed to speak with my screen.
But it's don't work.
In the library ili9341.h i have this line
#define ILI9341_SPI_PORT hspi2
extern SPI_HandleTypeDef ILI9341_SPI_PORT;
so I comment the previous lin and i have add
#define ILI9341_SPI_PORT2 hdma_spi2_tx
extern DMA_HandleTypeDef ILI9341_SPI_PORT2;
So now in the ili9341.c file.
I have comment all the line with _HAL_SPI_Transmit like this ( only 3 lines) :
HAL_SPI_Transmit(&ILI9341_SPI_PORT, &cmd, sizeof(cmd), HAL_MAX_DELAY);
and replace By this line
HAL_SPI_Transmit_DMA(&ILI9341_SPI_PORT2, &cmd, sizeof(cmd));
Do you know how I should replace the file to switch from pooling mode to DMA mode?
Thank you
2025-04-10 2:33 AM
Hello @JJoao.1,
Make sure that the DMA is properly configured in your project. This includes setting up the DMA channel.
May this wiki Getting started with SPI - stm32mcu can help you and precisely section 2.3.2.3. NVIC and DMA settings.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-04-10 7:41 AM
Hello @JJoao.1 ,
We have an ST driver for the ILI9341 LCD controller available on our GitHub repository. You can find it here.
Additionally, we already have an BSP example that integrates this LCD component on the STM32F429I-Discovery Board. This example might be helpful for resolving the issue you are facing.
Best regards,