gowin: Fix clk cycle after sending a command, don't read status register programSRAM sequence

This commit is contained in:
Gwenhael Goavec-Merou 2023-12-04 07:25:43 +01:00
parent 0dcd851187
commit fb587e73d8
1 changed files with 12 additions and 10 deletions

View File

@ -223,7 +223,7 @@ bool Gowin::detectFamily()
bool Gowin::send_command(uint8_t cmd) bool Gowin::send_command(uint8_t cmd)
{ {
_jtag->shiftIR(&cmd, nullptr, 8); _jtag->shiftIR(&cmd, nullptr, 8);
_jtag->toggleClk(5); _jtag->toggleClk(6);
return true; return true;
} }
@ -782,6 +782,7 @@ bool Gowin::eraseSRAM()
return false; return false;
} }
if (_mode == Device::FLASH_MODE) {
uint32_t status_reg = readStatusReg(); uint32_t status_reg = readStatusReg();
if (_verbose) if (_verbose)
displayReadReg("after erase sram", status_reg); displayReadReg("after erase sram", status_reg);
@ -790,9 +791,10 @@ bool Gowin::eraseSRAM()
return false; return false;
} else { } else {
printSuccess("DONE"); printSuccess("DONE");
return true;
} }
} }
return true;
}
inline void Gowin::spi_gowin_write(const uint8_t *wr, uint8_t *rd, unsigned len) { inline void Gowin::spi_gowin_write(const uint8_t *wr, uint8_t *rd, unsigned len) {
_jtag->shiftDR(wr, rd, len); _jtag->shiftDR(wr, rd, len);