27
27
28
28
#include "mcuboot_priv.h"
29
29
30
- LOG_MODULE_REGISTER (mcuboot_dfu , LOG_LEVEL_DBG );
30
+ LOG_MODULE_REGISTER (mcuboot_dfu , LOG_LEVEL_INF );
31
31
32
32
/*
33
33
* Helpers for image headers and trailers, as defined by mcuboot.
@@ -305,10 +305,18 @@ bool boot_is_img_confirmed(void)
305
305
306
306
rc = boot_read_swap_state (fa , & state );
307
307
if (rc != 0 ) {
308
+ LOG_ERR ("boot_read_swap_state ERROR" );
308
309
return false;
309
310
}
310
311
312
+ LOG_INF ("boot_is_img_confirmed flash_area id: 0x%x offset: 0x%lx" , fa -> fa_id , fa -> fa_off );
313
+
314
+ LOG_INF ("boot_is_img_confirmed swap_state magic=0x%x swap_type=0x%x copy_done=0x%x image_ok=0x%x image_num=0x%x" ,
315
+ state .magic , state .swap_type , state .copy_done , state .image_ok , state .image_num );
316
+
311
317
if (state .magic == BOOT_MAGIC_UNSET ) {
318
+ LOG_INF ("boot_is_img_confirmed MAGIC UNSET, treating as CONFIRMED " );
319
+
312
320
/* This is initial/preprogramed image.
313
321
* Such image can neither be reverted nor physically confirmed.
314
322
* Treat this image as confirmed which ensures consistency
@@ -329,6 +337,8 @@ int boot_write_img_confirmed(void)
329
337
return - EIO ;
330
338
}
331
339
340
+ LOG_INF ("boot_write_img_confirmed flash_area id: 0x%x offset: 0x%lx" , fa -> fa_id , fa -> fa_off );
341
+
332
342
rc = boot_set_next (fa , true, true);
333
343
334
344
flash_area_close (fa );
0 commit comments