Skip to content

Commit 1c9a47d

Browse files
committed
Merge branch 'main' into write-sync-fix
2 parents 5157803 + 00b8b03 commit 1c9a47d

34 files changed

Lines changed: 817 additions & 106 deletions

.github/workflows/hil.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ jobs:
107107
runner: esp32c6-usb
108108
port: uart
109109
host: armv7
110+
- soc: esp32c61
111+
runner: esp32c61-usb
112+
port: usb
113+
host: aarch64
114+
- soc: esp32c61
115+
runner: esp32c61-usb
116+
port: uart
117+
host: aarch64
110118
- soc: esp32h2
111119
runner: esp32h2-usb
112120
port: usb

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated during tests
22
*.bin
3+
!espflash/resources/bootloaders/*.bin
34

45
# Generated by Cargo
56
# will have compiled files and executables

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Support for binaries with INIT_ARRAY sections, which is needed for esp32p4 support. (#991)
1515
- Add sha256 calculation to match esptool generated binaries (#991)
1616
- Support flashing in secure download mode (#990, #1002)
17+
- Add ESP32-C61 chip support (#1009)
18+
- Added ESP32-P4 ROM ELFs (#1014)
19+
- Added ESP32-P4 rev < 300 bootloader (#1016)
20+
- USB VID/PID 303a:1001 is listed as known (#1022)
1721

1822
### Changed
1923

2024
### Fixed
2125

26+
- Fix compilation on Linux when no other dependency transitively enables `nix`'s `signal` feature (#1015)
27+
- Fix ROM ELFs (#1014)
2228
- Fix Windows connection issue by aligning reset sequence with `esptool` including RTS/DTR workaround (#999)
2329
- Fix board-info misreporting the crystal frequency of ESP32-C5 (#1005)
2430
- Fix `espflash flash` getting stuck on `Sync` command
31+
- Use `0x4000` flash write blocks in stub mode for better throughput (#1021)
32+
- [cargo-espflash]: Use CARGO_BUILD_TARGET environment variable in `cargo-espflash` if `--target` is not provided before falling back to the `target` from `config.toml` (#1024)
2533

2634
### Removed
2735

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Serial flasher utilities for Espressif devices, based loosely on [esptool.py](https://github.com/espressif/esptool/).
88

9-
Supports the **ESP32**, **ESP32-C2/C3/C5/C6**, **ESP32-H2**, **ESP32-P4**, and **ESP32-S2/S3**.
9+
Supports the **ESP32**, **ESP32-C2/C3/C5/C6/C61**, **ESP32-H2**, **ESP32-P4**, and **ESP32-S2/S3**.
1010

1111
## [cargo-espflash](./cargo-espflash/)
1212

cargo-espflash/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Cross-compiler and Cargo extension for flashing Espressif devices.
99

10-
Supports the **ESP32**, **ESP32-C2/C3/C5/C6**, **ESP32-H2**, **ESP32-P4**, and **ESP32-S2/S3**.
10+
Supports the **ESP32**, **ESP32-C2/C3/C5/C6/C61**, **ESP32-H2**, **ESP32-P4**, and **ESP32-S2/S3**.
1111

1212
<!-- omit in toc -->
1313
## Table of Contents

cargo-espflash/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![expect(unused_assignments)]
1+
#![allow(unused_assignments)]
22

33
use std::{
44
fmt::{Display, Formatter},

cargo-espflash/src/main.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use espflash::{
1717
flasher::FlashSize,
1818
image_format::{ImageFormat, ImageFormatKind, idf::check_idf_bootloader},
1919
logging::initialize_logger,
20-
target::{Chip, XtalFrequency},
20+
target::Chip,
2121
update::check_for_update,
2222
};
2323
use log::{LevelFilter, debug, info};
@@ -354,7 +354,10 @@ fn flash(args: FlashArgs, config: &Config) -> Result<()> {
354354
&args.flash_args.erase_data_parts,
355355
)?;
356356

357-
print_board_info(&mut flasher)?;
357+
let dev_info = print_board_info(&mut flasher)?;
358+
let detected_chip_revision = dev_info
359+
.revision
360+
.map(|(major, minor)| (major * 100 + minor) as u16);
358361
ensure_chip_compatibility(chip, Some(elf_data.as_slice()))?;
359362

360363
let mut flash_config = args.build_args.flash_config_args;
@@ -374,14 +377,15 @@ fn flash(args: FlashArgs, config: &Config) -> Result<()> {
374377
chip,
375378
target_xtal_freq,
376379
);
377-
let image_format = make_image_format(
380+
let image_format = make_image_format_with_chip_revision(
378381
&elf_data,
379382
&flash_data,
380383
args.format,
381384
config,
382385
Some(args.idf_format_args),
383386
build_ctx.bootloader_path,
384387
build_ctx.partition_table_path,
388+
detected_chip_revision,
385389
)?;
386390

387391
// If using ESP-IDF image format, check if we need to erase partitions.
@@ -402,22 +406,15 @@ fn flash(args: FlashArgs, config: &Config) -> Result<()> {
402406
if args.flash_args.monitor {
403407
let pid = flasher.connection().usb_pid();
404408

405-
// The 26MHz ESP32-C2's need to be treated as a special case.
406-
if chip == Chip::Esp32c2
407-
&& target_xtal_freq == XtalFrequency::_26Mhz
408-
&& monitor_args.monitor_baud == 115_200
409-
{
410-
// 115_200 * 26 MHz / 40 MHz = 74_880
411-
monitor_args.monitor_baud = 74_880;
412-
}
413-
409+
preprocess_monitor_args(chip, target_xtal_freq, &mut monitor_args);
414410
monitor_args.elf = Some(build_ctx.artifact_path);
415411

416-
let elfs = vec![elf_data.as_ref()];
412+
let elfs = load_monitor_elfs(Some(elf_data.as_ref()), &monitor_args, &dev_info)?;
413+
let elf_refs = elfs.refs();
417414

418415
monitor(
419416
flasher.into(),
420-
elfs,
417+
elf_refs,
421418
pid,
422419
monitor_args,
423420
args.connect_args.non_interactive,
@@ -432,9 +429,11 @@ fn build(
432429
cargo_config: &CargoConfig,
433430
chip: Chip,
434431
) -> Result<BuildContext> {
432+
let target_env = std::env::var("CARGO_BUILD_TARGET");
435433
let target = build_options
436434
.target
437435
.as_deref()
436+
.or_else(|| target_env.as_deref().ok())
438437
.or_else(|| cargo_config.target())
439438
.ok_or_else(|| NoTargetError::new(Some(chip)))?;
440439

espflash/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ update-informer = { version = "1.2", optional = true }
6565
libc = "0.2.174"
6666

6767
[target.'cfg(target_os = "linux")'.dependencies]
68-
nix = { version = "0.30", features = ["time"] }
68+
nix = { version = "0.30", features = ["signal", "time"] }
6969

7070
[features]
7171
default = ["cli"]

espflash/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
A library and command-line tool for flashing Espressif devices.
1010

11-
Supports the **ESP32**, **ESP32-C2/C3/C5/C6**, **ESP32-H2**, **ESP32-P4**, and **ESP32-S2/S3**.
11+
Supports the **ESP32**, **ESP32-C2/C3/C5/C6/C61**, **ESP32-H2**, **ESP32-P4**, and **ESP32-S2/S3**.
1212

1313
<!-- omit in toc -->
1414
## Table of Contents

espflash/resources/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,16 @@ CONFIG_ESPTOOLPY_FLASHSIZE_64MB=y
1010
CONFIG_ESPTOOLPY_FLASHSIZE="64MB"
1111
```
1212

13+
The `esp32p4-v0-bootloader.bin` was built using `v5.5.3` and the following configs:
14+
```
15+
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
16+
CONFIG_ESP32P4_REV_MIN_100=y
17+
```
18+
1319
The flasher stubs are taken from the `espressif/esptool` repository:
1420
https://github.com/espressif/esptool/tree/master/esptool/targets/stub_flasher/1
21+
22+
23+
The roms are taken from the (`esp-rom-elfs`)[https://github.com/espressif/esp-rom-elfs] repository. Expect for:
24+
- ESP32-P4 rev3: Was built from `esp-rom-elfs` gitlab merge request 30.
25+
- `esp32c5_rev100_rom.elf` and `esp32c61_rev100_rom.elf`: taken from release `20260313` of `esp-rom-elfs`: https://github.com/espressif/esp-rom-elfs/releases/tag/20260313

0 commit comments

Comments
 (0)