Hello, I’m trying to compile a project for my ESP32 board. When I set the framework in platformio.ini to espidf the project compiles with no problem. When I change the framework to arduino then I receive the compile errors below. I’m looking for some guidance on how to determine where the problem is. It’s almost as if the wemos_d1_mini32 board doesn’t support Arduino but I don’t think that is the case.
Here is the compiler output
> Executing task: platformio run <
Processing wemos_d1_mini32 (platform: espressif32; board: wemos_d1_mini32; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/wemos_d1_mini32.html
PLATFORM: Espressif 32 (3.2.0) > WeMos D1 MINI ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB 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 3.10006.210326 (1.0.6)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/wemos_d1_mini32/src/main.cpp.o
Generating partitions .pio/build/wemos_d1_mini32/partitions.bin
Archiving .pio/build/wemos_d1_mini32/libFrameworkArduinoVariant.a
Indexing .pio/build/wemos_d1_mini32/libFrameworkArduinoVariant.a
Compiling .pio/build/wemos_d1_mini32/FrameworkArduino/Esp.cpp.o
Compiling .pio/build/wemos_d1_mini32/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pio/build/wemos_d1_mini32/FrameworkArduino/HardwareSerial.cpp.o
In file included from /home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:50:0,
from /home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:51,
from /home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.cpp:7:
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.cpp: In member function 'void HardwareSerial::begin(long unsigned int, uint32_t, int8_t, int8_t, bool, long unsigned int)':
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-log.h:139:83: error: 'log_printf' was not declared in this scope
#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__)
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.cpp:36:9: note: in expansion of macro 'log_e'
log_e("Serial number is invalid, please use 0, 1 or 2");
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-log.h:139:83: error: 'log_printf' was not declared in this scope
#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__)
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.cpp:73:13: note: in expansion of macro 'log_e'
log_e("Could not detect baudrate. Serial data at the port must be present within the timeout for detection to be possible");
^
*** [.pio/build/wemos_d1_mini32/FrameworkArduino/HardwareSerial.cpp.o] Error 1
In file included from /home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:50:0,
from /home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:35,
from /home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/Esp.cpp:20:
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/Esp.cpp: In member function 'String EspClass::getSketchMD5()':
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-log.h:139:83: error: 'log_printf' was not declared in this scope
#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__)
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/Esp.cpp:175:9: note: in expansion of macro 'log_e'
log_e("Partition could not be found");
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-log.h:139:83: error: 'log_printf' was not declared in this scope
#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__)
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/Esp.cpp:183:9: note: in expansion of macro 'log_e'
log_e("Not enough memory to allocate buffer");
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-log.h:139:83: error: 'log_printf' was not declared in this scope
#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__)
^
/home/jlehman/.platformio/packages/framework-arduinoespressif32/cores/esp32/Esp.cpp:192:13: note: in expansion of macro 'log_e'
log_e("Could not read buffer from flash");
^
*** [.pio/build/wemos_d1_mini32/FrameworkArduino/Esp.cpp.o] Error 1
====================================================================== [FAILED] Took 1.65 seconds ======================================================================
The terminal process "platformio 'run'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
Here is my main.cpp just in case there is something there that is the cause of my issue.
// ESP32
//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include "driver/gpio.h"
//#include "freertos/FreeRTOS.h"
//#include "freertos/task.h"
#include "esp_log.h"
#include <Arduino.h>
#define MY_TAG "MAIN"
extern "C" {
void app_main() {
//ESP_LOGI(MY_TAG,"Starting...");
//esp_log_level_set(MY_TAG, ESP_LOG_VERBOSE);
while(true) {
vTaskDelay(1000/portTICK_PERIOD_MS);
}
}
}
Thanks!