src/gowin: GW5A/SPI flash: adding delay after erase flash and after SPI mode instruction. Seems fixed write error.
This commit is contained in:
parent
62ad3a3003
commit
0b59efcb42
|
|
@ -1144,18 +1144,22 @@ bool Gowin::dumpFlash(uint32_t base_addr, uint32_t len)
|
||||||
|
|
||||||
bool Gowin::prepare_flash_access()
|
bool Gowin::prepare_flash_access()
|
||||||
{
|
{
|
||||||
_jtag->setClkFreq(10000000);
|
|
||||||
|
|
||||||
if (!eraseSRAM()) {
|
if (!eraseSRAM()) {
|
||||||
printError("Error: fail to erase SRAM");
|
printError("Error: fail to erase SRAM");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_gw5a) {
|
if (is_gw5a) {
|
||||||
|
if (!eraseSRAM()) {
|
||||||
|
printError("Error: fail to erase SRAM");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
usleep(100000);
|
||||||
if (!gw5a_enable_spi()) {
|
if (!gw5a_enable_spi()) {
|
||||||
printError("Error: fail to switch GW5A to SPI mode");
|
printError("Error: fail to switch GW5A to SPI mode");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
usleep(100000);
|
||||||
} else if (!is_gw2a) {
|
} else if (!is_gw2a) {
|
||||||
if (!enableCfg()) {
|
if (!enableCfg()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1163,6 +1167,8 @@ bool Gowin::prepare_flash_access()
|
||||||
send_command(0x3D);
|
send_command(0x3D);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_jtag->setClkFreq(10000000);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue