Wie man ESP32 rmt behebt: rmt_transmit(476): channel not in enable state

Wenn Sie den folgenden Fehler während eines rmt_transmit()-Aufrufs erhalten:

esp32_rmt_fix.txt
rmt: rmt_transmit(476): channel not in enable state

rufen Sie

rmt_enable_fix.cpp
ESP_ERROR_CHECK(rmt_enable(channel));

nach dem Aufruf von rmt_new_tx_channel() auf.

Vollständiges Initialisierungsbeispiel

rmt_full_init_example.cpp
rmt_channel_handle_t channel;
rmt_tx_channel_config_t tx_chan_config = {
    .gpio_num = GPIO_NUM_19,          // GPIO number
    .clk_src = RMT_CLK_SRC_DEFAULT,   // select source clock
    .resolution_hz = 1 * 1000 * 1000, // 1 MHz resolution
    .mem_block_symbols = 64,          // memory block size, 64 * 4 = 256 Bytes
    .trans_queue_depth = 1,           // set the number of transactions that can pend in the background
};
ESP_ERROR_CHECK(rmt_new_tx_channel(&tx_chan_config, &channel));
ESP_ERROR_CHECK(rmt_enable(channel));

Check out similar posts by category: ESP8266/ESP32