armink / SFUD

An using JEDEC's SFDP standard serial (SPI) flash universal driver library | 一款使用 JEDEC SFDP 标准的串行 (SPI) Flash 通用驱动库
MIT License
1.25k stars 444 forks source link

enable flash unprotected on init #47

Closed lanxb closed 3 years ago

lanxb commented 3 years ago

We need change the flash status to unprotected before write and erase operate,no matter what chip.write_mode

armink commented 3 years ago

这段修改有在哪些 Flash 上做过测试呢?

lanxb commented 3 years ago

test MX25L3206E

lanxb commented 3 years ago

There is no guarantee that the chips are completely new, and block protection may be enabled during use, so it should be removed at initialization
image

yangjie11 commented 3 years ago

测试未通过,硬件pandora,W25Q128 测试日志:

image

lanxb commented 3 years ago

我没使用QSPI,正常单线模式
STM32F105RC + MX25L3206E

lanxb commented 3 years ago

MX25L3206E硬件上WP和HOLD都直接上拉高电平了
W25Q128 有两个状态寄存器,不太一样
image

armink commented 3 years ago

或者读取到 MX25L3206E 系列的 ID 后特殊处理一下?

lanxb commented 3 years ago

手上没那么多 flash ,我这边加ID处理吧