DMA failure

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

Moderators: barthess, RoccoMarco

josesimoes
Posts: 45
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 21 times
Been thanked: 10 times

DMA failure

Postby josesimoes » Sat May 05, 2018 6:10 pm

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: 10947
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 339 times
Been thanked: 280 times
Contact:

Re: DMA failure

Postby Giovanni » Sat May 05, 2018 7:00 pm

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: 45
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 21 times
Been thanked: 10 times

Re: DMA failure

Postby josesimoes » Wed May 09, 2018 9:30 am

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: 10947
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 339 times
Been thanked: 280 times
Contact:

Re: DMA failure

Postby Giovanni » Wed May 09, 2018 9:45 am

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 2 guests