Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error with Arduino ESP32 release 2.0.8 #601

Closed
tueddy opened this issue Apr 23, 2023 · 5 comments
Closed

Compile error with Arduino ESP32 release 2.0.8 #601

tueddy opened this issue Apr 23, 2023 · 5 comments

Comments

@tueddy
Copy link

tueddy commented Apr 23, 2023

Hi,

with the new Arduino ESP32 release 2.0.8 this library does not longer compiles due to using __FlashStringHelper

For reference see
espressif/arduino-esp32#8108
espressif/arduino-esp32#7941

Any way to get arround this bug (feature)?

@dok-net
Copy link

dok-net commented Apr 23, 2023

Any way to get arround this bug (feature)?

Yes: espressif/arduino-esp32#8111

@paulocoutinhox
Copy link

Hi,

I have the same problem:
https://forum.arduino.cc/t/macro-f-error/1118126/8

The implementation of the F() macro was changed in ESP32 core version 2.0.8.
It is now

#define F(string_literal) (string_literal)
instead of casting to const __FlashStrinHelper *.
This breaks use cases like

const __FlashStringHelper *MFRC522::GetStatusCodeName(MFRC522::StatusCode code  ///< One of the StatusCode enums.
                                        ) {
    switch (code) {
        case STATUS_OK:             return F("Success.");
        case STATUS_ERROR:          return F("Error in communication.");
        ...
        default:                    return F("Unknown error");
    }
} // End GetStatusCodeName()

Until the solution, downgrade to ESP32 core 2.0.7.

@tueddy
Copy link
Author

tueddy commented Apr 29, 2023

Until the problem is solved in this library you can use my fork
https://github.com/tueddy/rfid.git

Or change "__FlashStringHelper " to "char" and remove "F()", see changes here: master...tueddy:rfid:master

@jerryg2003
Copy link

jerryg2003 commented May 3, 2023

Had same problem. Change F(“X”) in “return” statements in MFRC522.cpp to “((__FlashStringHelper *) “X”)” and all works fine with ESP32 2.0.8.

ESP32 team says this will be fixed at their end in 2.0.9.

@tueddy
Copy link
Author

tueddy commented May 23, 2023

Problem is fixed with Arduino 2.0.9 (PlatformIO Package 6.3.0)

@tueddy tueddy closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants