Strange Behaviour with NodeMCU

I have been developing on WeMos D1 Mini’s for some time now. However one of my boards died, so I had to swap it out with a NodeMCU board.

I can upload code to the NodeMCU board fine in the Arduino IDE. However when I try it in PIO CLI, the serial monitor just shows -

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld

And it constantly resets. I have uploaded the identical code to my WeMos D1 Mini and it works without problems. My platformio.ini looks as follows

[developer]
build_flags= -DDEBUG_MODE=SERIAL_OUT -DSERVER_IP=MUNT_SERVER_IP -DSTA_SSID=MUNT_SSID -DSTA_PASSWORD=MUNT_PASSWORD

[env:server_d1]
platform = espressif8266
framework = arduino
board = d1_mini
board_f_cpu = 80000000L
build_flags = -Wl,-Tesp8266.flash.4m1m.ld
upload_speed = 230400
upload_port = 192.168.1.101
src_filter = +<*> -<client.cpp>
build_flags = ${developer.build_flags} -DLED_COUNT=3 -DLED_PIN=D1 -DPIR_PIN=D2
upload_flags = --auth=xyz
extra_script = file_system_prep.py
lib_deps =
    ArduinoJson
    Time
    ESP8266WiFi
    FastLED

[env:server_node]
platform = espressif8266
framework = arduino
board = nodemcu
board_f_cpu = 80000000L
build_flags = -Wl,-Tesp8266.flash.4m1m.ld
upload_speed = 230400
upload_port = /dev/cu.wchusbserial1d20
src_filter = +<*> -<client.cpp>
build_flags = ${developer.build_flags} -DLED_COUNT=3 -DLED_PIN=1 -DPIR_PIN=2
extra_script = file_system_prep.py
lib_deps =
    ArduinoJson
    Time
    ESP8266WiFi
    FastLED

I just replaced the ESP8266 on the broken WeMos D1 and I don’t need to use the Node anymore (I dont seem to have much luck with NodeMCU’s). So, this issue isn’t terribly important. But I am curious as to why I can’t run the same code/env on a NodeMCU board as my WeMos D1 Mini.

Could you try to change board from nodemcu to nodemcuv2?

I have a similar problem here.
I use WeMos D1 mini. Fresh VScode + platformio install (on Ubuntu). I open an esp8266-nonos-sdk blink example, build it an upload it. Everything fine up until now bu the first red flag is that ESP doent restart after loading firmware. So I press reset button and LED starts to flash quickly, and this
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
gets continuously vomited to the console.
What’s strange is that if i open the adrduino version everything works perfectly, so I assume something’s wrong with the noos-sdk.
Please help. Id love to program my ESP’s in pure C, but still cant make it work :frowning:

So… almost two years have passed…
Is there a plan to fix that issue? I was about to switch from Arduino IDE to modern IDE but it looks like it can’t properly compile/upload the code? The same code in Arduino works without problems. When compiled and uploaded by PlatformIO it switch to baud rate 74880 and keeps sending that ets Jan 8 2013,rst cause... over and over.

This issue is most likely a user configuration issue, regarding the bootloader, flash size and flash mode especially (like here), so there’s nothing to fix in PlatformIO. What exact board do you have? What does esptool.py report about the chip? What is your exact Arduino IDE board setup / settings? Have you tried adapting different config values?

1 Like

I use WeMos D1 mini board.

I have a simple sketch using 3 external libraries.
Uploading in Arduino (below 5s as Arduino remembers that libraries were already compiled and does not repeat that process unnecessary):

Executable segment sizes:
IROM   : 244212          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 26832   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1252  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 896   ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 25280 )         - zeroed variables      (global, static) in RAM/HEAP 
Szkic używa 273192 bajtów (26%) pamięci programu. Maksimum to 1044464 bajtów.
Zmienne globalne używają 27428 bajtów (33%) pamięci dynamicznej, pozostawiając 54492 bajtów dla zmiennych lokalnych. Maksimum to 81920 bajtów.
esptool.py v2.8
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: b4:e6:2d:4a:31:80
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 277344 bytes to 204288...
Wrote 277344 bytes (204288 compressed) at 0x00000000 in 4.8 seconds (effective 466.8 kbit/s)...
Hash of data verified.

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

On PlatformIO it took >50s because libraries are compiled even if nothing changes to them (maybe there is some hidden option like with changing projects_dir [which does not work with unicode characters in path… in 2020…])

Building .pio\build\d1_mini\firmware.bin
Retrieving maximum program size .pio\build\d1_mini\firmware.elf
Checking size .pio\build\d1_mini\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  33.5% (used 27428 bytes from 81920 bytes)
Flash: [===       ]  26.2% (used 273232 bytes from 1044464 bytes)
Creating BIN file ".pio\build\d1_mini\firmware.bin" using "C:\Users\Marooned\.platformio\packages\framework-arduinoespressif8266\bootloaders\eboot\eboot.elf" and ".pio\build\d1_mini\firmware.elf"
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM3
Uploading .pio\build\d1_mini\firmware.bin
esptool.py v2.8
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: b4:e6:2d:4a:31:80
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 277392 bytes to 204337...

Writing at 0x00000000... (7 %)
Writing at 0x00004000... (15 %)
Writing at 0x00008000... (23 %)
Writing at 0x0000c000... (30 %)
Writing at 0x00010000... (38 %)
Writing at 0x00014000... (46 %)
Writing at 0x00018000... (53 %)
Writing at 0x0001c000... (61 %)
Writing at 0x00020000... (69 %)
Writing at 0x00024000... (76 %)
Writing at 0x00028000... (84 %)
Writing at 0x0002c000... (92 %)
Writing at 0x00030000... (100 %)
Wrote 277392 bytes (204337 compressed) at 0x00000000 in 18.2 seconds (effective 121.9 kbit/s)...
Hash of data verified.

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

Note the speed of upload:

  • Arduino: Wrote 277344 bytes (204288 compressed) at 0x00000000 in 4.8 seconds (effective 466.8 kbit/s)...
  • PIO: Wrote 277392 bytes (204337 compressed) at 0x00000000 in 18.2 seconds (effective 121.9 kbit/s)...

I’ve tried different board_build.flash_mode, the only thing that changes is the speed of flashing (still noticeably slower than Arduino IDE).

My Arduino setup:
obraz

My PIO setup:

[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
monitor_speed = 115200
lib_deps = 
	knolleary/PubSubClient@^2.8
	beegee-tokyo/DHT sensor library for ESPx@^1.17

Thanks

[edit]
ok, I’ve added upload_speed = 921600 to platformio.ini and upload speed now match Arduino, so this one is solved… however, board still does not work, still this on startup:

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3584, room 16 
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

The only I think I don’t see matching is the partition table / “Flash Size”, but 4MB is correct. You can add this to your platformio.ini

board_build.ldscript  = eagle.flash.4m2m.ld

to match the 4MB (FS:2MB OTA:~1019KB) setting.

Flash mode and frequency already match PIO’s definitions.

… the only other thing I could think of is that it maybe needs the macro too? I could just be looking at too-recent version though. You can additionally add

build_flags = -DFLASHMODE_DIO

to the platformio.ini and see if that helps.

1 Like

[edited]
Ok, I must apologize for the unnecessary confusion. The problem was totally on my side. While importing the project and converting .ino to .cpp I somehow missed commented debug definition which resulting in no Serial communication. But as there was this strange output to the Serial ets Jan 8 2013,rst cause:2, boot mode I assumed I have the same issue. I was expecting silence on Serial if Serial is not initialized and used - hence the confusion.

All seems to be working now. Thanks for your time and sorry for the problem.

1 Like