ice40: add support for verify and dump

This commit is contained in:
Gwenhael Goavec-Merou
2021-06-26 08:43:02 +02:00
parent fb8f50cb52
commit 98a2e836fa
3 changed files with 93 additions and 4 deletions
+9 -1
View File
@@ -194,7 +194,15 @@ int main(int argc, char **argv)
} else if (board->manufacturer == "lattice") {
Ice40 target(spi, args.bit_file, args.file_type,
board->reset_pin, board->done_pin, args.verify, args.verbose);
target.program(args.offset);
if (args.prg_type == Device::RD_FLASH) {
if (args.file_size == 0) {
printError("Error: 0 size for dump");
} else {
target.dumpFlash(args.bit_file, args.offset, args.file_size);
}
} else {
target.program(args.offset);
}
} else {
RawParser *bit = NULL;
if (board->reset_pin) {