cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with NOR Flash W25Q512 cannot erase sector / chip

duchuylee
Associate II

Hello,
I have been trying to make a driver for the Winbond W25Q512JV, It's works normally ( I can read/write data, erase sector/chip, can write image as external flash loader with Touchgfx) until one day I could no longer erase sectors or full chips ( My chip has been erased no more than 100 times). When erasing, it doesn't report any errors, it just responds to a successful erase very quickly (~ 0.5s) , almost immediately (previously it took ~ 140 seconds to erase a full chip). When I read back these memory areas, they are not equal to 0xFF. I understand that erase has not been performed yet.
I checked by reading the registers status: reg1 = 0xFE, reg2 = 0x02, reg3 = 0x03 and compare with datasheet, it mean bit SRL = 0, SRP = 1, WEL = 1, TB = 1, BP[3-0] = 1 => My chip into protection state

duchuylee_1-1713893705439.png

duchuylee_0-1713893524850.png

I use STM32H723 on OSPI2 running with QSPI mode, how can i resolve this problem? please give me solution. Thank you for your help



11 REPLIES 11
SURATECH
Associate

Hi! I'm facing a similar problem. I accidentally set the CMP bit in StatusRegister2. I managed to perform a sequence of actions manually:

w25q_write_enable();

w25q_write_status_reg(2, 2);

It helped me. I hope this helps someone too. It remains a mystery how this problem happened. How do I make sure this doesn't happen again? After all, I wasn't doing anything unusual. I was doing a routine job debugging the firmware.

Perhaps needs a pullup on IO2 / #WP pin until QE set for 4-pin mode

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..