Breadboard only works with an Arduino IDE-compiled code

Hi!

You’ve read it correctly. I cannot come up with a new idea to solution or explain it.
By chance, I realised a breadboard “ESP32S” with a Espressif ESP32-WROOM-32 module, the bad board, ONLY works with an Arduino IDE-compiled code. If the same code is compiled in Platformio, no way!

No error is reported in both platforms.

If I use another breadboard (“ESP32 DEVKITV1” - ESP32-WROOM-32, no brand name), the good one, both compiled codes work properly.

I’ve even downloaded flash content from the good board and copied it to the bad one, but it failed again.

Spliting flash content produced by Platformio in its parts (0x1000 - boot; 0x8000 - partition table; 0x9000 - I don’t know what’s this; 0xE000 - ota?; 0x10000 - app code) and replacing only one at a time on the flash of the bad board, app run only when Platformio-generated code was replaced by Arduino IDE-compiled one.

Arduino compiled content found in the flash is: 0x1000 - boot; 0x8000 - partition table; 0xE000 - ota?; 0x10000 - app code.

Any clue?

Can you do a screenshot of the Arduino IDE → Tools menu with which it works for your board?

What current platformio.ini are you using?

Hi, Max.
Thanks for replying.

;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

Platformio compilation and uploading report:

> Executing task in folder GeradorDeSinalDeRotacao: C:\Users\Admin\.platformio\penv\Scripts\platformio.exe run --target upload <

Processing fm-devkit (platform: espressif32; board: fm-devkit; framework: arduino)
----------------------------------------------------------------------------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/fm-devkit.html
PLATFORM: Espressif 32 (4.4.0) > ESP32 FM DevKit
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, 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 @ 2.0.4+sha.bd83727
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - tool-mkfatfs @ 2.0.1
 - tool-mklittlefs @ 1.203.210628 (2.3)
 - tool-mkspiffs @ 2.230.0 (2.30)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LiquidCrystal_PCF8574 @ 1.3.0
