@@ -4,8 +4,8 @@ use clap::{IntoApp, Parser};
4
4
use espflash:: {
5
5
cli:: {
6
6
board_info, connect, flash_elf_image, monitor:: monitor, partition_table, save_elf_as_image,
7
- write_bin_to_flash, ConnectOpts , FlashConfigOpts , FlashOpts , PartitionTableOpts ,
8
- WriteBinToFlashOpts ,
7
+ serial_monitor , write_bin_to_flash, ConnectOpts , FlashConfigOpts , FlashOpts ,
8
+ PartitionTableOpts , WriteBinToFlashOpts ,
9
9
} ,
10
10
Chip , Config , ImageFormatId ,
11
11
} ;
@@ -36,6 +36,8 @@ pub enum SubCommand {
36
36
BoardInfo ( ConnectOpts ) ,
37
37
/// Save the image to disk instead of flashing to device
38
38
SaveImage ( SaveImageOpts ) ,
39
+ /// Open the serial monitor without flashing
40
+ SerialMonitor ( ConnectOpts ) ,
39
41
/// Operations for partitions tables
40
42
PartitionTable ( PartitionTableOpts ) ,
41
43
/// Writes a binary file to a specific address in the chip's flash
@@ -97,6 +99,7 @@ fn main() -> Result<()> {
97
99
match subcommand {
98
100
BoardInfo ( opts) => board_info ( opts, config) ,
99
101
SaveImage ( opts) => save_image ( opts) ,
102
+ SerialMonitor ( opts) => serial_monitor ( opts, config) ,
100
103
PartitionTable ( opts) => partition_table ( opts) ,
101
104
WriteBinToFlash ( opts) => write_bin_to_flash ( opts) ,
102
105
}
@@ -145,7 +148,7 @@ fn flash(opts: Opts, config: Config) -> Result<()> {
145
148
146
149
if opts. flash_opts . monitor {
147
150
let pid = flasher. get_usb_pid ( ) ?;
148
- monitor ( flasher. into_serial ( ) , & elf_data, pid) . into_diagnostic ( ) ?;
151
+ monitor ( flasher. into_serial ( ) , Some ( & elf_data) , pid) . into_diagnostic ( ) ?;
149
152
}
150
153
151
154
Ok ( ( ) )
0 commit comments