espressif / arduino-esp32

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

cores/esp32/esp32-hal-uart.c error: 'uart_config_t' has no member named 'flags' #10569

Open TroyMitchell911 opened 9 hours ago

TroyMitchell911 commented 9 hours ago

Board

self board based on ESP32C3

Device Description

myself board

Hardware Configuration

Nope

Version

latest master (checkout manually)

IDE Name

Clion

Operating System

Ubuntu22.04

Flash frequency

24M

PSRAM enabled

no

Upload speed

115200

Description

I run the following command to add the component:

❯ idf.py add-dependency "espressif/arduino-esp32^3.0.7"
Executing action: add-dependencyif/arduino-esp32^3.0.7"
Created "/home/troy/mcu/esp/arduino-prj/sshd/main/idf_component.yml"
NOTICE: Skipping optional dependency: espressif/rmaker_common
NOTICE: Skipping optional dependency: espressif/qrcode
NOTICE: Skipping optional dependency: espressif/esp_rainmaker
NOTICE: Skipping optional dependency: espressif/esp_insights
NOTICE: Skipping optional dependency: espressif/esp-zigbee-lib
NOTICE: Skipping optional dependency: espressif/esp-zboss-lib
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp-dsp
Successfully added dependency "espressif/arduino-esp32^3.0.7" to component "main"
Done

and when I try to build it, I get error:

/home/troy/mcu/esp/arduino-prj/sshd/managed_components/espressif__arduino-esp32/cores/esp32/esp32-hal-uart.c: In function 'uartBegin':
/home/troy/mcu/esp/arduino-prj/sshd/managed_components/espressif__arduino-esp32/cores/esp32/esp32-hal-uart.c:501:14: error: 'uart_config_t' has no member named 'flags'
  501 |   uart_config.flags.backup_before_sleep = false;  // new flag from IDF v5.3

I know deleting this line can fix the error, but isn't the one I added the latest version? I checked this version I didn't find this line of code in the source code. Can anyone provide some clues? I'd appreciate it.

btw, I try to create a project from arduino example, but same:

idf.py create-project-from-example "espressif/arduino-esp32^3.0.7:hello_world"

Sketch

#include "Arduino.h"

void setup() {
  Serial.begin(115200);
}

void loop() {
  Serial.println("Hello world!");
  delay(1000);
}

Debug Message

Nope

Other Steps to Reproduce

No response

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

TroyMitchell911 commented 9 hours ago

esp idf v5.3

SuGlider commented 9 hours ago

Please use Arduino Core 3.1.0 in order to use IDF 5.3. It shall be cloned from release/v3.1.x branch. https://github.com/espressif/arduino-esp32/tree/release/v3.1.x

The Master branch is the Arduino Core 3.0.x based on IDF 5.1.

This information about which Arduino Core version uses which IDF version can be viewed in the release notes

TroyMitchell911 commented 9 hours ago

Please use Arduino Core 3.1.0 in order to use IDF 5.3. It shall be cloned from release/v3.1.x branch. https://github.com/espressif/arduino-esp32/tree/release/v3.1.x

The Master branch is the Arduino Core 3.0.x based on IDF 5.1.

This information about which Arduino Core version uses which IDF version can be viewed in the release notes

are u sure? I download this and I find same code:

uart_config.flags.backup_before_sleep = false;  // new flag from IDF v5.3

and release/v3.1.x too! link here: https://github.com/espressif/arduino-esp32/blob/de93e6e176b63973ee7f334b57924972aa4cc3b7/cores/esp32/esp32-hal-uart.c#L513

TroyMitchell911 commented 8 hours ago

Please use Arduino Core 3.1.0 in order to use IDF 5.3. It shall be cloned from release/v3.1.x branch. https://github.com/espressif/arduino-esp32/tree/release/v3.1.x The Master branch is the Arduino Core 3.0.x based on IDF 5.1. This information about which Arduino Core version uses which IDF version can be viewed in the release notes

are u sure? I download this and I find same code:

uart_config.flags.backup_before_sleep = false;  // new flag from IDF v5.3

and release/v3.1.x too! link here:

https://github.com/espressif/arduino-esp32/blob/de93e6e176b63973ee7f334b57924972aa4cc3b7/cores/esp32/esp32-hal-uart.c#L513

oops, I see a flag member here: https://github.com/espressif/esp-idf/blob/a0f798cfc4bbd624aab52b2c194d219e242d80c1/components/esp_driver_uart/include/driver/uart.h#L53

but in my espidf-5.3, the member does not exist. I remember I do download espidf-5.3 months ago.. maybe it's preview that I download? how to make sure idf version?

SuGlider commented 7 hours ago

how to make sure idf version?

idf.py --version will tell the exact IDF version that is being used. In https://github.com/espressif/esp-idf/releases/tag/v5.3 there is some instructions about how to clone IDF 5.3, if necessary.