|   |-- Wire @ 2.0.0
|-- EEPROM @ 2.0.0
|-- Wire @ 2.0.0
Building in release mode
Retrieving maximum program size .pio\build\fm-devkit\firmware.elf
Checking size .pio\build\fm-devkit\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   5.3% (used 17468 bytes from 327680 bytes)
Flash: [==        ]  19.4% (used 253781 bytes from 1310720 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM4
Uploading .pio\build\fm-devkit\firmware.bin
esptool.py v3.3
Serial port COM4
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: fc:f5:c4:19:94:94
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0004efff...
Flash params set to 0x0220
Compressed 17280 bytes to 11968...
Writing at 0x00001000... (100 %)
Wrote 17280 bytes (11968 compressed) at 0x00001000 in 0.5 seconds (effective 274.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 409.6 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 753.2 kbit/s)...
Hash of data verified.
Compressed 254176 bytes to 140452...
Writing at 0x00010000... (11 %)
Writing at 0x0001ca58... (22 %)
Writing at 0x00024bf5... (33 %)
Writing at 0x0002a0df... (44 %)
Writing at 0x0002f49d... (55 %)
Writing at 0x000362c7... (66 %)
Writing at 0x0003ff29... (77 %)
Writing at 0x00045759... (88 %)
Writing at 0x0004acb5... (100 %)
Wrote 254176 bytes (140452 compressed) at 0x00010000 in 3.9 seconds (effective 527.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
============================================ [SUCCESS] Took 10.98 seconds ============================================


Terminal will be reused by tasks, press any key to close it.

;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

Platformio.ini content:

; 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:fm-devkit]

platform = espressif32

board = fm-devkit

framework = arduino

platform_packages = platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git

monitor_speed = 115200

;lib_deps = mathertel/LiquidCrystal_PCF8574@^2.0.0

lib_deps = mathertel/LiquidCrystal_PCF8574@1.3.0

;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

Arduino IDE compilation and uploading report:

O sketch usa 224396 bytes (17%) de espaço de armazenamento para programas. O máximo são 1310720 bytes.
Variáveis globais usam 14476 bytes (4%) de memória dinâmica, deixando 313204 bytes para variáveis locais. O máximo são 327680 bytes.
esptool.py v2.6
Serial port COM4
Connecting.....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: fc:f5:c4:19:94:94
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 8MB
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 2520.6 kbit/s)...
Hash of data verified.
Flash params set to 0x023f
Compressed 15328 bytes to 9993...
Wrote 15328 bytes (9993 compressed) at 0x00001000 in 0.2 seconds (effective 700.7 kbit/s)...
Hash of data verified.
Compressed 224512 bytes to 112552...
Wrote 224512 bytes (112552 compressed) at 0x00010000 in 1.9 seconds (effective 954.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.0 seconds (effective 945.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

Arduino IDE board configuration:

image

(previous image replaced by a better one - Edited by NormanDunbar (moderator) to format code segments.

But this is an entirely different configuration than the ESP32 dev module? Can you please try the platformio.ini

[env:fm-devkit]
platform = espressif32
board = esp32dev
framework = arduino
upload_speed = 921600
board_build.f_flash = 80000000L
board_build.flash_mode = dio
platform_packages = platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
monitor_speed = 115200
lib_deps = mathertel/LiquidCrystal_PCF8574@1.3.0

?

Max, I’ve just tried the platformio.ini you’ve suggested but it failed the same way.

These experimentations on platformio.ini were previously done but they all failed.

Indeed, a couple of tries were done before on Arduino IDE and all of them succeeded:

  • several upload speeds, including 115200 baud
  • both 40MHz and 80MHz flash frequencies
  • both dio and qio flash modes

In the Arduino IDE’s Tools → Board → Board Manager menu, what version of Arduino-ESP32 have you installed?

Same framework version, board settings and code should lead to the same results. Otherwise we have a bug I would like to learn more about.

Espressif Systems ESP32 version 1.0.2, because a sketch using ESP32-CAM requires it.

I’ve just compiled with version 1.06 and resulted ok.

“Same framework version, board settings and code should lead to the same results. Otherwise we have a bug I would like to learn more about.”

AC > Yep.
Count on me to help you in what I can do.

But you need to use

platform = espressif32@3.5.0

in your platformio.ini to make PlatformIO use that version of the core (releases), otherwise you’re getting 2.0.3.

I’ve just tried your suggestion. Several errors have arisen and I could not cope with this yet. Later I’ll check it up.

Compilation report:

"

Executing task in folder GeradorDeSinalDeRotacao: C:\Users\Admin.platformio\penv\Scripts\platformio.exe run --target upload <

Processing fm-devkit (platform: espressif32@3.5.0; board: esp32dev; framework: arduino)

Platform Manager: Installing espressif32 @ 3.5.0
Downloading [####################################] 100%
Unpacking [####################################] 100%
Platform Manager: espressif32@3.5.0 has been installed!
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (3.5.0) > Espressif ESP32 Dev Module
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 @ 2.0.4+sha.bd83727
  • tool-esptoolpy @ 1.30100.210531 (3.1.0)
  • tool-mkspiffs @ 2.230.0 (2.30)
  • toolchain-xtensa32 @ 2.50200.97 (5.2.0)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 34 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- LiquidCrystal_PCF8574 @ 1.3.0
    | |-- Wire @ 2.0.0
    |-- EEPROM @ 2.0.0
    |-- Wire @ 2.0.0
    Building in release mode
    Compiling .pio\build\fm-devkit\src\GeradorDeSinalDeRotacao.cpp.o
    Generating partitions .pio\build\fm-devkit\partitions.bin
    Compiling .pio\build\fm-devkit\lib771\Wire\Wire.cpp.o
    Compiling .pio\build\fm-devkit\libbac\LiquidCrystal_PCF8574\LiquidCrystal_PCF8574.cpp.o
    Compiling .pio\build\fm-devkit\lib930\EEPROM\EEPROM.cpp.o
    Compiling .pio\build\fm-devkit\FrameworkArduino\Esp.cpp.o
    Compiling .pio\build\fm-devkit\FrameworkArduino\FirmwareMSC.cpp.o
    Compiling .pio\build\fm-devkit\FrameworkArduino\FunctionalInterrupt.cpp.o
    Compiling .pio\build\fm-devkit\FrameworkArduino\HWCDC.cpp.o
    Compiling .pio\build\fm-devkit\FrameworkArduino\HardwareSerial.cpp.o
    Compiling .pio\build\fm-devkit\FrameworkArduino\IPAddress.cpp.o
    In file included from C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/FunctionalInterrupt.cpp:9:0:
    C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:183:12: error: ‘std::round’ has not been declared
    using std::round;
    ^
    cc1plus.exe: warning: unrecognized command line option ‘-Wno-frame-address’
    *** [.pio\build\fm-devkit\FrameworkArduino\FunctionalInterrupt.cpp.o] Error 1
    In file included from C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src/EEPROM.h:31:0,
    from C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src/EEPROM.cpp:26:
    C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:183:12: error: ‘std::round’ has not been declared
    using std::round;
    ^
    cc1plus.exe: warning: unrecognized command line option ‘-Wno-frame-address’
    In file included from C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.cpp:35:0:
    C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:183:12: error: ‘std::round’ has not been declared
    using std::round;
    ^
    *** [.pio\build\fm-devkit\lib930\EEPROM\EEPROM.cpp.o] Error 1
    cc1plus.exe: warning: unrecognized command line option ‘-Wno-frame-address’
    *** [.pio\build\fm-devkit\lib771\Wire\Wire.cpp.o] Error 1
    In file included from src/GeradorDeSinalDeRotacao.cpp:59:0:
    C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:183:12: error: ‘std::round’ has not been declared
    using std::round;
    ^
    cc1plus.exe: warning: unrecognized command line option ‘-Wno-frame-address’
    In file included from C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.cpp:20:0:
    C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:183:12: error: ‘std::round’ has not been declared
    using std::round;
    ^
    In file included from .pio/libdeps/fm-devkit/LiquidCrystal_PCF8574/src/LiquidCrystal_PCF8574.h:26:0,
    from .pio/libdeps/fm-devkit/LiquidCrystal_PCF8574/src/LiquidCrystal_PCF8574.cpp:9:
    C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:183:12: error: ‘std::round’ has not been declared
    using std::round;
    ^
    *** [.pio\build\fm-devkit\src\GeradorDeSinalDeRotacao.cpp.o] Error 1
    cc1plus.exe: warning: unrecognized command line option ‘-Wno-frame-address’
    *** [.pio\build\fm-devkit\FrameworkArduino\IPAddress.cpp.o] Error 1
    cc1plus.exe: warning: unrecognized command line option ‘-Wno-frame-address’
    *** [.pio\build\fm-devkit\libbac\LiquidCrystal_PCF8574\LiquidCrystal_PCF8574.cpp.o] Error 1
    In file included from C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Esp.cpp:20:0:

C:/Users/Admin/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:183:12: error: ‘std::round’ has not been declared
using std::round;
^
cc1plus.exe: warning: unrecognized command line option ‘-Wno-frame-address’
*** [.pio\build\fm-devkit\FrameworkArduino\Esp.cpp.o] Error 1
========================================= [FAILED] Took 84.68 seconds =========================================
The terminal process “C:\Users\Admin.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘upload’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it."

It’s including an EEPROM library that it shouldn’t. The core already has it. Remove the .pio folder of your project.

You are still injecting the latest arduino-esp32 package in your platformio.ini, that is not good since we want to use the one from the platform version. Please use

[env:fm-devkit]
platform = espressif32@3.5.0
board = esp32dev
framework = arduino
upload_speed = 921600
board_build.f_flash = 80000000L
board_build.flash_mode = dio
monitor_speed = 115200
lib_deps = mathertel/LiquidCrystal_PCF8574@1.3.0

as the platformio.ini and build + upload again.

Max, now it succeeded, after removing .pio folder an deleting “platform_packages =
latformio/framework-arduinoespressif32 @ GitHub - espressif/arduino-esp32: Arduino core for the ESP32” line from platformio.ini.

I could not remove “#include <EEPROM.h>” otherwise a lot of errors were thrown.

I’d appreciate if you explain what’s wrong between this breadboard and Platformio package.

The other breadboard also works with this newly-compiled code :slight_smile: