platformio / platform-espressif8266

Espressif 8266: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif8266
Apache License 2.0
323 stars 219 forks source link

PIO Fatal exception (28) - Arduino IDE Sketch works #187

Closed ernstnaezer closed 4 years ago

ernstnaezer commented 4 years ago

Hi,

I can't get the below "hello world" app to work though PlatformIO on a batch of ESP-01 modules. It works whenever I upload it through the Arduino IDE (version 1.8.0).

It compiles and uploads correctly, however I don't see any serial out on my monitor. I do get the expected output by uploading the exact same code through the IDE.

Any thoughts on how fix this?

platformio.ini:

[env:esp01]
platform = espressif8266
framework = arduino
board = esp01_1m

app:

void setup(){
  Serial.begin(115200);
  Serial.println("setup done");
}

void loop(){
  Serial.println("...");
}

upload log

Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: bc:dd:c2:b2:fc:dc
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Compressed 264288 bytes to 193123...

Writing at 0x00000000... (8 %)
Writing at 0x00004000... (16 %)
Writing at 0x00008000... (25 %)
Writing at 0x0000c000... (33 %)
Writing at 0x00010000... (41 %)
Writing at 0x00014000... (50 %)
Writing at 0x00018000... (58 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (75 %)
Writing at 0x00024000... (83 %)
Writing at 0x00028000... (91 %)
Writing at 0x0002c000... (100 %)
Wrote 264288 bytes (193123 compressed) at 0x00000000 in 18.7 seconds (effective 113.0 kbit/s)...
Hash of data verified.
ernstnaezer commented 4 years ago

I managed to capture a bit of output using a soft reset. Seems like my PIO build is crashing

84, room 16 
tail 8
chksum 0xef
csum 0xef
csum err
ets_main`pE0x00000000, excvaddr=0x000000b5, depc=0x00000000
Fatal exception (28): 
epc1=0x4000228b, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000b5, depc=0x00000000
ernstnaezer commented 4 years ago

Solved - this was due to an incompatible flash_mode. Setting this to dout fixed the issue.