Skip to content

Commit 50946ce

Browse files
committed
Use the flasher stub by default
1 parent 3aee2b2 commit 50946ce

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cargo-espflash/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn flash(args: FlashArgs, config: &Config) -> Result<()> {
218218

219219
// The 26MHz ESP32-C2's need to be treated as a special case.
220220
let default_baud =
221-
if chip == Chip::Esp32c2 && !args.connect_args.use_stub && target_xtal_freq == 26 {
221+
if chip == Chip::Esp32c2 && args.connect_args.no_stub && target_xtal_freq == 26 {
222222
74_880
223223
} else {
224224
115_200

espflash/src/bin/espflash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn flash(args: FlashArgs, config: &Config) -> Result<()> {
160160

161161
// The 26MHz ESP32-C2's need to be treated as a special case.
162162
let default_baud =
163-
if chip == Chip::Esp32c2 && !args.connect_args.use_stub && target_xtal_freq == 26 {
163+
if chip == Chip::Esp32c2 && args.connect_args.no_stub && target_xtal_freq == 26 {
164164
74_880
165165
} else {
166166
115_200

espflash/src/cli/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::{
1515
path::{Path, PathBuf},
1616
};
1717

18-
use clap::{builder::ArgPredicate, Args};
18+
use clap::Args;
1919
use comfy_table::{modifiers, presets::UTF8_FULL, Attribute, Cell, Color, Table};
2020
use esp_idf_part::{DataType, Partition, PartitionTable};
2121
use indicatif::{style::ProgressStyle, HumanCount, ProgressBar, ProgressDrawTarget};
@@ -55,9 +55,9 @@ pub struct ConnectArgs {
5555
#[cfg(feature = "raspberry")]
5656
#[cfg_attr(feature = "raspberry", clap(long))]
5757
pub rts: Option<u8>,
58-
/// Use RAM stub for loading
59-
#[arg(long, default_value_ifs([("erase_parts", ArgPredicate::IsPresent, Some("true")), ("erase_data_parts", ArgPredicate::IsPresent, Some("true"))]))]
60-
pub use_stub: bool,
58+
/// Do not use the RAM stub for loading
59+
#[arg(long)]
60+
pub no_stub: bool,
6161
}
6262

6363
/// Configure communication with the target device's flash
@@ -254,7 +254,7 @@ pub fn connect(args: &ConnectArgs, config: &Config) -> Result<Flasher> {
254254
interface,
255255
port_info,
256256
args.baud,
257-
args.use_stub,
257+
!args.no_stub,
258258
)?)
259259
}
260260

@@ -303,7 +303,7 @@ pub fn serial_monitor(args: MonitorArgs, config: &Config) -> Result<()> {
303303

304304
// The 26MHz ESP32-C2's need to be treated as a special case.
305305
let default_baud = if chip == Chip::Esp32c2
306-
&& !args.connect_args.use_stub
306+
&& args.connect_args.no_stub
307307
&& target.crystal_freq(flasher.connection())? == 26
308308
{
309309
74_880

0 commit comments

Comments
 (0)