Bad package version `esp-14.2.0_20241119`

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.

What’s the full content of the platformio.ini?

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

This will use Arduino core 2.0.17 which does not support this new toolchains

Does that mean that I can no longer compile for the ESP32 using the Arduino framework with PlatformIO?

Not with official Platformio. For actual espressif32 Arduino you can use the fork pioarduino GitHub - pioarduino/platform-espressif32: Espressif 32: pioarduino community platform compatible with PlatformIO

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.

T

That’s the reason for the existence of pioarduino - See the link above.

No espressif does heavily work on Arduino core. Platformio has dropped support for espressif Arduino. A complete different thing

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?

No, Espressif is still working on the Arduino core! Check the roadmap

Where did you read this?

Again, where did you read this?

Microsoft accidently deleted a lot of VS Code extensions, but they are all restored. Maybe you read about this issue by Microsoft?

You can read the full story here: issues/1225

This is the link to the Microsoft deprecation of the Arduino plugin:

My statement regarding Espressif may have been a mis-interpretation of this post:

https://www.reddit.com/r/esp32/comments/1d7mkmz/no_more_arduino_with_pio/

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.

Ok. But the Ardunio VS Code Extension is not related to PlatformIO.

The 3.x core has a lot of API changes. That’s why the major version changed.
This also means that projects and 3rd party libraries often needs rewrites.
You can read about the changes here: Migration from 2.x to 3.0 - - — Arduino ESP32 latest documentation

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 would have not done the fork pioarduino when the situation about supporting Arduino has been not clear

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.

This is the project section in platformio.ini:

[env:AR488-ESP32-Rev4]
platform = espressif32
framework = arduino
board = esp32-s2-saola-1
upload_protocol = esptool
build_flags =
	${esp32v2.build_flags}
	-D AR_ESP32S2_USB_CDC
	-D AR488_CUSTOM
	-D SN7516X -D SN7516X_TE=17
	-D DIO1=8 -D DIO2=9 -D DIO3=10  -D DIO4=11
	-D DIO5=12 -D DIO6=13 -D DIO7=14  -D DIO8=15
	-D REN=26  -D IFC=38  -D NDAC=33  -D NRFD=34
	-D DAV=40  -D EOI=35  -D ATN=36   -D SRQ=37

This is what I found in a file called serial.h:

#if !defined(SERIAL_H)

#include <Arduino.h>

Stream* getSerialStream();
#ifdef AR488_BT_ENABLE
Stream* getBTSerialStream();
#endif

#if defined(DB_SERIAL_PORT)
Stream* getDbSerialStream();
#endif

#define SERIAL_H
#endif

And this in serial.cpp:

#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.

Create a new project with the absolute simplest settings and code.

[env:AR488-ESP32-Rev4]
platform = espressif32
framework = arduino
board = esp32-s2-saola-1

src/main.cpp

#include <Arduino.h>

void setup() {
  Serial.begin(115200);
}

void loop() {
  Serial.println("Hello");
  delay(1000);
}

Use the “Upload and Monitor” project task. Do you see any output?

If not, then the board might be set to output via UART instead of the USB port. Add

build_flags =
  -DARDUINO_USB_CDC_ON_BOOT=1

to the platformio.ini. Does output appear now?

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 you provide a screenshot of the Arduino IDE → Tools menu with which it worked?

What version of the Arduino-ESP32 core was installed in the board manager?

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…