Skip to content

ESP32: "esptool load-ram" no longer works in dev (works in 0.41) #5579

Description

@jeremyvisser

When using esptool load-ram to flash a program onto an ESP32, it works on TinyGo 0.41, but no longer works on the latest dev branch (0.42.0-dev-854f91ec).

Test case:

package main

func main() {
	for {
		println("hello, world!")
	}
}

TinyGo 0.41:

% /opt/tinygo0.41/bin/tinygo build -o cmd/helloworld/helloworld.bin -target esp32-generic ./cmd/helloworld/. \
  && esptool --port $PORT load-ram cmd/helloworld/helloworld.bin \
  && /opt/tinygo0.41/bin/tinygo monitor -port $PORT
esptool v5.2.0
Connected to ESP32 on /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0:
Chip type:          ESP32-D0WD-V3 (revision v3.1)
Features:           Wi-Fi, BT, Dual Core + LP Core, 240MHz, Vref calibration in eFuse, Coding Scheme None
Crystal frequency:  40MHz
MAC:                1c:c3:ab:bc:33:dc

Stub flasher running.

Loaded 2 segments from 'cmd/helloworld/helloworld.bin' to RAM, executing at 0x4008000c.

Exiting immediately.
Connected to /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0. Press Ctrl-C to exit.
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
^C

TinyGo 0.42.0-dev-854f91ec:

% /opt/tinygo/bin/tinygo build -o cmd/helloworld/helloworld.bin -target esp32-generic ./cmd/helloworld/. \
  && esptool --port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 load-ram cmd/helloworld/helloworld.bin \
  && /opt/tinygo/bin/tinygo monitor -port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
esptool v5.2.0
Connected to ESP32 on /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0:
Chip type:          ESP32-D0WD-V3 (revision v3.1)
Features:           Wi-Fi, BT, Dual Core + LP Core, 240MHz, Vref calibration in eFuse, Coding Scheme None
Crystal frequency:  40MHz
MAC:                1c:c3:ab:bc:33:dc

Stub flasher running.

Loaded 2 segments from 'cmd/helloworld/helloworld.bin' to RAM, executing at 0x40080058.

Exiting immediately.
Connected to /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0. Press Ctrl-C to exit.

EXC 00000000 400d0f8c 00000000 80007c18

Actually flashing the program to the ESP32 (esptool write-flash or tinygo flash) continues to work fine, however esptool load-ram is significantly faster, and has less impact on the flash's lifespan.

My environment:

  • tinygo version 0.42.0-dev-854f91ec linux/amd64 (using go version go1.26.5-X:nodwarf5 and LLVM version 22.1.4)
  • ESP32:
    • Tested on a CYD-2432S028R (ESP32-D0WD-V3)
    • Also tested on a LOLIN32 (ESP32-D0WDQ6), which has the same behaviour

The most likely related change is #5510.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions