From 08f30cdcce108b3b807341d121320f89693a0b5d Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Sat, 16 Feb 2019 14:15:56 +0100 Subject: [PATCH] Add some trace and final completion message --- prog_commands.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/prog_commands.c b/prog_commands.c index c1441d7..01572c7 100644 --- a/prog_commands.c +++ b/prog_commands.c @@ -204,11 +204,16 @@ int flash_target(struct part_desc* part, char* filename, int calc_user_code) printf("Invalid configuration, asked to use buffer out of RAM, aborting.\n"); return -1; } + if (trace_on) { + printf("flash size : 0x%08x, nb sectors : %d\n", part->flash_size, part->flash_nb_sectors); + } /* Calc write block size */ write_size = calc_write_size(sector_size, part->ram_buff_size); if (write_size == 0) { printf("Config error, I cannot flash using blocks of nul size !\nAborted.\n"); return -2; + } else if (trace_on) { + printf("write size : %d\n", write_size); } /* Just make sure flash is erased */ @@ -296,6 +301,10 @@ int flash_target(struct part_desc* part, char* filename, int calc_user_code) } } + if (ret == 0) { + printf("Done, binary has been written to internal flash.\n"); + } + free(data); return ret; } -- 2.43.0