px4io_serial: ensure TX DMA is stopped if exiting early on stream error

- otherwise the next retry can happen quickly enough that dma setup
hangs waiting for the stream
This commit is contained in:
Daniel Agar 2021-08-30 20:59:49 -04:00 committed by Lorenz Meier
parent 6cb0259b79
commit 7925787f62
2 changed files with 4 additions and 0 deletions

View File

@ -328,6 +328,8 @@ ArchPX4IOSerial::_bus_exchange(IOPacket *_packet)
if (ret == OK) {
/* check for DMA errors */
if (_rx_dma_status & DMA_STATUS_TEIF) {
// stream transfer error, ensure TX DMA is also stopped before exiting early
stm32_dmastop(_tx_dma);
perf_count(_pc_dmaerrs);
ret = -EIO;
break;

View File

@ -373,6 +373,8 @@ ArchPX4IOSerial::_bus_exchange(IOPacket *_packet)
if (ret == OK) {
/* check for DMA errors */
if (_rx_dma_status & DMA_STATUS_TEIF) {
// stream transfer error, ensure TX DMA is also stopped before exiting early
stm32_dmastop(_tx_dma);
perf_count(_pc_dmaerrs);
ret = -EIO;
break;