main: added detect_flash in SPI Mode and with a manufacturer

This commit is contained in:
Gwenhael Goavec-Merou 2025-05-24 07:50:51 +02:00
parent e135f1820b
commit ba48d53409
1 changed files with 4 additions and 1 deletions

View File

@ -305,7 +305,10 @@ int main(int argc, char **argv)
} else if ((args.prg_type == Device::WR_FLASH ||
args.prg_type == Device::WR_SRAM) ||
!args.bit_file.empty() || !args.file_type.empty()) {
target->program(args.offset, args.unprotect_flash);
if (args.detect_flash)
target->detect_flash();
else
target->program(args.offset, args.unprotect_flash);
}
if (args.unprotect_flash && args.bit_file.empty())
if (!target->unprotect_flash())