Is there a way to reset an RMT channel if the buffer has been filled?

Ravenholem
Posts: 19
Joined: Wed Nov 10, 2021 7:13 pm

Re: Is there a way to reset an RMT channel if the buffer has been filled?

Postby Ravenholem » Sun Aug 13, 2023 1:56 am

jhnlmn wrote:
Wed Mar 03, 2021 4:41 am
I found that changing conf0.idle_thres will make RMT on my ESP32-D0WD-V3 leave Wait state and resume RX.

uint32_t status = RMT.status_ch[RMT_CHANNEL_0];
int state = (status >> RMT_STATE_CH0_S) & RMT_STATE_CH0_V;
if(state == 4) { //4 is "Wait" state
ESP_LOGI(TAG, "rmt status %x", RMT.status_ch[RMT_CHANNEL_0]);
rmt_ll_enable_rx(&RMT, RMT_CHANNEL_0, false);
rmt_ll_reset_rx_pointer(&RMT, RMT_CHANNEL_0);
int idle_thres = RMT.conf_ch[RMT_CHANNEL_0].conf0.idle_thres;
RMT.conf_ch[RMT_CHANNEL_0].conf0.idle_thres = 0;
RMT.conf_ch[RMT_CHANNEL_0].conf0.idle_thres = idle_thres;
rmt_ll_enable_rx(&RMT, RMT_CHANNEL_0, true);
ESP_LOGI(TAG, "rmt status %x", RMT.status_ch[RMT_CHANNEL_0]);
}
This prints
I (68103) PWM: rmt status 14000040
I (68113) PWM: rmt status 1
I know this is old, but my god this was helpful. I have been beating my head against a wall on this problem for about 2-3 days. Everything I would think should get it out of the wait state would fail.
I just can't figure out if this a design flaw or something is missing we don't know or have access to.

Who is online

Users browsing this forum: No registered users and 124 guests