You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can flash a program onto my ESP32 once or twice with espflash, but after that, even if the chip is in download mode, it fails with the following message.
Error: espflash::connection_failed
× Error while connecting to device
╰─▶ Failed to connect to the device
help: Ensure that the device is connected and the reset and boot pins are not being held down
Then, without changing anything, when I try flashing the BareMinimum example with the Arduino IDE (esptool.py), it succeeds flashing. After that, if I restart the ESP32 in download mode, espflash successfully flashes the chip again.
Edit: It seems to happen that espflash still does not work after flashing with esptool.py. Though more often than not, after flashing with esptool.py, it works.
Reproduce
Flash any program onto the ESP32
Reboot to flash mode
Try to flash again. If that works, go to step 1. After a second try, it shouldn’t work anymore.
Context
Device: Ai Thinker ESP32 CAM
Target: xtensa-esp32-espidf
Flash command: espflash flash --monitor
Template: esp-idf-template
Logs
Cargo fail debug output
Finished `dev` profile [optimized + debuginfo] target(s) in 0.08s
Running `espflash flash --monitor target/cargo/xtensa-esp32-espidf/debug/laser-server`
[2024-07-12T06:52:39Z DEBUG] Flash(
FlashArgs {
connect_args: ConnectArgs {
after: HardReset,
baud: None,
before: DefaultReset,
chip: None,
confirm_port: false,
list_all_ports: false,
no_stub: false,
port: None,
},
flash_config_args: FlashConfigArgs {
flash_freq: None,
flash_mode: None,
flash_size: None,
},
flash_args: FlashArgs {
erase_parts: None,
erase_data_parts: None,
log_format: Serial,
monitor: true,
monitor_baud: None,
ram: false,
no_verify: false,
no_skip: false,
image: ImageArgs {
bootloader: None,
partition_table: None,
partition_table_offset: None,
target_app_partition: None,
min_chip_rev: 0,
},
},
image: "target/cargo/xtensa-esp32-espidf/debug/laser-server",
},
)
[2024-07-12T06:52:39Z DEBUG] connecting to crates.io:443 at 18.164.52.114:443
[2024-07-12T06:52:39Z DEBUG] No cached session for DnsName("crates.io")
[2024-07-12T06:52:39Z DEBUG] Not resuming any session
[2024-07-12T06:52:39Z DEBUG] Using ciphersuite TLS13_AES_128_GCM_SHA256
[2024-07-12T06:52:39Z DEBUG] Not resuming
[2024-07-12T06:52:39Z DEBUG] TLS1.3 encrypted extensions: [ServerNameAck]
[2024-07-12T06:52:39Z DEBUG] ALPN protocol is None
[2024-07-12T06:52:39Z DEBUG] created stream: Stream(RustlsStream)
[2024-07-12T06:52:39Z DEBUG] sending request GET https://crates.io/api/v1/crates/espflash/versions
[2024-07-12T06:52:39Z DEBUG] writing prelude: GET /api/v1/crates/espflash/versions HTTP/1.1
Host: crates.io
User-Agent: ureq/2.9.6
Accept: */*
accept-encoding: gzip
[2024-07-12T06:52:39Z DEBUG] Chunked body in response
[2024-07-12T06:52:39Z DEBUG] response 200 to GET https://crates.io/api/v1/crates/espflash/versions
[2024-07-12T06:52:40Z DEBUG] dropping stream: Stream(RustlsStream)
[2024-07-12T06:52:40Z DEBUG] Config: Config {
baudrate: None,
bootloader: None,
connection: Connection {
serial: None,
},
partition_table: None,
usb_device: [
UsbDevice {
vid: 1027,
pid: 24577,
},
],
flash: FlashSettings {
mode: None,
size: None,
freq: None,
},
save_path: "/home/victor/.config/espflash/espflash.toml",
}
[2024-07-12T06:52:40Z INFO ] Serial port: '/dev/ttyUSB0'
[2024-07-12T06:52:40Z INFO ] Connecting...
[2024-07-12T06:52:40Z DEBUG] Using UnixTight reset strategy with delay of 50ms
[2024-07-12T06:52:40Z DEBUG] Failed to reset, error Connection(
Timeout(
TimedOutCommand {
command: None,
},
),
), retrying
[2024-07-12T06:52:40Z DEBUG] Using UnixTight reset strategy with delay of 500ms
[2024-07-12T06:52:40Z DEBUG] Failed to reset, error Connection(
Timeout(
TimedOutCommand {
command: None,
},
),
), retrying
[2024-07-12T06:52:40Z DEBUG] Using Classic reset strategy with delay of 50ms
[2024-07-12T06:52:40Z DEBUG] Failed to reset, error Connection(
Timeout(
TimedOutCommand {
command: None,
},
),
), retrying
[2024-07-12T06:52:40Z DEBUG] Using Classic reset strategy with delay of 500ms
[2024-07-12T06:52:41Z DEBUG] Failed to reset, error Connection(
Timeout(
TimedOutCommand {
command: None,
},
),
), retrying
[2024-07-12T06:52:41Z DEBUG] Using UnixTight reset strategy with delay of 50ms
[2024-07-12T06:52:41Z DEBUG] Failed to reset, error Connection(
Timeout(
TimedOutCommand {
command: None,
},
),
), retrying
[2024-07-12T06:52:41Z DEBUG] Using UnixTight reset strategy with delay of 500ms
[2024-07-12T06:52:42Z DEBUG] Failed to reset, error Connection(
Timeout(
TimedOutCommand {
command: None,
},
),
), retrying
[2024-07-12T06:52:42Z DEBUG] Using Classic reset strategy with delay of 50ms
[2024-07-12T06:52:42Z DEBUG] Failed to reset, error Connection(
Timeout(
TimedOutCommand {
command: None,
},
),
), retrying
Error: espflash::connection_failed
× Error while connecting to device
╰─▶ Failed to connect to the device
help: Ensure that the device is connected and the reset and boot pins are not being held down
Cargo success output
Finished `dev` profile [optimized + debuginfo] target(s) in 0.08s
Running `espflash flash --monitor target/cargo/xtensa-esp32-espidf/debug/laser-server`
[2024-07-12T07:11:52Z INFO ] Serial port: '/dev/ttyUSB0'
[2024-07-12T07:11:52Z INFO ] Connecting...
[2024-07-12T07:11:52Z INFO ] Using flash stub
Chip type: esp32 (revision v3.1)
Crystal frequency: 40 MHz
Flash size: 4MB
Features: WiFi, BT, Dual Core, 240MHz, Coding Scheme None
MAC address: d8:13:2a:c2:0c:f0
App/part. size: 1,081,952/4,128,768 bytes, 26.21%
[00:00:01] [========================================] 17/17 0x1000
[00:00:00] [========================================] 1/1 0x8000
[00:01:07] [========================================] 641/641 0x10000 [2024-07-12T07:13:05Z INFO ] Flashing has completed!
Commands:
CTRL+R Reset chip
CTRL+C Exit
esptool.py v4.6
Serial port /dev/ttyUSB0
Connecting.....
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: d8:13:2a:c2:0c:f0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00050fff...
Compressed 18304 bytes to 12742...
Writing at 0x00001000... (100 %)
Wrote 18304 bytes (12742 compressed) at 0x00001000 in 0.6 seconds (effective 261.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 382.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 683.6 kbit/s)...
Hash of data verified.
Compressed 263728 bytes to 146215...
Writing at 0x00010000... (11 %)
Writing at 0x0001ba04... (22 %)
Writing at 0x00024aaa... (33 %)
Writing at 0x00029d28... (44 %)
Writing at 0x0002f090... (55 %)
Writing at 0x0003536c... (66 %)
Writing at 0x0003f91f... (77 %)
Writing at 0x00045c53... (88 %)
Writing at 0x0004b322... (100 %)
Wrote 263728 bytes (146215 compressed) at 0x00010000 in 3.5 seconds (effective 608.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
The text was updated successfully, but these errors were encountered:
Issue
I can flash a program onto my ESP32 once or twice with espflash, but after that, even if the chip is in download mode, it fails with the following message.
Then, without changing anything, when I try flashing the BareMinimum example with the Arduino IDE (esptool.py), it succeeds flashing. After that, if I restart the ESP32 in download mode, espflash successfully flashes the chip again.
Edit: It seems to happen that espflash still does not work after flashing with esptool.py. Though more often than not, after flashing with esptool.py, it works.
Reproduce
Context
espflash flash --monitor
Logs
Cargo fail debug output
Cargo success output
Cargo success debug output
Successful esptool.py output
The text was updated successfully, but these errors were encountered: