Page 1 of 1

DMA failure

Posted: Sat May 05, 2018 6:10 pm
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!

Re: DMA failure

Posted: Sat May 05, 2018 7:00 pm
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

Re: DMA failure

Posted: Wed May 09, 2018 9:30 am
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?!

Re: DMA failure

Posted: Wed May 09, 2018 9:45 am
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