Repository navigation
Description
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:
- It is not documented. The README describes
monitoras "Open the serial monitor without flashing". The--no-resethelp says "Avoids restarting the device before monitoring", but the reset that interrupts the application is the oneconnect()does for--before, which--no-resetdoes not affect.--no-resetonly skips the reset into the application after connecting (reset_after_flashincli/monitor/mod.rs,monitor()). --no-resetonly has an effect with--non-interactive. In interactive modemonitor()does no reset after connecting, so the flag changes nothing there;flash --monitorwarns about this (check_monitor_args),espflash monitoraccepts it silently. Someone who reaches for--no-reset, the obvious flag, still gets the reset into the bootloader in either mode.- Flashing after a passive session. After such passive sessions, flashing sometimes failed with "Timeout while running ReadReg" until the board was reset;
espflash flash --monitorin 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
- Document the passive combination in
espflash monitor --help(the--no-resetand--beforetexts) and in the README, including that--chipis required with--before no-reset-no-sync. - Make
--no-resetmean "do not reset the chip" independently of--non-interactive: imply--before no-reset-no-sync(and require--chip). If changing the meaning of--no-resetis not wanted, a--passiveshorthand for the combination would do. Either way, the passive path could skipdetect_sdmand the register reads indevice_info(), since nothing answers them: that removes the pause and the false "Secure Download Mode is enabled" warning. - 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 --monitorin one connection, when a reflash is acceptable.
Additional context
- OS: macOS
- espflash version: 4.7.0; the code references are to
mainat 95d8380 - Target: ESP32-P4 (rev v1.3, M5Stack Tab5), USB-Serial-JTAG
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReview
Activity
MabezDev commentedon Nov 23, 2026
Yes.
--no-resetonly skips the reset after connect, and only in non-interactivemonitor, so a passive watch still needs--before no-reset-no-sync. Could we document that, and make--no-resetcover the connect-time reset too?wackazong commentedon Nov 24, 2026
Yes, I'll open a PR for both:
--no-resetand--beforehelp texts and the README describe the passive combination, including that--chipis required with--before no-reset-no-sync.espflash monitor --no-reset(andcargo espflash monitor --no-reset) implies--before no-reset-no-syncin interactive and non-interactive mode, and requires--chip.flash --monitor --no-resetkeeps its current meaning, since flashing needs the connect-time reset.One question on scope: with
--before no-reset-no-sync,Flasher::connectstill runsdetect_sdm, andserial_monitorthen callsdevice_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--chipdefaults or a flag), or would you prefer that separately?