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

Build failure with the latest framework-arduinoespressif32 (idf-release/v4.2 branch) #10

Closed
estshorter opened this issue Jan 9, 2021 · 0 comments · Fixed by #11
Closed

Comments

@estshorter
Copy link
Contributor

estshorter commented Jan 9, 2021

Following compilation error occurs when using the latest framework-arduinoespressif32 (idf-release/v4.2 branch) and PlatformIO.
This is because driver/adc.h does not include soc/adc_channel.h in EPS-IDF v4.2.

See driver/adc.h in v3.3 and v4.2.

I'll create a PR to fix this issue.

Error

.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'void M5EPD::BatteryADCBegin()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryRaw()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryVoltage()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
*** [.pio\build\m5paper-test\lib22e\M5EPD\M5EPD.cpp.o] Error 1

Code example

platformio.ini

[platformio]
packages_dir = .pio/packages

[env:m5paper-test]
platform = espressif32
board = m5stack-fire
framework = arduino
platform_packages =
    toolchain-xtensa32 @ https://bintray.com/platformio/tool-packages/download_file?file_path=53bcf98-toolchain-xtensa32-windows-2.80400.2020.tar.gz
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.2
build_flags =
    -DESP32=1
    -DARDUINO_ARCH_ESP32=1
lib_deps =
  m5stack/M5EPD

src/main.cpp

#include <M5EPD.h>

void setup(void)
{
}

void loop(void)
{
}

Build log for pio run

PS C:\Users\estshorter\src\esp> pio run
Processing m5paper-test (platform: espressif32; board: m5stack-fire; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-fire.html
PLATFORM: Espressif 32 (2.1.0) > M5Stack FIRE
HARDWARE: ESP32 240MHz, 6.25MB RAM, 16MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 0.0.0+sha.7d3f499
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.80400.2020 (8.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 30 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <M5EPD> 0.1.0
|   |-- <FS> 1.0
|   |-- <SD(esp32)> 1.0.5
|   |   |-- <FS> 1.0
|   |   |-- <SPI> 1.0
|   |-- <SPIFFS> 1.0
|   |   |-- <FS> 1.0
|   |-- <SPI> 1.0
|   |-- <HTTPClient> 1.2
|   |   |-- <WiFi> 1.0
|   |   |-- <WiFiClientSecure> 1.0
|   |   |   |-- <WiFi> 1.0
|   |-- <Wire> 1.0.1
Building in release mode
Compiling .pio\build\m5paper-test\lib22e\M5EPD\M5EPD.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\USB.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\USBCDC.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\WString.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\base64.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-matrix.c.o
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'void M5EPD::BatteryADCBegin()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryRaw()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryVoltage()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
*** [.pio\build\m5paper-test\lib22e\M5EPD\M5EPD.cpp.o] Error 1

Environment

  • PlatformIO IDE v2.2.1
  • VS Code 1.52.1
  • Win 10 20H2
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

Successfully merging a pull request may close this issue.

1 participant