Cypress技术william hill官网
直播中

张宇

7年用户 1633经验值
私信 关注
[问答]

电源打开时执行软件重置的任何方法?

大家好。
我使用CYBLY-012011-00,当电源接通时,我可以执行软件复位吗?
我编写了控制NAND闪存(LSM330TR)的程序,但在打开电源后,没有执行软件重置,CySualARESETE(),就不能执行块擦除命令。
NAND处于未受保护模式。
有谁能帮我解决这个问题吗?

以上来自于百度翻译


     以下为原文
  Hello everyone.
I'm using CYBLE-012011-00, can I execute software reset when the power is turned on?
I wrote program that control NAND flash memory(LSM330TR) but I couldn't execute block erase command without execute software reset, CySoftwareReset() after the power is turned on.
The NAND is in un protected mode.
Can anyone help me solve this problem?

回帖(3)

黎歆俭

2018-10-11 15:58:05
我唯一能找到的芯片你列如:iNEMO惯性模块:三维加速度传感器和3D陀螺仪从STM。
我的猜测是,cysoftwarereset()导致引脚/硬件切换/改变从而完成擦除周期从NAND。对于NAND闪存芯片应该有一个数据表描述如何完成擦除序列:功率循环的可能吗?

以上来自于百度翻译


     以下为原文
  I can only find the chip you listed as: iNEMO inertial module: 3D accelerometer and 3D gyroscope from STM.
My guess is that the CySoftwareReset() is causing some pins/hardware to toggle/change which in turn finishes the erase cycle from your NAND. The flash chip for the NAND should have a datasheet describing how to finish the erase sequence: power cycle probably?
举报

张宇

2018-10-11 16:09:37
引用: 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;
            }
        }
    }
}
举报

黎歆俭

2018-10-11 16:24:38
引用: dfgsdf 发表于 2018-10-11 10:32
谢谢你的回复,E.普拉特。
对不起,我弄错了。我使用的是W25M02GV,而不是LSM330TR。
http://www. WebLog.com /资源文件/W25M02GV%20RevB%200 70115PDF

我的猜测是,它正确地用于擦除和检查RX字节计数达到4或W25M02GYRealStaseRealSt登记(0xC0)的方法;命令不工作,导致芯片处于无限等待中。然后重置将从无限循环中退出,回到“主擦除”,在“重置”芯片之前,“擦除”被“完成”。
CS的高触发触发擦除,复位CyPress芯片将导致CS引脚走高。因此,这就是我的调查方向。
SPIMESPIRTARGETRXBuffResiZe()具有或不具有RX软件缓冲区启用的稍微不同的行为。试着打开/关上?
如果启用SPI中断并将RX FIFO级别设置为4,然后使用中断,则可以验证SPI是否正确发送所有字节。然而,最有可能的是SPI RX缓冲器正确返回4,但对双重检查并不有害。
尝试更换:
如果((STS3&AMP;0x04)==(1和lt;& lt;2))
用:
如果(!)(STS3&0x02)
以确保位在状态寄存器中排队。
此外,它可以是函数中的代码:W25M02GYRealStasuScript(0xC0);
无法正常工作并返回无效数据。

以上来自于百度翻译


     以下为原文
  My guess is that it is working properly for the erase and your method of checking the RX byte count getting to 4 or the W25M02G_ReadStatusRegister(0xC0); command are not working, causing the chip to sit in an infinite wait. A reset will then exit out of the infinite loop and go back to main with the "erase" being "completed" before you even reset the chip.
 
THE CS going high triggers the erase, and resetting the cypress chip will cause the CS pin to go high. Thus, that would be my direction of inquiry
 
SPIM_SpiUartGetRxBufferSize() has slightly different behavior with or without the RX software buffer enable. Try turning that on/off?
If you enable the SPI interrupts and set the RX FIFO level to 4, then use an interrupt, you can verify that the SPI is sending all of the bytes properly. Most likely the SPI RX buffer is properly returning 4 however, but it doesn't hurt to double check.
Try replacing:
if((sts3&0x04)==(1 << 2))
with:
if(!(sts3 & 0x02))
to make sure the bits are lining up in the status register.
Also, it could be your code in the function: W25M02G_ReadStatusRegister(0xC0);
is not working correctly and returns invalid data.
 
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分