mirror of https://github.com/YosysHQ/icestorm.git
iceprog: Better reset of flash
If the flash was in a 'weird' mode (like CRM, QPI, ...), sending a continuous stream of 0xff should take it out of it. It looks like the previous code was trying to do that, but was only transferring 8 bits and then 2 bits which is way too short. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
792cef084a
commit
a7c42cd29b
|
|
@ -195,12 +195,10 @@ static void flash_read_id()
|
|||
|
||||
static void flash_reset()
|
||||
{
|
||||
flash_chip_select();
|
||||
mpsse_xfer_spi_bits(0xFF, 8);
|
||||
flash_chip_deselect();
|
||||
uint8_t data[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
flash_chip_select();
|
||||
mpsse_xfer_spi_bits(0xFF, 2);
|
||||
mpsse_xfer_spi(data, 8);
|
||||
flash_chip_deselect();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue