← index #6257PR #7991
Related · high · value 0.087
QUERY · ISSUE

STM32H7 SPI6 not working with DMA

openby rcordeauopened 2020-07-19updated 2026-01-14
port-stm32

Hi,
I was trying this out on a custom board as well as the Nucleo STM32H743SZI board, and while SPI3 works when sending multiple bytes (default behavior when sending more than 1 byte seems to be to use DMA per spi.c), when it comes to SPI6, it uses a different DMA engine (DMA2) and goes through a mux BDMA_REQUEST_SPI6_TX/RX. I keep getting a ETIMEDOUT error due to waiting for the interrupt to come back from the DMA transaction. Any advice, or could this be a bug?

Thanks,
Rob

CANDIDATE · PULL REQUEST

stm32: fix bug with disabling of DMA2 in CYW43 SDIO driver

mergedby dpgeorgeopened 2021-11-15updated 2021-11-22
port-stm32

On PYBD-SF6 it's possible to trigger a bug in the existing code by turning on WLAN and connecting to an AP, pinging the IP address from a PC and running the following code on the PYBD:

def spi_test(s):
    while 1:
        s.write('test')
        s.read(4)

spi_test(machine.SPI(1,100000000))

This will eventually fail with OSError: [Errno 110] ETIMEDOUT because DMA2 was turned off by the CYW43 driver during the SPI1 transfer.

This PR fixes the bug by removing the code that explicitly disables DMA2. Instead DMA2 will be automatically disabled after an inactivity timeout, see commit a96afae90f6e5d693173382561d06e583b0b5fa5

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied