引用: yuhe82 发表于 2018-10-11 10:20
我唯一能找到的芯片你列如:iNEMO惯性模块:三维加速度传感器和3D陀螺仪从STM。
我的猜测是,cysoftwarereset()导致引脚/硬件切换/改变从而完成擦除周期从NAND。对于NAND闪存芯片应该有一个数据表描述如何完成擦除序列:功率循环的可能吗?
谢谢你的回复,E.普拉特。
对不起,我弄错了。我使用的是W25M02GV,而不是LSM330TR。
http://www. WebLog.com /资源文件/W25M02GV%20RevB%200 70115PDF
我检查了删除顺序和电气特性。
该块擦除程序在SPI连接上发送擦除命令,当擦除未完成时,它继续读取擦除失败位。
我不知道为什么这个擦除程序只有在软件重置后才能完全运行。
在NAND电源打开后,我插入了足够的延迟。
如果英语中有一些错误,我想道歉。
空隙W25M02GY128KB阻塞酶(UTIN 16 PADADADR)
{
W25M02GXWrreEnEnable();/ /禁用写保护
CyDelay(1);
SPIMESPIUARTECURLXXBUFER();//清除RX缓冲区
SPIMESPIUARTECARTTXBUFER();//TURX TX缓冲区
UTI8Page=Page ADDR & gt;8页;//页地址
UTI8Page =(Page ADDR和0x00 FF);/ /页地址
CyDelay(1);
MimyCsScript写入(0);//NAND SPI芯片选择信号低
CyDelay(1);
SPMISPIPUARTWRITETXDATA(W25M02GY128KBX块擦除)和/块擦除命令
SPIMESPILARTWRITETXDATA(0x00);/虚拟时钟
SPMISPIXARTWRITETXDATA(/PAGE);/页地址
SPIMASPIOWARTWRITETXDATA(PAGEL);/页地址
同时(SPIML SPIUARTEGETRXBuffRsisie())= 4){}/ /等待发送完成
MimyCsScript写入(1);//NAND SPI芯片选择信号高
(1)
{
UITN8 STS3= 0x00;
STS3= W25M02GYRealStaseRealScript(0xC0);/ /用于擦除失败位的读状态寄存器3
如果((STS3&0x01)==(0和lt;& lt;0))
{
ErryLeDyx写(1);
CyDelay(20);
如果((STS3&0x04)==(1和lt;lt;2))/ /如果删除失败位为1
{
//到无限循环等待擦除完成
/如果不执行软件重置,请继续留在这里!!
}
否则,如果删除完成
{
返回;
}
}
}
}
以上来自于百度翻译
以下为原文
Thank you for your reply, e.pratt.
Sorry I made a mistake. I'm using W25M02GV, not LSM330TR.
https://www.winbond.com/resource-files/w25m02gv%20revb%20070115.pdf
I checked the delete sequence and the electrical characteristics.
This block erase program sends erase command on SPI connection, and it continue to read the erase failure bit while erase isn't complete.
I don't know why this erase program runs completely only after a software reset.
I inserted enough delay after NAND power is turned on.
If there are some mistakes in English, I'd like to apologize.
void W25M02G_128kbBlockErase(uint16 pageAddr)
{
W25M02G_WriteEnable(); //disable write protect
CyDelay(1);
SPIM_SpiUartClearRxBuffer(); //clear RX buffer
SPIM_SpiUartClearTxBuffer(); //clear TX buffer
uint8 pageH = pageAddr >> 8; //page address
uint8 pageL = (pageAddr & 0x00ff); //page address
CyDelay(1);
MEM_CS_Write(0); //NAND SPI Chip Select Signal Low
CyDelay(1);
SPIM_SpiUartWriteTxData(W25M02G_128KB_BLOCK_ERASE); //block erase command
SPIM_SpiUartWriteTxData(0x00); //dummy clock
SPIM_SpiUartWriteTxData(pageH); //page address
SPIM_SpiUartWriteTxData(pageL); //page address
while(SPIM_SpiUartGetRxBufferSize() != 4){} //wait for send complete
MEM_CS_Write(1); //NAND SPI Chip Select Signal High
while(1)
{
uint8 sts3 = 0x00;
sts3 = W25M02G_ReadStatusRegister(0xC0); //read status register3 for erase failure bit
if((sts3&0x01)==(0 << 0))
{
ERR_LED_Write(1);
CyDelay(20);
if((sts3&0x04)==(1 << 2)) //if delete failure bit is 1
{
//go to infinity loop to wait erase complete
//continue staying here if not execute software reset!!
}
else //else if delete is finished
{
return;
}
}
}
}
引用: yuhe82 发表于 2018-10-11 10:20
我唯一能找到的芯片你列如:iNEMO惯性模块:三维加速度传感器和3D陀螺仪从STM。
我的猜测是,cysoftwarereset()导致引脚/硬件切换/改变从而完成擦除周期从NAND。对于NAND闪存芯片应该有一个数据表描述如何完成擦除序列:功率循环的可能吗?
谢谢你的回复,E.普拉特。
对不起,我弄错了。我使用的是W25M02GV,而不是LSM330TR。
http://www. WebLog.com /资源文件/W25M02GV%20RevB%200 70115PDF
我检查了删除顺序和电气特性。
该块擦除程序在SPI连接上发送擦除命令,当擦除未完成时,它继续读取擦除失败位。
我不知道为什么这个擦除程序只有在软件重置后才能完全运行。
在NAND电源打开后,我插入了足够的延迟。
如果英语中有一些错误,我想道歉。
空隙W25M02GY128KB阻塞酶(UTIN 16 PADADADR)
{
W25M02GXWrreEnEnable();/ /禁用写保护
CyDelay(1);
SPIMESPIUARTECURLXXBUFER();//清除RX缓冲区
SPIMESPIUARTECARTTXBUFER();//TURX TX缓冲区
UTI8Page=Page ADDR & gt;8页;//页地址
UTI8Page =(Page ADDR和0x00 FF);/ /页地址
CyDelay(1);
MimyCsScript写入(0);//NAND SPI芯片选择信号低
CyDelay(1);
SPMISPIPUARTWRITETXDATA(W25M02GY128KBX块擦除)和/块擦除命令
SPIMESPILARTWRITETXDATA(0x00);/虚拟时钟
SPMISPIXARTWRITETXDATA(/PAGE);/页地址
SPIMASPIOWARTWRITETXDATA(PAGEL);/页地址
同时(SPIML SPIUARTEGETRXBuffRsisie())= 4){}/ /等待发送完成
MimyCsScript写入(1);//NAND SPI芯片选择信号高
(1)
{
UITN8 STS3= 0x00;
STS3= W25M02GYRealStaseRealScript(0xC0);/ /用于擦除失败位的读状态寄存器3
如果((STS3&AMP;0x01)==(0和lt;& lt;0))
{
ErryLeDyx写(1);
CyDelay(20);
如果((STS3&AMP;0x04)==(1和lt;lt;2))/ /如果删除失败位为1
{
//到无限循环等待擦除完成
/如果不执行软件重置,请继续留在这里!!
}
否则,如果删除完成
{
返回;
}
}
}
}
以上来自于百度翻译
以下为原文
Thank you for your reply, e.pratt.
Sorry I made a mistake. I'm using W25M02GV, not LSM330TR.
https://www.winbond.com/resource-files/w25m02gv%20revb%20070115.pdf
I checked the delete sequence and the electrical characteristics.
This block erase program sends erase command on SPI connection, and it continue to read the erase failure bit while erase isn't complete.
I don't know why this erase program runs completely only after a software reset.
I inserted enough delay after NAND power is turned on.
If there are some mistakes in English, I'd like to apologize.
void W25M02G_128kbBlockErase(uint16 pageAddr)
{
W25M02G_WriteEnable(); //disable write protect
CyDelay(1);
SPIM_SpiUartClearRxBuffer(); //clear RX buffer
SPIM_SpiUartClearTxBuffer(); //clear TX buffer
uint8 pageH = pageAddr >> 8; //page address
uint8 pageL = (pageAddr & 0x00ff); //page address
CyDelay(1);
MEM_CS_Write(0); //NAND SPI Chip Select Signal Low
CyDelay(1);
SPIM_SpiUartWriteTxData(W25M02G_128KB_BLOCK_ERASE); //block erase command
SPIM_SpiUartWriteTxData(0x00); //dummy clock
SPIM_SpiUartWriteTxData(pageH); //page address
SPIM_SpiUartWriteTxData(pageL); //page address
while(SPIM_SpiUartGetRxBufferSize() != 4){} //wait for send complete
MEM_CS_Write(1); //NAND SPI Chip Select Signal High
while(1)
{
uint8 sts3 = 0x00;
sts3 = W25M02G_ReadStatusRegister(0xC0); //read status register3 for erase failure bit
if((sts3&0x01)==(0 << 0))
{
ERR_LED_Write(1);
CyDelay(20);
if((sts3&0x04)==(1 << 2)) //if delete failure bit is 1
{
//go to infinity loop to wait erase complete
//continue staying here if not execute software reset!!
}
else //else if delete is finished
{
return;
}
}
}
}
举报