diff --git a/client/flasher.c b/client/flasher.c index 675f123e8..94e2ef6ba 100644 --- a/client/flasher.c +++ b/client/flasher.c @@ -125,10 +125,16 @@ int main(int argc, char **argv) { if (res < 0) return -1; - PrintAndLogEx(NORMAL, "Available memory on this board: 0x%08x\n", chipid_to_mem_avail(chipid)); - + int mem_avail = chipid_to_mem_avail(chipid); + if (mem_avail != 0) { + PrintAndLogEx(NORMAL, "Available memory on this board: %uK bytes\n", mem_avail); + } else { + PrintAndLogEx(NORMAL, "Available memory on this board: "_RED_("UNKNOWN")"\n"); + PrintAndLogEx(ERR, _RED_("Note: Your bootloader does not understand the new CHIP_INFO command")); + PrintAndLogEx(ERR, _RED_("It is recommended that you update your bootloader") "\n"); + } PrintAndLogEx(SUCCESS, "\n" _BLUE_("Flashing...")); - +// TODO check if enough space on Pm3 mem to write the given files for (int i = 0; i < num_files; i++) { res = flash_write(&files[i]); if (res < 0) diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index cd129d3fc..8eef7e75d 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -542,7 +542,7 @@ typedef struct { /* Set if this device understands the extend start flash command */ #define DEVICE_INFO_FLAG_UNDERSTANDS_START_FLASH (1<<4) -/* Set if this device understands the extend start flash command */ +/* Set if this device understands the chip info command */ #define DEVICE_INFO_FLAG_UNDERSTANDS_CHIP_INFO (1<<5) /* CMD_START_FLASH may have three arguments: start of area to flash,