platformio / platform-espressif8266

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

AZ-Delivery Lolin V3 ESP8266 ESP-12F apparently crashes on running code #274

Open rob-miller opened 2 years ago

rob-miller commented 2 years ago

I am attempting to develop for the AZ-Delivery Lolin V3 ESP8266 ESP-12F. The Arduino IDE uploads and runs my version of blink.ino without issue (the single difference from normal ESP8266 12E being that the LED Pin is defined as D4.

For information, the Arduino IDE output looks like:

Executable segment sizes:
ICACHE : 32768           - flash instruction cache 
IROM   : 231724          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 26793   / 32768 - code in IRAM          (IRAM_ATTR, ISRs...) 
DATA   : 1496  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 876   ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 25608 )         - zeroed variables      (global, static) in RAM/HEAP 
Sketch uses 260889 bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27980 bytes (34%) of dynamic memory, leaving 53940 bytes for local variables. Maximum is 81920 bytes.
esptool.py v3.0
Serial port /dev/cu.usbserial-14610
Connecting........___
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 98:cd:ac:28:02:f5
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 265040 bytes to 195062...

The PlatformIO build/upload output looks like:

RAM:   [===       ]  34.0% (used 27892 bytes from 81920 bytes)
Flash: [==        ]  24.9% (used 260093 bytes from 1044464 bytes)
Building .pio/build/nodemcuv2/firmware.bin
Creating BIN file ".pio/build/nodemcuv2/firmware.bin" using "/Users/rob/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and ".pio/build/nodemcuv2/firmware.elf"
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool

Then the actual upload output and light behaviour on the NodeMCU appears identical to the Arduino IDE upload.

After this, however the NodeMCU is showing no lights, whereas it is flashing happily after the Arduino IDE upload. This result is the same as #537 for a different board, but in this case blindly reducing the ram size to 32K or 64K did not help.

My environment is freshly installed PlatformIO IDE on VSCode under Monterey MacOS:

CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (3.2.0) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 64KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.30002.0 (3.0.2) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - tool-mklittlefs 1.203.210628 (2.3) 
 - tool-mkspiffs 1.200.0 (2.0) 
 - toolchain-xtensa 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft

Advice on any configuration changes I should try would be very much appreciated.

rob-miller commented 2 years ago

referencing #195 and #74

platformio.ini settings I have tried without luck:

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
;;board_upload.maximum_ram_size = 65536

;; https://github.com/platformio/platform-espressif8266/issues/195
;[env:esp12e]
;platform = espressif8266
;board = esp12e
;framework = arduino
;board_build.f_cpu = 160000000L

and various combinatorics of course. Tried all f_flash speeds and flash_mode options (independently) with no apparent change.

Arduino IDE works with CPU freq set to 80 or 160 MHz, doesn't care.

My test sketch for completeness, works on Arduino IDE:

#define LEDpin D4   //set led pin

void setup() {
   // initialize digital pin LED_BUILTIN as an output.
  pinMode(LEDpin, OUTPUT);
}

void loop() {
  // HIGH is off, LOW is on
  digitalWrite(LEDpin, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LEDpin, LOW);    // turn the LED off by making the voltage LOW
  delay(10);                       // wait for a second
}
Adityavns commented 1 year ago

Any update on this?