最近调试FPGA需要用到读写flash,本以为读写flash很简单,在测试板上跑通了一个demo后就放到ice40上,结果怎么都读不出来数据,经测试,是在擦除flash时,擦除完成后读取状态寄存器始终读取不到busy位为0,一开始以为是JTAG未取下的问题,经测试,并不是这个原因,后又考虑是否是因引脚复用的问题,经测试同样也不是。表现现象为:
1、擦除命令后读取状态寄存器,值为全1;
2、直接读取板上数据,值为全0;
3、FPGA上电可以从flash配置成功,但配置完成后去读写flash却不成功。
查询lattice手册:
上电时:The iCE40 SPI interface starts by driving SPI_SS Low, and then sends a Release from Power-down command to the SPI PROM, hexadecimal command code 0xAB.
配置数据接收完成后:To conserve power, the iCE40 device then optionally issues a final Deep Power-down command, hexadecimal command code 0xB9.
即FPGA上电配置后让flash睡眠了,所以配置完成后要去读写flash,得先发送唤醒命令。
Lattice FPGA ice40 读写配置flash需要先唤醒
最新推荐文章于 2025-03-06 23:24:30 发布