diff --git a/README.md b/README.md index 02602b0..f187c92 100644 --- a/README.md +++ b/README.md @@ -402,7 +402,7 @@ openFPGALoader [-b yourBoard] [-c yourCable] -m project_name/*.bit ##### bit ```bash -openFPGALoader [-b yourBoard] [-c yourCable] -f project_name/*.bit +openFPGALoader [-b yourBoard] [-c yourCable] -f project_name/*.bit # or *.bin ``` ##### mcs diff --git a/src/lattice.cpp b/src/lattice.cpp index f23ad7c..6dd6428 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -75,14 +75,11 @@ Lattice::Lattice(Jtag *jtag, const string filename, const string &file_type, if (!_file_extension.empty()) { if (_file_extension == "jed" || _file_extension == "mcs") { _mode = Device::FLASH_MODE; - } else if (_file_extension == "bit") { + } else if (_file_extension == "bit" || _file_extension == "bin") { if (prg_type == Device::WR_FLASH) _mode = Device::FLASH_MODE; else _mode = Device::MEM_MODE; - } else if (prg_type == Device::WR_FLASH) { - // for raw bin to flash at offset != 0 - _mode = Device::FLASH_MODE; } else { throw std::runtime_error("incompatible file format"); } @@ -418,13 +415,8 @@ bool Lattice::program_extFlash(unsigned int offset) _bit = new McsParser(_filename, true, _verbose); else if (_file_extension == "bit") _bit = new LatticeBitParser(_filename, _verbose); - else { - if (offset == 0) { - printError("Error: can't write raw data at the beginning of the flash"); - throw std::exception(); - } + else _bit = new RawParser(_filename, false); - } printInfo("Open file ", false); printSuccess("DONE");