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

[issue with ESP32 core] 1.4.1 compile fails for nano esp32 #53

Open
tomelgato opened this issue Apr 15, 2024 · 11 comments
Open

[issue with ESP32 core] 1.4.1 compile fails for nano esp32 #53

tomelgato opened this issue Apr 15, 2024 · 11 comments

Comments

@tomelgato
Copy link

On PlatformIO with board "arduino_nano_esp32" compile fails:

/Users/tm/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:44:69: error: 'digitalPinToGPIONumber' is not a type
#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode)

@tomelgato tomelgato changed the title 1.4.1 compile problem for nano esp32 1.4.1 compile fails for nano esp32 Apr 15, 2024
@tomelgato
Copy link
Author

[env:arduino_nano_esp32]
platform = espressif32
board = arduino_nano_esp32
framework = arduino

@davetcc
Copy link
Collaborator

davetcc commented Apr 16, 2024

I'm afraid I don't have one of those boards so for now can't fix it. If you can find what's wrong and raise a PR I'm happy to merge.

And you're using PlatformIO too, it seems that PlatformIO ESP32 latest versions are now running into a few issues just like Pico support. I would start by checking for compilation in Arduino IDE before anything else. This is deep in ESP32 core code framework-arduinoespressif32/cores/esp32/io_pin_remap.h.

@tomelgato
Copy link
Author

tomelgato commented Apr 16, 2024

You dont need the board, you just need to set the environment and try to compile. I just included your libs, no more code ;)

out of memory ... the Arduino nano esp33 libs are missing the digitalPinToGPIONumber function, i did read somewhere that a user managed to get it running with a generic esp32 library (on arduino ide)

Edit: this is the mentioned link: https://www.reddit.com/r/arduino/comments/1bl5a66/error_digitalpintogpionumber_was_not_declared_in/

@davetcc
Copy link
Collaborator

davetcc commented Apr 16, 2024

EDIT - see linked issue directly below, and the last comment.

More Arduino incompatibilities unfortunately. If you thought things were a mess in the past, at least then writers of cores tried to keep critical functions that were relied on by libraries, now it seems to be a free for all. I'm not sure it is supportable with that missing. Just to be clear, that is not in code I can do anything about, we are just calling attachInterrupt(pin, function, mode).

@tomelgato
Copy link
Author

See here for a solution:

espressif/arduino-esp32#9150

@tomelgato
Copy link
Author

Other solution could be this:

I tried the IDE Tools option "Pin numbering: By GPIO number (legacy)" and the compilation was OK!

But i dont know if its possible to do in PlatformIO

@tomelgato
Copy link
Author

I didnt post the complete compiler error, the first one is this and then a lot more with the same problem:

Compiling .pio/build/arduino_nano_esp32/lib7f3/SimpleCollections/SCThreadingSupport.cpp.o
Compiling .pio/build/arduino_nano_esp32/lib7f3/SimpleCollections/SimpleCollections.cpp.o
In file included from /Users/tm/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:223,
from .pio/libdeps/arduino_nano_esp32/TaskManagerIO/src/TaskPlatformDeps.h:28,
from .pio/libdeps/arduino_nano_esp32/TaskManagerIO/src/TaskManagerIO.cpp:6:
/Users/tm/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:44:69: error: 'digitalPinToGPIONumber' is not a type
#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode)
^~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/arduino_nano_esp32/TaskManagerIO/src/TaskManagerIO.h:64:18: note: in expansion of macro 'attachInterrupt'
virtual void attachInterrupt(pintype_t pin, RawIntHandler fn, uint8_t mode) = 0;

@tomelgato
Copy link
Author

tomelgato commented Apr 16, 2024

More Arduino incompatibilities unfortunately. If you thought things were a mess in the past, at least then writers of cores tried to keep critical functions that were relied on by libraries, now it seems to be a free for all.

The pin numbering puzzled me some times already. The convention for the ESP using D2 instead of 5 ... dont know if i like it or not. If it would be across all Arduino boards it could be good. Btw. with the FastAccelStepper library as example i had to use the 5 instead of D2 ... so confusion will stay ;)

Pinout_Arduino-Nano-ESP32

@davetcc davetcc changed the title 1.4.1 compile fails for nano esp32 [issue with ESP32 core] 1.4.1 compile fails for nano esp32 Apr 17, 2024
@me-no-dev
Copy link

me-no-dev commented Apr 17, 2024

Hi @tomelgato . I am no platformio fluent, but I know there is a way for you to define additional build flags. If you add the following define to your build env, you should be able to compile with pin remap off: -D BOARD_USES_HW_GPIO_NUMBERS (and use the yellow GPIO numbers from the image above)

@tomelgato
Copy link
Author

@me-no-dev Supercool, thanks a lot. It compiles with that option. Where did you find that info? Even googeling with "BOARD_USES_HW_GPIO_NUMBERS" brings nothing.

@me-no-dev
Copy link

Hi @tomelgato :) Found it in the Arduino board definition (that menu option that allows you to turn it off): https://github.com/espressif/arduino-esp32/blob/master/boards.txt#L35586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants