From 092aa00be40a65c7437ad6092e9db74fd2487ad6 Mon Sep 17 00:00:00 2001 From: Chen Jichang Date: Tue, 16 Sep 2025 15:20:22 +0800 Subject: [PATCH] fix(rmt): fix the regression from gdma link refactor --- components/esp_driver_rmt/src/rmt_encoder_bs.c | 2 ++ components/esp_driver_rmt/src/rmt_encoder_bytes.c | 2 ++ components/esp_driver_rmt/src/rmt_encoder_copy.c | 2 ++ components/esp_driver_rmt/src/rmt_encoder_simple.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/components/esp_driver_rmt/src/rmt_encoder_bs.c b/components/esp_driver_rmt/src/rmt_encoder_bs.c index 9aa8769ac4..cb35de78fe 100644 --- a/components/esp_driver_rmt/src/rmt_encoder_bs.c +++ b/components/esp_driver_rmt/src/rmt_encoder_bs.c @@ -73,6 +73,7 @@ static size_t rmt_encode_bs(rmt_encoder_t *encoder, rmt_channel_handle_t channel // cross line, means desc0 has prepared with sufficient data buffer if (dma_lli0_index != dma_lli1_index) { gdma_link_set_owner(tx_chan->dma_link, dma_lli0_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli0_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); } if (encoding_truncated) { @@ -94,6 +95,7 @@ static size_t rmt_encode_bs(rmt_encoder_t *encoder, rmt_channel_handle_t channel // reset offset pointer when exceeds maximum range if (tx_chan->mem_off_bytes >= tx_chan->ping_pong_symbols * 2 * sizeof(rmt_symbol_word_t)) { gdma_link_set_owner(tx_chan->dma_link, dma_lli1_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli1_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); tx_chan->mem_off_bytes = 0; } diff --git a/components/esp_driver_rmt/src/rmt_encoder_bytes.c b/components/esp_driver_rmt/src/rmt_encoder_bytes.c index 9d238af856..fda984bcfa 100644 --- a/components/esp_driver_rmt/src/rmt_encoder_bytes.c +++ b/components/esp_driver_rmt/src/rmt_encoder_bytes.c @@ -104,6 +104,7 @@ static size_t rmt_encode_bytes(rmt_encoder_t *encoder, rmt_channel_handle_t chan // cross line, means desc0 has prepared with sufficient data buffer if (dma_lli0_index != dma_lli1_index) { gdma_link_set_owner(tx_chan->dma_link, dma_lli0_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli0_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); } } #endif // SOC_RMT_SUPPORT_DMA @@ -129,6 +130,7 @@ static size_t rmt_encode_bytes(rmt_encoder_t *encoder, rmt_channel_handle_t chan #if SOC_RMT_SUPPORT_DMA if (channel->dma_chan) { gdma_link_set_owner(tx_chan->dma_link, dma_lli1_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli1_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); } #endif // SOC_RMT_SUPPORT_DMA tx_chan->mem_off_bytes = 0; diff --git a/components/esp_driver_rmt/src/rmt_encoder_copy.c b/components/esp_driver_rmt/src/rmt_encoder_copy.c index 08ed3b3a9a..3096ca5e66 100644 --- a/components/esp_driver_rmt/src/rmt_encoder_copy.c +++ b/components/esp_driver_rmt/src/rmt_encoder_copy.c @@ -78,6 +78,7 @@ static size_t rmt_encode_copy(rmt_encoder_t *encoder, rmt_channel_handle_t chann // cross line, means desc0 has prepared with sufficient data buffer if (dma_lli0_index != dma_lli1_index) { gdma_link_set_owner(tx_chan->dma_link, dma_lli0_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli0_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); } } #endif // SOC_RMT_SUPPORT_DMA @@ -101,6 +102,7 @@ static size_t rmt_encode_copy(rmt_encoder_t *encoder, rmt_channel_handle_t chann #if SOC_RMT_SUPPORT_DMA if (channel->dma_chan) { gdma_link_set_owner(tx_chan->dma_link, dma_lli1_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli1_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); } #endif // SOC_RMT_SUPPORT_DMA tx_chan->mem_off_bytes = 0; diff --git a/components/esp_driver_rmt/src/rmt_encoder_simple.c b/components/esp_driver_rmt/src/rmt_encoder_simple.c index 9a1f7ba609..50adcd7837 100644 --- a/components/esp_driver_rmt/src/rmt_encoder_simple.c +++ b/components/esp_driver_rmt/src/rmt_encoder_simple.c @@ -145,6 +145,7 @@ static size_t rmt_encode_simple(rmt_encoder_t *encoder, rmt_channel_handle_t cha // cross line, means desc0 has prepared with sufficient data buffer if (dma_lli0_index != dma_lli1_index) { gdma_link_set_owner(tx_chan->dma_link, dma_lli0_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli0_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); } } #endif // SOC_RMT_SUPPORT_DMA @@ -164,6 +165,7 @@ static size_t rmt_encode_simple(rmt_encoder_t *encoder, rmt_channel_handle_t cha #if SOC_RMT_SUPPORT_DMA if (channel->dma_chan) { gdma_link_set_owner(tx_chan->dma_link, dma_lli1_index, GDMA_LLI_OWNER_DMA); + gdma_link_set_length(tx_chan->dma_link, dma_lli1_index, tx_chan->ping_pong_symbols * sizeof(rmt_symbol_word_t)); } #endif // SOC_RMT_SUPPORT_DMA tx_chan->mem_off_bytes = 0;