-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Core attempts to use GPIO_OUT1_REG and GPIO_IN1_REG on chips that don't have it #5378
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
Comments
In hindsight this seems weird. I remember the 'normal' ESP32 chip having two sets of OUT etc. registers too, for I/Os 0-31 and 32-39 respectively. Per manual page 62 But yet these register definitions don't show up when searching for them here. Weird. I'd love for someone with more technical knownedge on the different ESP32 to weigh in here. |
Are you looking for the upper GPIO OUT register for C3? Since C3 has less than 32 GPIOs defined, it has only one GPIO_OUT_REG (0x0004) or are you looking on how we use those in Arduino? If so, we use them through structs of register addresses, rather than using direct register addresses |
The primary issue here is the compilation failure. I don't want to access the registers myself, I'm concerned that a library using the |
Hardware:
Board: ESP32C3
Core Installation version: latest git (cbcba53)
IDE name: Platform.io
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10 x64
Description:
I am trying to compile an simple test sketch for the Adafruit SSD1306 library for an ESP32C3 board configuration.
I am using PlatformIO to pull the latest PlatformIO core version, then change up some board compilation info to make it compile for the ESP32C3 variant. Compilation is successfull for simple sketches, (e.g., blinky and
Serial.println()
stuff).The Adafruit SSD1306 library, or more specificically its Adafruit Bus IO dependency, makes use of the
portOutputRegister
andportInputRegister
macros for faster I/O access on ESP32 platforms.See here
and here for usage.
The core defines thesse macros as follows
arduino-esp32/cores/esp32/Arduino.h
Lines 106 to 108 in cbcba53
But the
GPIO_OUT1_REG
andGPIO_IN1_REG
are referenced here, that, if one does a code occurance search, is only defined for ESP32S2 chips.arduino-esp32/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/gpio_reg.h
Line 82 in 371f382
So it does not exist for the ESP32C3 chip I am compiling for. Yet, the core references those in the macros above for all ESP32 chip variants.
This leads to an immediate compilation failure of the library.
I think the core should give define idfferent
portXRegister()
macros for the different chip variants to fix this bug.Commenting out the
#define BUSIO_USE_FAST_PINIO
macro to not make use of those macros leads to an immediate compilation successs.Sketch: (leave the backquotes for code formatting)
platformio.ini
Debug Messages:
None relevant since compilation failure.
The text was updated successfully, but these errors were encountered: