diff --git a/components/esp_hw_support/dma/dma2d.c b/components/esp_hw_support/dma/dma2d.c index 6c91656094..86666610a1 100644 --- a/components/esp_hw_support/dma/dma2d.c +++ b/components/esp_hw_support/dma/dma2d.c @@ -967,12 +967,14 @@ esp_err_t dma2d_force_end(dma2d_trans_t *trans, bool *need_yield) dma2d_group_t *group = trans->rx_chan->group; bool in_flight = false; - // We judge whether the transaction is in-flight by checking the RX channel it uses is in-use or free + // We judge whether the transaction is in-flight by checking the RX channel it uses is being occupied or free portENTER_CRITICAL_SAFE(&group->spinlock); if (!(group->rx_channel_free_mask & (1 << trans->rx_chan->channel_id))) { in_flight = true; dma2d_ll_rx_enable_interrupt(group->hal.dev, trans->rx_chan->channel_id, UINT32_MAX, false); - assert(!dma2d_ll_rx_is_fsm_idle(group->hal.dev, trans->rx_chan->channel_id)); + // DMA consumer could generate an error in both cases: + // 1. when TX or RX is transferring data (channel not in idle state) + // 2. TX successfully passed data to the module, but module cannot process the data, so RX has no data to delivery (RX channel in idle state) } portEXIT_CRITICAL_SAFE(&group->spinlock); ESP_RETURN_ON_FALSE_ISR(in_flight, ESP_ERR_INVALID_STATE, TAG, "transaction not in-flight");