cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5 SPI with GPDMA: Unable to transmit more than ~1024 bytes

rutaz
Associate

(HAL_SPI_Transmit_DMA works partially, HAL_DMA_Start_IT not working)

I’m working with an STM32U5 MCU using SPI3 with GPDMA to drive an ILI9341 display. I’m trying to transmit a larger buffer (~23040 bytes), but display only receives about 1024 bytes, and goes into HAL_SPI_STATE_BUSY_TX forever.

Function used: HAL_SPI_Transmit_DMA()

Configs:

spi_settings.png

gpdma_settings.png

 

Thanks in advance !

1 REPLY 1
SMSAD.1
ST Employee

Hello rutaz

Please verify the following three points to identify the root cause:

  1. Test a smaller, but greater than 1024, length (for example, 4096 bytes).
    • If the transfer always stops at approximately 1024 bytes, this suggests a configuration limit, such as burst, width, or interrupt settings.
  2. Check the remaining items count (BNDTR or CBR1, depending on the sub-family).
    • If the value is zero, the DMA considers the transfer complete, but the interrupt or callback is not executed.
    • If the value is nonzero, the DMA is stuck during the transfer, which indicates a configuration or overrun issue.
  3. Temporarily enable DMA error interrupts and add breakpoints in the HAL_DMA_ErrorCallback() function.

Best regards