DMA failure

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

DMA failure

Post by josesimoes »

Hi,

I'm getting random DMA failures.
The error message is general. I was wondering what would be the best way to understand what is the root cause.
Any hints or debug strategies anyone can suggest?

Thanks in advance!
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: DMA failure

Post by Giovanni »

Hi,

This could be caused by DMA trying to access an unmapped memory area or do unaligned accesses. A more remote possibility is bandwidth saturation or the memory bus.

Look at the stack trace and look where the problem is detected, it should be a DMA ISR in a driver.

Giovanni
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: DMA failure

Post by josesimoes »

Following your suggestion I've traced this down to spi_lld_serve_rx_interrupt.
If the error hook is define it goes into that if statement there because the STM32_DMA_ISR_TEIF is set.
A couple of questions:
1) despite the flag being set, I don't actually see any error in the SPI tx because this an LCD output and everything is showing as expected
2) this is still occurring randomly
3) I'm only doing tx operations why is that the rx ISR is being called?!
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: DMA failure

Post by Giovanni »

The SPI always transmits and receives at same time even if you don't use the received bytes, the RX DMA interrupt is used to detect the end of the operation. It should not fail, I would inspect into the possible reasons for TEIF to be set on the STM32 RM.

Giovanni
Post Reply