Boards are: Lolin D1 mini lite and Espduino ESP8266 ESP-WROOM-02
Compilation and upload finishes without any problems but even simplest programs won’t run.
Built in LED won’t blink, nothing comes out on serial monitor, GPIOs won’t change state from HI to LO and back (I’ve checked with voltmeter).
Even if I upload empty program (empty setup and loop functions) and reset the board, serial monitor shows:
Interesting that it detects 4MB when the partition table is set for 1MB flash max, reading from here.
None of this should be necessary since these are already the defaults.
Does the serial monitor work when you flash the firmware with PlatformIO, but use only the serial monitor (Tools → Serial Monitor) from the Arduino IDE?
I’ve uploaded the “CheckFlashConfig” sketch I found somewhere and this is what it spits out:
Flash real id: 0016405E
Flash real size: 4194304 bytes
Flash ide size: 4194304 bytes
Flash ide speed: 40000000 Hz
Flash ide mode: DOUT
Flash Chip configuration ok.
So that’s why I tried to set up some options to match these.
I’ve tried various flash and filesystem options:
Does the serial monitor work when you flash the firmware with PlatformIO, but use only the serial monitor (Tools → Serial Monitor) from the Arduino IDE?
If I understood your last question, I’ve flashed simple program that blinks LED and prints some characters to the Serial using PlatformIO. Upload went OK, so it says …
LED doesn’t blink at all.
In PlatformIO’s serial monitor only text I can see is that crash report from the initial post after reset and none of the stuff that program sends.
When I then launch Arduino IDE and its serial monitor set to same baud rate I get exactly the same result: crash report after reset and nothing else.
I’ve tried to understand what are PlatformiIO and Arduino IDE v2.x doing differently to see why PlatformIO fails to produce correct image.
Some conclusions are:
They both use same version of esptool. I can use any of them to upload generated image. However I upload Arduino IDE image - it works, however I upload PIO image - it doesn’t work.
boot images are the same in both Arduino IDE and PIO
generated sketch images (ELFs), before linking with the boot image, are different for Arduino IDE and PIO (could be due to different compiler options, haven’t gone into details)
if I link generated ELF with the boot ELF manually Arduino or PIO way, if I use Arduino generated ELF it works, if I use PIO generated ELF it doesn’t work
I’ve tried tons of build_flags, various versions of ldscripts, platform versions, ALL ESP8266 boards etc. it’s always the same (negative) result
I’ve tried all that on 3 different machines, 2 physical running on Fedora Linux and 1 virtual running Win10. Results are the same.
I conclude that PlatformIO-Arduino-ESP8266 combination is broken. PlaftormIO either produces wrong binary code or, more likely, screws up partitioning info.
I’ve tried to inspect ELF header info but I don’t know enough to see if there is something wrong.
Pitty, working in Arduino IDE is pain in the [BEEEP] …