Closed pu-cc closed 8 months ago
Applied. Thanks @pu-cc.
I have to check too but maybe the issue is related to the quad mode with a bad read and an flash's answer containing 0xff ?
Thank you, @trabucayre!
I does not seem that the status register is misread. 0x40
is QE bit:
write to flash
Jtag frequency : requested 10.00MHz -> real 10.00MHz
found 1 devices
index 0:
idcode 0x20000001
manufacturer colognechip
family GateMate Series
model GM1Ax
irlength 6
File type : cfg
c2 28 17 c2 read c22817c2
Detected: Macronix MX25R6435F 128 sectors size: 64Mb
RDSR : 40 <- here
WIP : 0
WEL : 0
BP : 0
TB : 0
SRWD : 0
00000000 00000000 00000000 40
We just did not return from SPIFlash::bp_to_len
if bp != 0, and later subtract to 0:
https://github.com/trabucayre/openFPGALoader/blob/1d276ebb9db52ccd1081fe5bc68bbdc47eeced23/src/spiFlash.cpp#L890
The fix mentioned in https://github.com/trabucayre/openFPGALoader/pull/447#discussion_r1525791830 solves the issues and with the current status everything is perfect for me. Thanks again!
This device was missing in spiFlashdb and is installed on the GateMate evaluation board.
MX25R6435F's status register contains a quad-enable bit.
If it is set,
SPIFlash::bp_to_len
incorrectly masks all sectors, even if no bp-bit is set. This fix seems obvious to me, but I don't have many boards to test this.