-
Notifications
You must be signed in to change notification settings - Fork 147
Description
I am currently attempting to flash my ESP-32-s2 device using the esp-template
and espflash
tool. However, I am facing issues in getting the compiled binary to run successfully on my device. My initial problem was with resetting the device, as it was not resetting as expected compared to esptool.py. After several attempts, I discovered that setting -b no-reset
was necessary to initiate the flashing process successfully.
Even after flashing, my device does not boot up or display anything. I noticed that when I manually reset the device, the serial ports disappear.
$ cargo generate esp-rs/esp-template
$ CRATE_CC_NO_DEFAULTS=1 cargo build
$ cargo espflash flash -b no-reset --no-stub --monitor
[2024-03-25T22:53:49Z WARN ] Pre-connection option 'NoReset' was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
[2024-03-25T22:53:49Z INFO ] Detected 2 serial ports
[2024-03-25T22:53:49Z INFO ] Ports which match a known common dev board are highlighted
[2024-03-25T22:53:49Z INFO ] Please select a port
[2024-03-25T22:53:50Z INFO ] Serial port: '/dev/cu.usbmodem01'
[2024-03-25T22:53:50Z INFO ] Connecting...
Finished dev [optimized + debuginfo] target(s) in 0.23s
Chip type: esp32s2 (revision v0.0)
Crystal frequency: 40 MHz
Flash size: 4MB
Features: WiFi, Embedded Flash 4MB, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V1
MAC address: 84:f7:03:e8:6c:5e
App/part. size: 396,576/1,048,576 bytes, 37.82%
[2024-03-25T22:53:50Z INFO ] Segment at address '0x1000' has not changed, skipping write
[2024-03-25T22:53:50Z INFO ] Segment at address '0x8000' has not changed, skipping write
[2024-03-25T22:53:51Z INFO ] Segment at address '0x10000' has not changed, skipping write
[2024-03-25T22:53:51Z INFO ] Flashing has completed!
Commands:
CTRL+R Reset chip
CTRL+C Exit
Error: × Broken pipe
Click to expand Full logs
RUST_LOG=debug cargo espflash flash -b no-reset --no-stub --monitor
[2024-03-25T23:07:26Z DEBUG] Flash(
FlashArgs {
build_args: BuildArgs {
bin: None,
example: None,
features: None,
frozen: false,
locked: false,
package: None,
release: false,
target: None,
target_dir: None,
unstable: None,
flash_config_args: FlashConfigArgs {
flash_freq: None,
flash_mode: None,
flash_size: None,
},
},
connect_args: ConnectArgs {
after: HardReset,
baud: None,
before: NoReset,
chip: None,
confirm_port: false,
list_all_ports: false,
no_stub: true,
port: None,
},
flash_args: FlashArgs {
bootloader: None,
erase_parts: None,
erase_data_parts: None,
log_format: Serial,
min_chip_rev: 0,
monitor: true,
monitor_baud: None,
partition_table: None,
target_app_partition: None,
partition_table_offset: None,
ram: false,
no_verify: false,
no_skip: false,
},
},
)
[2024-03-25T23:07:26Z DEBUG] connecting to crates.io:443 at [2600:9000:2610:ac00:c:7ed3:240:93a1]:443
[2024-03-25T23:07:26Z DEBUG] No cached session for DnsName("crates.io")
[2024-03-25T23:07:26Z DEBUG] Not resuming any session
[2024-03-25T23:07:26Z DEBUG] Using ciphersuite TLS13_AES_128_GCM_SHA256
[2024-03-25T23:07:26Z DEBUG] Not resuming
[2024-03-25T23:07:26Z DEBUG] TLS1.3 encrypted extensions: [ServerNameAck]
[2024-03-25T23:07:26Z DEBUG] ALPN protocol is None
[2024-03-25T23:07:26Z DEBUG] created stream: Stream(RustlsStream)
[2024-03-25T23:07:26Z DEBUG] sending request GET https://crates.io/api/v1/crates/cargo-espflash/versions
[2024-03-25T23:07:26Z DEBUG] writing prelude: GET /api/v1/crates/cargo-espflash/versions HTTP/1.1
Host: crates.io
User-Agent: ureq/2.9.6
Accept: */*
accept-encoding: gzip
[2024-03-25T23:07:27Z DEBUG] Chunked body in response
[2024-03-25T23:07:27Z DEBUG] response 200 to GET https://crates.io/api/v1/crates/cargo-espflash/versions
[2024-03-25T23:07:27Z DEBUG] dropping stream: Stream(RustlsStream)
[2024-03-25T23:07:27Z DEBUG] Config: Config {
baudrate: None,
bootloader: None,
connection: Connection {
serial: None,
},
partition_table: None,
usb_device: [
UsbDevice {
vid: 12346,
pid: 2,
},
],
save_path: "/Users/tiburcio/Library/Application Support/rs.esp.espflash/espflash.toml",
}
[2024-03-25T23:07:27Z WARN ] Pre-connection option 'NoReset' was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
[2024-03-25T23:07:27Z INFO ] Detected 2 serial ports
[2024-03-25T23:07:27Z INFO ] Ports which match a known common dev board are highlighted
[2024-03-25T23:07:27Z INFO ] Please select a port
[2024-03-25T23:07:29Z INFO ] Serial port: '/dev/cu.usbmodem01'
[2024-03-25T23:07:29Z INFO ] Connecting...
[2024-03-25T23:07:29Z DEBUG] Writing command: Sync
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1073745920 }
[2024-03-25T23:07:29Z DEBUG] Attempting flash enable with: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 }
[2024-03-25T23:07:29Z DEBUG] Writing command: SpiAttach { spi_params: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 } }
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1061167128 }
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1061167136 }
[2024-03-25T23:07:29Z DEBUG] Writing command: WriteReg { address: 1061167128, value: 2415919104, mask: None }
[2024-03-25T23:07:29Z DEBUG] Writing command: WriteReg { address: 1061167136, value: 1879048351, mask: None }
[2024-03-25T23:07:29Z DEBUG] Writing command: WriteReg { address: 1061167144, value: 23, mask: None }
[2024-03-25T23:07:29Z DEBUG] Writing command: WriteReg { address: 1061167192, value: 0, mask: None }
[2024-03-25T23:07:29Z DEBUG] Writing command: WriteReg { address: 1061167104, value: 262144, mask: None }
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1061167128 }
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1061167192 }
[2024-03-25T23:07:29Z DEBUG] Writing command: WriteReg { address: 1061167128, value: 2147483840, mask: None }
[2024-03-25T23:07:29Z DEBUG] Writing command: WriteReg { address: 1061167136, value: 1879048192, mask: None }
[2024-03-25T23:07:29Z DEBUG] Flash detect OK!
[2024-03-25T23:07:29Z DEBUG] Writing command: SpiSetParams { spi_params: SpiSetParams { fl_id: 0, total_size: 4194304, block_size: 65536, sector_size: 4096, page_size: 256, status_mask: 65535 } }
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:29Z DEBUG] Writing command: ReadReg { address: 1061265492 }
[2024-03-25T23:07:29Z DEBUG] Writing command: SpiAttach { spi_params: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 } }
Finished dev [optimized + debuginfo] target(s) in 0.33s
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265492 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265516 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265476 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265480 }
Chip type: esp32s2 (revision v0.0)
Crystal frequency: 40 MHz
Flash size: 4MB
Features: WiFi, Embedded Flash 4MB, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V1
MAC address: 84:f7:03:e8:6c:5e
[2024-03-25T23:07:30Z DEBUG] Writing command: SpiAttach { spi_params: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 } }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265488 }
[2024-03-25T23:07:30Z DEBUG] Writing command: ReadReg { address: 1061265492 }
App/part. size: 396,576/1,048,576 bytes, 37.82%
[2024-03-25T23:07:30Z DEBUG] Writing command: FlashMd5 { offset: 4096, size: 21584 }
[2024-03-25T23:07:30Z INFO ] Segment at address '0x1000' has not changed, skipping write
[2024-03-25T23:07:30Z DEBUG] Writing command: FlashMd5 { offset: 32768, size: 3072 }
[2024-03-25T23:07:30Z INFO ] Segment at address '0x8000' has not changed, skipping write
[2024-03-25T23:07:30Z DEBUG] Writing command: FlashMd5 { offset: 65536, size: 396576 }
[2024-03-25T23:07:31Z INFO ] Segment at address '0x10000' has not changed, skipping write
[2024-03-25T23:07:31Z DEBUG] Using HardReset reset strategy
[2024-03-25T23:07:31Z INFO ] Flashing has completed!
Commands:
CTRL+R Reset chip
CTRL+C Exit
Click to expand esptool.py LOGS that are working
esptool.py --chip esp32s2 -p /dev/cu.usbmodem01 -b 460800 --before=no_reset --after=no_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader/bootloader.bin 0x10000 salmon.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.7.dev1
Serial port /dev/cu.usbmodem01
WARNING: Pre-connection option "no_reset" was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
Connecting...
Chip is ESP32-S2FH4 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V1
Crystal is 40MHz
MAC: 84:f7:03:e8:6c:5e
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00010000 to 0x00047fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 21888 bytes to 13918...
Writing at 0x00001000... (14 %)
Writing at 0x00002526... (28 %)
Writing at 0x00003181... (42 %)
Writing at 0x00003cd1... (57 %)
Writing at 0x00004740... (71 %)
Writing at 0x0000510d... (85 %)
Writing at 0x00005c33... (100 %)
Wrote 21888 bytes (13918 compressed) at 0x00001000 in 0.4 seconds (effective 460.3 kbit/s)...
Hash of data verified.
Compressed 227296 bytes to 125420...
Writing at 0x00010000... (1 %)
Writing at 0x0001118b... (3 %)
Writing at 0x000127d3... (4 %)
Writing at 0x00014109... (6 %)
Writing at 0x00015826... (8 %)
Writing at 0x000167e3... (9 %)
Writing at 0x00017d0b... (11 %)
Writing at 0x000190ea... (12 %)
Writing at 0x0001af34... (14 %)
Writing at 0x0001ca0d... (16 %)
Writing at 0x0001e202... (17 %)
Writing at 0x00020074... (19 %)
Writing at 0x00020bf2... (20 %)
Writing at 0x0002173a... (22 %)
Writing at 0x00022163... (24 %)
Writing at 0x00022bd0... (25 %)
Writing at 0x000235c3... (27 %)
Writing at 0x0002434f... (29 %)
Writing at 0x00024da2... (30 %)
Writing at 0x00025a50... (32 %)
Writing at 0x00026520... (33 %)
Writing at 0x00027245... (35 %)
Writing at 0x00027e1b... (37 %)
Writing at 0x00028951... (38 %)
Writing at 0x000293db... (40 %)
Writing at 0x00029f7d... (41 %)
Writing at 0x0002ab38... (43 %)
Writing at 0x0002b5be... (45 %)
Writing at 0x0002c1a5... (46 %)
Writing at 0x0002cc40... (48 %)
Writing at 0x0002d68f... (50 %)
Writing at 0x0002e173... (51 %)
Writing at 0x0002ed9e... (53 %)
Writing at 0x000303de... (54 %)
Writing at 0x00031005... (56 %)
Writing at 0x00031a3f... (58 %)
Writing at 0x0003248c... (59 %)
Writing at 0x0003324c... (61 %)
Writing at 0x000345b0... (62 %)
Writing at 0x00035a77... (64 %)
Writing at 0x000376fa... (66 %)
Writing at 0x00038314... (67 %)
Writing at 0x00038e78... (69 %)
Writing at 0x00039e22... (70 %)
Writing at 0x0003a9cd... (72 %)
Writing at 0x0003b457... (74 %)
Writing at 0x0003c066... (75 %)
Writing at 0x0003cb09... (77 %)
Writing at 0x0003d6a6... (79 %)
Writing at 0x0003e256... (80 %)
Writing at 0x0003ee2d... (82 %)
Writing at 0x0003f9d6... (83 %)
Writing at 0x000404c5... (85 %)
Writing at 0x00040ffa... (87 %)
Writing at 0x00041b1d... (88 %)
Writing at 0x000426de... (90 %)
Writing at 0x000432b6... (91 %)
Writing at 0x0004439b... (93 %)
Writing at 0x000451bb... (95 %)
Writing at 0x00045b1c... (96 %)
Writing at 0x000466fb... (98 %)
Writing at 0x0004742a... (100 %)
Wrote 227296 bytes (125420 compressed) at 0x00010000 in 1.9 seconds (effective 944.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 388.7 kbit/s)...
Hash of data verified.
Leaving...
Staying in bootloader.
Done
Os: MacOS
espflash Version: 3.0.1-dev
Metadata
Metadata
Assignees
Labels
Type
Projects
Status