File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed
Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88## [ Unreleased]
99
1010### Added
11+ - ` save-image ` now checks if the ELF contains the app descriptor (#920 )
1112
1213### Changed
1314
Original file line number Diff line number Diff line change @@ -336,8 +336,7 @@ fn flash(args: FlashArgs, config: &Config) -> Result<()> {
336336 // Read the ELF data from the build path and load it to the target.
337337 let elf_data = fs:: read ( build_ctx. artifact_path . clone ( ) ) . into_diagnostic ( ) ?;
338338
339- // Check if the ELF contains the app descriptor, if required.
340- if args. flash_args . image . check_app_descriptor . unwrap_or ( true ) {
339+ if args. flash_args . image . check_app_descriptor && args. format == ImageFormatKind :: EspIdf {
341340 check_idf_bootloader ( & elf_data) ?;
342341 }
343342
@@ -617,6 +616,10 @@ fn save_image(args: SaveImageArgs, config: &Config) -> Result<()> {
617616 let build_ctx = build ( & args. build_args , & cargo_config, args. save_image_args . chip ) ?;
618617 let elf_data = fs:: read ( & build_ctx. artifact_path ) . into_diagnostic ( ) ?;
619618
619+ if args. save_image_args . image . check_app_descriptor && args. format == ImageFormatKind :: EspIdf {
620+ check_idf_bootloader ( & elf_data) ?;
621+ }
622+
620623 // Since we have no `Flasher` instance and as such cannot print the board
621624 // information, we will print whatever information we _do_ have.
622625 println ! ( "Chip type: {}" , args. save_image_args. chip) ;
Original file line number Diff line number Diff line change @@ -263,8 +263,7 @@ fn flash(args: FlashArgs, config: &Config) -> Result<()> {
263263 // Read the ELF data from the build path and load it to the target.
264264 let elf_data = fs:: read ( & args. image ) . into_diagnostic ( ) ?;
265265
266- // Check if the ELF contains the app descriptor, if required.
267- if args. flash_args . image . check_app_descriptor . unwrap_or ( true ) {
266+ if args. flash_args . image . check_app_descriptor && args. format == ImageFormatKind :: EspIdf {
268267 check_idf_bootloader ( & elf_data) ?;
269268 }
270269
@@ -344,6 +343,10 @@ fn save_image(args: SaveImageArgs, config: &Config) -> Result<()> {
344343 . into_diagnostic ( )
345344 . wrap_err_with ( || format ! ( "Failed to open image {}" , args. image. display( ) ) ) ?;
346345
346+ if args. save_image_args . image . check_app_descriptor && args. format == ImageFormatKind :: EspIdf {
347+ check_idf_bootloader ( & elf_data) ?;
348+ }
349+
347350 // Since we have no `Flasher` instance and as such cannot print the board
348351 // information, we will print whatever information we _do_ have.
349352 println ! ( "Chip type: {}" , args. save_image_args. chip) ;
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ pub struct ImageArgs {
259259 pub mmu_page_size : Option < u32 > ,
260260 /// Flag to check the app descriptor in bootloader
261261 #[ arg( long, default_value = "true" , value_parser = clap:: value_parser!( bool ) ) ]
262- pub check_app_descriptor : Option < bool > ,
262+ pub check_app_descriptor : bool ,
263263}
264264
265265/// ESP-IDF image format arguments
You can’t perform that action at this time.
0 commit comments