3 Replies Latest reply on Jul 20, 2018 5:28 AM by user_3580241

    I am trying to erase but not function correctly on s25fl164K

      I read the drive of cypress, did what it told but the erase not work well, there is a big problem on this nor flash.

       

          CS_OFF;

          Delay();

          masterTxData[1] = 0x00;

          masterTxData[2] = 0x00;

          masterTxData[3] = 0x00;

          Escreve_NOR(0x90,4);

          Le_NOR(2);

          Delay();

          CS_ON;

          Delay();

       

          PRINTF("*** Fabricante/Device ID ***\n\n");

       

          for(i = 0;i < 2;i++)

          {

          PRINTF(" Dado %01i = %02X \n",i+1,masterRxData[i]);

          }

       

          PRINTF("\n");

       

          CS_OFF;

          Delay();

          Escreve_NOR(0x06,1);  //Write Enable

          Delay();

          CS_ON;

          Delay();

       

          CS_OFF;

          Delay();

          masterTxData[1] = 0x00;

          masterTxData[2] = 0x00;

          masterTxData[3] = 0x00;

          masterTxData[4] = 0x00;

          Escreve_NOR(0x20,5); //Erase Sector

          Delay();

          CS_ON;

       

          CS_OFF;

          Delay();

          Escreve_NOR(0x04,1); //Write Disable

          Delay();

          CS_ON;

          Delay();

       

          CS_OFF;

          Delay();

          Escreve_NOR(0x06,1);   //Write Enable

          Delay();

          CS_ON;

          Delay();

       

          CS_OFF;

          Delay();

          masterTxData[1] = 0x00;

          masterTxData[2] = 0x00;

          masterTxData[3] = 0x00;

          masterTxData[4] = 0x43;

          masterTxData[5] = 0xFD;

          masterTxData[6] = 0x4F;

          Escreve_NOR(0x02,7); //Writing 3 Datas

          Delay();

          CS_ON;

          Delay();

       

          PRINTF("*** Dados Gravados no endereco 0x000000 ***\n\n");

       

          for(i = 0;i < 3;i++)

          {

          PRINTF(" Dado gravado %01i = %02X \n",i+1,masterTxData[i+4]);

          }

       

          PRINTF("\n");

       

          CS_OFF;

          Delay();

          Escreve_NOR(0x04,1); //Write Disable

          Delay();

          CS_ON;

          Delay();

       

          delay_ms(1000);

       

          CS_OFF;

          Delay();

          masterTxData[1] = 0x00;

          masterTxData[2] = 0x00;

          masterTxData[3] = 0x00;

          Escreve_NOR(0x03,4); //Reading the 3 datas

          Le_NOR(3);

          Delay();

          CS_ON;

          Delay();

       

          PRINTF("*** Dados Lidos no endereco 0x000000 ***\n\n");

       

          for(i = 0;i < 3;i++)

          {

          PRINTF(" Dado gravado %01i = %02X \n",i+1,masterRxData[i]);

          }

       

          Delay();

       

      When I make 0xC7 chip erase, turn off the board, turn on, change to 0x20 it writes and i read the correct datas.

      Or when I make 0x20 and put Escreve_NOR(0x20,5); //Erase Sector, and then I change the program and put again

      Escreve_NOR(0x20,4; //Erase Sector but with 4 write and read correct. What is the problem with this NOR FLASH???? Anybody can help me, i read the driver but nothing works. I am thinking this NOR not work well. There is a big problem with this NOR. The commands 0x90 and 0x9F I send and read the data always