Add some trace and final completion message
authorNathael Pajani <nathael.pajani@ed3l.fr>
Sat, 16 Feb 2019 13:15:56 +0000 (14:15 +0100)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Sat, 16 Feb 2019 13:15:56 +0000 (14:15 +0100)
prog_commands.c

index c1441d7..01572c7 100644 (file)
@@ -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;
 }