lattice: drop the limitation, for .bin, to write at offset > 0
This commit is contained in:
parent
6d1c51d0a4
commit
43caa612ca
|
|
@ -402,7 +402,7 @@ openFPGALoader [-b yourBoard] [-c yourCable] -m project_name/*.bit
|
||||||
##### bit
|
##### bit
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
openFPGALoader [-b yourBoard] [-c yourCable] -f project_name/*.bit
|
openFPGALoader [-b yourBoard] [-c yourCable] -f project_name/*.bit # or *.bin
|
||||||
```
|
```
|
||||||
|
|
||||||
##### mcs
|
##### mcs
|
||||||
|
|
|
||||||
|
|
@ -75,14 +75,11 @@ Lattice::Lattice(Jtag *jtag, const string filename, const string &file_type,
|
||||||
if (!_file_extension.empty()) {
|
if (!_file_extension.empty()) {
|
||||||
if (_file_extension == "jed" || _file_extension == "mcs") {
|
if (_file_extension == "jed" || _file_extension == "mcs") {
|
||||||
_mode = Device::FLASH_MODE;
|
_mode = Device::FLASH_MODE;
|
||||||
} else if (_file_extension == "bit") {
|
} else if (_file_extension == "bit" || _file_extension == "bin") {
|
||||||
if (prg_type == Device::WR_FLASH)
|
if (prg_type == Device::WR_FLASH)
|
||||||
_mode = Device::FLASH_MODE;
|
_mode = Device::FLASH_MODE;
|
||||||
else
|
else
|
||||||
_mode = Device::MEM_MODE;
|
_mode = Device::MEM_MODE;
|
||||||
} else if (prg_type == Device::WR_FLASH) {
|
|
||||||
// for raw bin to flash at offset != 0
|
|
||||||
_mode = Device::FLASH_MODE;
|
|
||||||
} else {
|
} else {
|
||||||
throw std::runtime_error("incompatible file format");
|
throw std::runtime_error("incompatible file format");
|
||||||
}
|
}
|
||||||
|
|
@ -418,13 +415,8 @@ bool Lattice::program_extFlash(unsigned int offset)
|
||||||
_bit = new McsParser(_filename, true, _verbose);
|
_bit = new McsParser(_filename, true, _verbose);
|
||||||
else if (_file_extension == "bit")
|
else if (_file_extension == "bit")
|
||||||
_bit = new LatticeBitParser(_filename, _verbose);
|
_bit = new LatticeBitParser(_filename, _verbose);
|
||||||
else {
|
else
|
||||||
if (offset == 0) {
|
|
||||||
printError("Error: can't write raw data at the beginning of the flash");
|
|
||||||
throw std::exception();
|
|
||||||
}
|
|
||||||
_bit = new RawParser(_filename, false);
|
_bit = new RawParser(_filename, false);
|
||||||
}
|
|
||||||
|
|
||||||
printInfo("Open file ", false);
|
printInfo("Open file ", false);
|
||||||
printSuccess("DONE");
|
printSuccess("DONE");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue