Skip to content

monitor: document passive monitoring, and make --no-reset skip the reset into the bootloader #1130

Open

Description

@wackazong

Motivations

  • Would you like to implement this feature? y

I sometimes want to watch the console of an application that is already running (for example after it woke from sleep, or after another tool flashed it) without espflash touching the chip. espflash monitor connects first: the --before reset into the bootloader, sync and chip detection. That is intentional (#346, closed by #561: chip detection sets the monitor baud rate for 26 MHz crystals), so this is not a request to change the default.

What works for me (espflash 4.7.0, ESP32-P4 over USB-Serial-JTAG, macOS):

espflash monitor -c esp32p4 --non-interactive --no-reset --before no-reset-no-sync

Three things make this hard to find or use:

  1. It is not documented. The README describes monitor as "Open the serial monitor without flashing". The --no-reset help says "Avoids restarting the device before monitoring", but the reset that interrupts the application is the one connect() does for --before, which --no-reset does not affect. --no-reset only skips the reset into the application after connecting (reset_after_flash in cli/monitor/mod.rs, monitor()).
  2. --no-reset only has an effect with --non-interactive. In interactive mode monitor() does no reset after connecting, so the flag changes nothing there; flash --monitor warns about this (check_monitor_args), espflash monitor accepts it silently. Someone who reaches for --no-reset, the obvious flag, still gets the reset into the bootloader in either mode.
  3. Flashing after a passive session. After such passive sessions, flashing sometimes failed with "Timeout while running ReadReg" until the board was reset; espflash flash --monitor in one connection was reliable. I did not record a reproduction or the exact version at the time (4.7.0 is installed now). How to use with ftdi FT232-ttl adapter (esp32s3 board)? Able to monitor but not able to flash... #646 shows the same error after -b no-reset-no-sync, on a different setup (FT232 UART adapter without DTR/RTS). Use a running flash stub, disable the watchdogs on connect, fix --non-interactive port selection and the UART hard reset #1129 changes the connect and reset handling around --before no-reset, so it may already address this; I have not tested it.

With --before no-reset-no-sync, Flasher::connect still calls detect_sdm (GET_SECURITY_INFO, then READ_REG) and serial_monitor then calls device_info(), so the passive path still sends loader commands to the running application. On the device this shows as a 9 s pause and a wrong warning before the console appears:

[2026-11-14T08:13:10Z WARN ] Pre-connection option 'NoResetNoSync' was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
[2026-11-14T08:13:10Z INFO ] Serial port: '/dev/cu.usbmodem101'
[2026-11-14T08:13:10Z INFO ] Connecting...
[2026-11-14T08:13:19Z WARN ] Secure Download Mode is enabled on this chip
I (34099202) <application log continues, no reset>

The chip has no Secure Download Mode enabled; the commands time out against the running application and the timeout is taken for it. For comparison, plain espflash monitor -c esp32p4 --non-interactive on the same device restarts the application (its log begins again with the bootloader's esp_image lines).

Solution

  1. Document the passive combination in espflash monitor --help (the --no-reset and --before texts) and in the README, including that --chip is required with --before no-reset-no-sync.
  2. Make --no-reset mean "do not reset the chip" independently of --non-interactive: imply --before no-reset-no-sync (and require --chip). If changing the meaning of --no-reset is not wanted, a --passive shorthand for the combination would do. Either way, the passive path could skip detect_sdm and the register reads in device_info(), since nothing answers them: that removes the pause and the false "Secure Download Mode is enabled" warning.
  3. If the ReadReg timeout after a passive session still happens with Use a running flash stub, disable the watchdogs on connect, fix --non-interactive port selection and the UART hard reset #1129, track it here or in How to use with ftdi FT232-ttl adapter (esp32s3 board)? Able to monitor but not able to flash... #646.

Alternatives

  • A plain serial terminal (screen, picocom) is passive, but loses espflash's address resolution and defmt decoding.
  • espflash flash --monitor in one connection, when a reflash is acceptable.

Additional context

  • OS: macOS
  • espflash version: 4.7.0; the code references are to main at 95d8380
  • Target: ESP32-P4 (rev v1.3, M5Stack Tab5), USB-Serial-JTAG

Activity

  1. MabezDev commented on Nov 23, 2026

    @MabezDev
    Member

    Yes. --no-reset only skips the reset after connect, and only in non-interactive monitor, so a passive watch still needs --before no-reset-no-sync. Could we document that, and make --no-reset cover the connect-time reset too?

  2. added
    documentation
    serial monitor
    feature request
    on Nov 23, 2026
  3. wackazong commented on Nov 24, 2026

    @wackazong
    Author

    Yes, I'll open a PR for both:

    • Docs: the --no-reset and --before help texts and the README describe the passive combination, including that --chip is required with --before no-reset-no-sync.
    • espflash monitor --no-reset (and cargo espflash monitor --no-reset) implies --before no-reset-no-sync in interactive and non-interactive mode, and requires --chip. flash --monitor --no-reset keeps its current meaning, since flashing needs the connect-time reset.

    One question on scope: with --before no-reset-no-sync, Flasher::connect still runs detect_sdm, and serial_monitor then calls device_info() and reads the crystal frequency, all against the running application. That causes the 9 s pause and the false "Secure Download Mode is enabled" warning. Should the passive path skip those reads in the same PR (it then needs the crystal frequency from --chip defaults or a flag), or would you prefer that separately?

  4. moved this from Todo to Review in esp-rs on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationfeature requestserial monitor

    Type

    No type

    Projects

    • Status
      Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions