ESP32 Mini D1 clone. Platform IO issue

Good day.

Sorta a noob question. Got a ESP32 Mini D1 clone from aliexpress. Have absolutely no issue uploading to it from Arduino IDE with the board parameters set to ESP32 Dev module.
However, if trying to work with the board in VScode with Platform IO extension i run into a very weird situation. It connects and uploads successfully. However, the micro controller gets stuck in a infinite boot loop due to brownout trigger.
I switch to arduino IDE upload the code and the controller runs as perfectly as before.

The same code, the same cable, i don’t even disconnect the controller between uploads.

Platform.ini file looks like this. although i tried different boards to no avail.

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

would appreciate, any advices or suggestions

cheers

Can you show a screenshot of your Arduino IDE board settings?

Indeed, that’s weird. I never seen an ESP32 on a brownout… except it was battery powered.

As we don’t know your code, please use this hello world sketch for further tests:

#include <Arduino.h>

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

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

This looks okay. Please check the installed Espressif32 Arduino versions in ArduinoIDE and the installed Espressif32 platform version in PlatformIO.

thank you for the prompt and detailed reply, really appreciate it.
the screenshot of arduino IDE:

the board manager in Arduino IDE is 3.0.7

Esspressif32 in PlatformIO 6.10.0

Hello World sketch runs without brownout triggers. which makes the whole thing even more confusing, i suppose.

My original code is interfacing with PS5 controller over Bluetooth. that’s when i inititally noticed the issue. But since then i tried a few Arduino example sketches involving wifi network connection and wifi network scans. All of those failed when compiled via platform IO.

I asked the same question on reddit, and someone replied with the following:

"Esp-idf and pio will start both cores in boot. Legacy Arduino won’t because its world revolves around tiny 8 bitters. With the snippet you show on pio Arduino runs on one and the radios and interrupts run in the other. If course, any other threads you start have scheduling policies largely up to you. "

I’d lie if i say i comprehend the meaning completely. However, I’d like to know what configuration changes can be made to replicate Arduino IDE compiler settings in PlatformIO.

Esspressif32 in PlatformIO 6.10.0 is Arduino 2.0.17 which is based on ESP-IDF 4.4.7. Whereby your ArduinoIDE is using Espressif Arduino 3.0.7 which is based on ESP-IDF 5.1.4. So there is a big mismatch in the Arduino and ESP-IDF version.

To get the latest Espressif32 Arduino 3.1.1 (based on ESP-IDF 5.3.2) to PlatformIO use pioarduino. Change the platform setting in platformio.ini to:

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
1 Like

awesome. it definably solved the big problem. Thank you.

however i noticed the following in after the program starts.

23:26:04.902 > Ready.
23:26:04.904 > [ 608][E][esp32-hal-periman.c:180] perimanGetPinBus(): Invalid pin: 255
23:26:04.910 > [ 615][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255
23:26:04.918 > [ 622][E][esp32-hal-ledc.c:116] ledcAttachChannel(): Pin 255 is already attached to another bus and failed to detach
23:26:04.929 > [ 633][E][esp32-hal-periman.c:180] perimanGetPinBus(): Invalid pin: 255
23:26:04.935 > [ 640][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255
23:26:04.942 > [ 646][E][esp32-hal-ledc.c:116] ledcAttachChannel(): Pin 255 is already attached to another bus and failed to detach

this is something new

If you want to have the exact same Espressif32 Arduino version (3.0.7) use

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.07/platform-espressif32.zip

and look if the messages are still popping up.

btw: pin 255 is not a valid pin number. Where does it come from?

the link didn’t work for me but i downloaded a .zip and linked it in platformio.ini.
the message didn’t go away. I don’t use PIN 255 in my code. Maybe it’s coming form one of the libraries??

At the moment, it seems like the code runs properly though, but more testing is required. Thanks for your help

1 Like

No, this wasn’t meant to be a download link. You have to put it in your platformio.ini as described above. Change the platform setting in platformio.ini to:

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.07/platform-espressif32.zip

Could be. Hard to say without knowing your code / project / used libraries. :wink:

that’s the first thing i tried but it doesn’t work

Processing esp32dev (platform: https://github.com/pioarduino/platform-espressif32/releases/download/53.03.07/platform-espressif32.zip; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Platform Manager: Installing https://github.com/pioarduino/platform-espressif32/releases/download/53.03.07/platform-espressif32.zip
PackageException: Got the unrecognized status code '404' when downloaded https://github.com/pioarduino/platform-espressif32/releases/download/53.03.07/platform-espressif32.zip

so i manually downloaded the older version, or what i thought was the older version from gihub. and then pointed to it in platformio.ini

Sorry, my bad :innocent:… typo in the link 51.03.07 instead of 53.03.07:

platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip

Here you’ll find some more information about the available versions.

1 Like