espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.54k stars 7.39k forks source link

esp32 board 3.0.0-alpha2: The legacy RMT driver is deprecated #8780

Closed chlordk closed 1 year ago

chlordk commented 1 year ago

Board

ESP32C3 Dev Module

Device Description

https://github.com/01Space/ESP32-C3-0.42LCD/blob/main/README.md ESP32-C3-0 42LCD

Hardware Configuration

No

Version

latest development Release Candidate (RC-X)

IDE Name

Arduino IDE 2.2.1

Operating System

Linux Mint 21.1

Flash frequency

80MHz

PSRAM enabled

yes

Upload speed

921600

Description

My goal is to get the ws2812 LED to lit up.

I'm testing with File -> Examples -> WS2812FX -> auto_mode_cycle.

Installing latest Board "esp32 by Espressif Systems" version 3.0.0-alpha2 I get the error:

In file included from /home/joe/Arduino/libraries/Adafruit_NeoPixel/esp.c:23: /home/joe/.arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.1-6b1f40b9bf/esp32c3/include/driver/deprecated/driver/rmt.h:18:2 18 | #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h"

When running the code (anyway, despite the warning) I got a core-dump in the serial monitor.

I tried to change the file Arduino/libraries/Adafruit_NeoPixel/esp.c from:

include "driver/rmt.h"

to

include "driver/rmt-tx.h"

without luck.

Work around

Downgrade board to "esp32 by Espressif Systems 2.0.14" and it is working.

Sketch

// ws2812fx/auto_mode_cycle.ino
#include <WS2812FX.h>

#define LED_COUNT 1
#define LED_PIN 2

#define TIMER_MS 5000

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
…  now = millis();

  ws2812fx.service();

  if(now - last_change > TIMER_MS) {
    ws2812fx.setMode((ws2812fx.getMode() + 1) % ws2812fx.getModeCount());
    last_change = now;
  }
}

Debug Message

In file included from /home/joe/Arduino/libraries/Adafruit_NeoPixel/esp.c:23:
/home/joe/.arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.1-6b1f40b9bf/esp32c3/include/driver/deprecated/driver/rmt.h:18:2: warning: #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h" [-Wcpp]
   18 | #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h"

Other Steps to Reproduce

Downgrade board to "esp32 by Espressif Systems 2.0.14" and it is working.

I have checked existing issues, online documentation and the Troubleshooting Guide

me-no-dev commented 1 year ago
  1. You are reporting about ESP-IDF API that we have no control of.
  2. Changing major versions does permit change of API
  3. I am closing this as non-issue, due to the above reasons.
  4. Contact the library maintainer to add support for IDF 5.1 or better yet, to use Arduino's APIs, which generally stay more stable.
chlordk commented 1 year ago
  1. You are reporting about ESP-IDF API that we have no control of.

I might have been misunderstanding what the reason why I got the error. Let me emphasize:

"esp32 by Espressif Systems 3.0.0-alpha2" is NOT working.

"esp32 by Espressif Systems 2.0.14" is working.

me-no-dev commented 1 year ago

3.0.0 is a major version above 2.0.14, so change of API is permitted. At the same time, 2.0.14 is based on ESP-IDF 4.4 and 3.0.0 is based on ESP-IDF 5.1, again major versions that allow for API changes. What you got is normal and is up to the library maintainers to adjust.

619-Dave commented 4 months ago

Hi Vojtech. Were you able to fix the compatibility problems with ESP32-C3 RMT and other compile warnings? Can you help me get it working on my end? Thank you!

VojtechBartoska commented 4 months ago

Hello @619-Dave, take a look on a Migration Guide, there is explanation of RMT driver changes: https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html#rmt

619-Dave commented 4 months ago

Looking it ALL over. Thank you. I compile successfully now on both Arduino IDE and platform io. At run time in the arduino monitor I see the board keeps resetting with error E (170) rmt(legacy): CONFLICT! driver_ng is not allowed to be used with the legacy driver. (not able to get serial communications working yet on platform io terminal) Have to have this project up and running by Thanksgiving as it is for a Christmas Display all the kids look for.

DKasle commented 2 months ago

I am seeing a similar issue (possibly the same issue) while running some test code with IDE v 2.3.2, esp32 v 3.0.0, FastLED v 3.7.1 running on a windows 11 PC with a UM Tiny S3 microcontroller. The test code compiles and uploads successfully, but I get this runtime error:

E (88) rmt(legacy): CONFLICT! driver_ng is not allowed to be used with the legacy driver

abort() was called at PC 0x420075a7 on core 0**_

Here is the code:

include

include

include

include "Arduino.h"

include "math.h"

include

include

/ Rui Santos Complete project details at https://randomnerdtutorials.com
/

TaskHandle_t Task1; TaskHandle_t Task2;

// LED pins const int led1 = 2; const int led2 = 4;

void setup() { Serial.begin(115200); pinMode(led1, OUTPUT); pinMode(led2, OUTPUT);

//create a task that will be executed in the Task1code() function, with priority 1 and executed on core 0 xTaskCreatePinnedToCore( Task1code, / Task function. / "Task1", / name of task. / 10000, / Stack size of task / NULL, / parameter of the task / 1, / priority of the task / &Task1, / Task handle to keep track of created task / 0); / pin task to core 0 /
delay(500);

//create a task that will be executed in the Task2code() function, with priority 1 and executed on core 1 xTaskCreatePinnedToCore( Task2code, / Task function. / "Task2", / name of task. / 10000, / Stack size of task / NULL, / parameter of the task / 1, / priority of the task / &Task2, / Task handle to keep track of created task / 1); / pin task to core 1 / delay(500); }

//Task1code: blinks an LED every 500 ms void Task1code( void * pvParameters ){ Serial.print("Task1 running on core "); Serial.println(xPortGetCoreID());

for(;;){ digitalWrite(led1, HIGH); delay(500); digitalWrite(led1, LOW); delay(500); } }

//Task2code: blinks an LED every 700 ms void Task2code( void * pvParameters ){ Serial.print("Task2 running on core "); Serial.println(xPortGetCoreID());

for(;;){ digitalWrite(led2, HIGH); delay(700); digitalWrite(led2, LOW); delay(700); } }

void loop() {

}

When I comment out the first line of the test code above that includes the FastLED library, the program runs successfully. Unfortunately I need to use the FastLED library for my current project. Any suggestions on how to fix this error? Thanks!