Commit 246f906f authored by Adam Wujek's avatar Adam Wujek 💬

dev/flash: make sure the write is complete

It happened that sdbfs_open_id returned error after 2 consecutive adds to
the SFP database using storage_get_sfp function (behaviour not seen when using
shell commands).
It looks like the problem was that reads were started before writes were
finished.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent ee70aadd
......@@ -80,6 +80,11 @@ int flash_write(uint32_t addr, uint8_t *buf, int count)
}
bbspi_transfer(1,0);
/* make sure the write is complete */
while (flash_rsr() & 0x01) {
/* do nothing */
}
return count;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment