Whenevr I try to compile anything for any variant of the the ESP32, I get the following error:
Resolving esp32dev dependencies...
Error! Failed to extract upstream toolchain configurations:
Bad package version `esp-14.2.0_20241119`
You can disable this feature via the `board_build.arduino.upstream_packages = no` setting in your `platformio.ini` file.
Configuring from remote
This happens only on the tower PC. I have no such problem on the laptop. I have tried uninstalling vscode and deleting the configuratonn directories .vscode, .platformio but it made no difference. When bscode was re-installed, I still got the same error. I was able to compile a project for an AVR board, so I think this affects the ESP32 platform only.
I am not sure where to add board_build.arduino.upstream_packages = no to the platformio.ini file. I did try adding it to one of the ESP32 platform profiles, but go an error indicating that it was not recognized as a valid parameter.
I seem to be able to compile on the laptop, just not on the tower PC. Why would it work on one computer but not the other? Same platformio.ini file. Same PlatformIO projects for the ESP32.
UPDATE: just been doing some further Googling and it seems that the arduino framewaork for PlatformO has been deprecated and apparently Espressif has discontinued support for Arduino Core 3.0. Not good news.
I guess that’s a big nail in the coffin for PlatformIO then. Time to find an alternative. Might have a look at pioarduino as suggested. I did read that Espressif are no longer officially supporting Arduino core. Perhaps they are still unofficially working on it as ESP32 boards are still supported in the Arduino IDE? It does make me wonder for how long though… I also read that Microsoft have dropped support for the Vscode Arduino plugin. Have the folks at Arduino been upsetting people or something Why has this co-elaboration between interested parties suddenly come to a halt?
One of the links says Espressif support of core 3 is “in doubt” but that was a year ago so things might have changed? I have read quite some comments on the Arduino forum about projects being broken by the new core and needing significant re-writes but that does not amount to deprecation.
There is a clear management decision from espressif to support Arduino. There was again a statement from them when the explained the end of founding Platformio. The support for ArduinoIDE will be supported in future
I tried compiling with pioarduino. Had to remove PlatformIO as the two don’t seem to be able to co-exist. The project does compile now, but I am not getting anything on the serial port, which I guess is a separate problem.
#include <Arduino.h>
#include "AR488_Config.h"
#ifdef AR488_BT_ENABLE
#ifdef AR488_BT_HC05
#include "AR488_HC05.h"
#endif
#ifdef ESP32
#include "BluetoothSerial.h"
#endif
#endif
#ifdef AR_ESP32S2_USB_CDC
#include "USB.h"
USBCDC UsbCdcSerial;
#endif
/********** BT SERIAL PORT DECLARATIONS **********/
/* on ESP32, this comes as an extra serial port */
/* on Arduino, this is done using an HC05 like */
/* module plugged on the a serial port (possibly */
/* the main one). */
Stream *arSerial = NULL;
Stream* getSerialStream() {
if (arSerial == NULL) {
#if defined(AR_ESP32S2_USB_CDC)
arSerial =(Stream*) &(UsbCdcSerial);
UsbCdcSerial.begin();
USB.begin();
#else
#if defined(AR_CDC_SERIAL)
Serial_ *serial = &(AR_SERIAL_PORT);
#elif defined(AR_HW_SERIAL)
HardwareSerial *serial = &(AR_SERIAL_PORT);
#elif defined(AR_SW_SERIAL)
// Note: SoftwareSerial support conflicts with PCINT support
#include <SoftwareSerial.h>
SoftwareSerial *serial = new SoftwareSerial(AR_SW_SERIAL_RX, AR_SW_SERIAL_TX);
#endif
serial->begin(AR_SERIAL_BAUD);
arSerial = (Stream*) serial;
#endif
}
return arSerial;
}
#ifdef AR488_BT_ENABLE
Stream *btSerial = NULL;
Stream* getBTSerialStream() {
if(btSerial == NULL) {
#if defined(ESP32)
BluetoothSerial *serial = new BluetoothSerial();
serial->begin(AR_BT_NAME);
#else
#if defined(AR_CDC_SERIAL)
Serial_ *serial = &(AR_BT_SERIAL_PORT);
#elif defined(AR_HW_SERIAL)
HardwareSerial *serial = &(AR_BT_SERIAL_PORT);
#elif defined(AR_SW_SERIAL)
// Note: SoftwareSerial support conflicts with PCINT support
#include <SoftwareSerial.h>
SoftwareSerial *serial = new SoftwareSerial(AR_SW_BT_SERIAL_RX, AR_SW_BT_SERIAL_TX);
#endif
serial->begin(AR_BT_BAUD);
#if defined(AR488_BT_HC05)
hc05Init((Stream*) serial);
#endif
#endif // !ESP32
btSerial = (Stream*) serial;
}
return btSerial;
}
#endif
/***** Debug Port - if DB_SERIAL_PORT is set *****/
#if defined(DB_SERIAL_PORT)
#if defined(DB_CDC_SERIAL)
Serial_ *dbSerial_ = &(DB_SERIAL_PORT);
#elif define(DB_HW_SERIAL)
HardwareSerial *dbSerial_ = &(DB_SERIAL_PORT);
#elif defined(DB_SW_SERIAL)
// Note: SoftwareSerial support conflicts with PCINT support
#include <SoftwareSerial.h>
SoftwareSerial swDbSerial(DB_SW_SERIAL_RX, DB_SW_SERIAL_TX);
SoftwareSerial *dbSerial_ = &swDbSerial;
#else
// DB_SERIAL_PORT is defined but no dedicated port is configured, use arSerial
Stream *dbSerial_ = (Stream*) arSerial_;
#endif
Stream *dbSerial = (Stream*) dbSerial_;
Stream& getDbSerial() {
return *dbSerial;
}
#endif
I am seeing a serial port in the OS on /dev/ttyACM0, can connect to it but there is no output. I am niot familiar with USB.h and the USBCDC object, so can’t say whether this looks correct or not.
At least pioarduino allows to to go a step further an get a successful compile.
I tried the minimum project as suggested but am still getting no output. I also tried adding the build-flags line that you mention at the the end if the post. The board has an ESP32S2 but has no UART. It looks like the USB-C connector is hooked up directly to the D-/D+ pins on the ESP. Probably explains why its a bit tricky to do the upload. One has to time the RESET and GPIO00 button clicks just right.
BTW, I tried the minimal project in Arduino IDE2.3.6 and that worked OK.
PPS, vscode keeps nagging me to re-install PlaformIO…
Can’t get it working in either Vscode or Arduino IDE now. Must have been a fluke or I uploaded the wrong project. Not even getting a /dev/ttyACM0 port except when I hit RESET + GPIO00 buttons for upload mode. The ESP library in Arduino IDE is version 3.2.0. I was selecting ESP32S2 Dev Module for my board.
UPDATE:
After firing up the IDE again after closing both projects (in the wrong order), I forgot to set “Use CDC on Boot” to “Enabled”. I checked and it had reverted to “Disabled”, so I set it back to “Enabled” and compiled then uploaded again. Thought I was going mad…