problem with S29GL128P

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
SuLu_3164261
Level 1
Level 1
Hi,

We are using S29GL128P in our system. Now, we have the problem while updating the data. We are storing our data in 2nd sector and 3rd sector and we are continuously rotating the data in between these two sectors. We are storing the information about the data being used in 1st sector.


We don't have any problem in storing the data and storing it in flash. After the data is full in 2nd sector, we delete the data in info sector and overwrite it with the new info data. Now the problem is that after deleting the info sector we are not able to write anything in that sector. Initially, we thought the delay in between erasing and writing is not enough but now it seems that it was not the issue. We are using lld_S29GLxxxP.c.



if((m->offsetSector+1)%TOTAL_DATA==0) {

     offset = 0;

      lld_SectorEraseOp(infoSector,0);

      DelayMicroseconds(1000);


      lld_ProgramOp(infoSector,offset,((m->sector+1)%2));

       DelayMicroseconds(20);


       lld_ProgramOp(infoSector,offset+1,(m->offsetSector=0));

       DelayMicroseconds(20);


       if (m->total >= 100) lld_ProgramOp(infoSector,offset+2,(m->total=100));

       else lld_ProgramOp(infoSector,offset+2,(m->total+1));

        DelayMicroseconds(20);


       lld_ProgramOp(infoSector,offset+3,4);

      DelayMicroseconds(20);


      lld_SectorEraseOp(infoSector,0);

      DelayMicroseconds(500);

}


else {

     lld_ProgramOp(infoSector,offset,(m->sector));

     DelayMicroseconds(10);


      lld_ProgramOp(infoSector,offset+1,(m->offsetSector+1));

       DelayMicroseconds(10);


      if (m->total >= 100) lld_ProgramOp(infoSector,offset+2,(m->total=100));

      else lld_ProgramOp(infoSector,offset+2,(m->total+1));

      DelayMicroseconds(10);


      lld_ProgramOp(infoSector,offset+3,(m->last+4));

       DelayMicroseconds(10);

}


We are only storing a single byte in one address, so the total number of data that can be stored in one sector is 512. Whenever we go inside the if loop then all the values stored in info sector is 0. Our else loop is running very fine. So do you need to do anything in between erasing and writing.


Regards

Subash Luitel



 

0 Likes
4 Replies
SuLu_3164261
Level 1
Level 1

sorry guys,

I am not using

      lld_SectorEraseOp(infoSector,0);

      DelayMicroseconds(500);

in the code. I think while pasting the code in discussion it somehow was there. I am erasing the data section in that line

      lld_SectorEraseOp(dataSector,0);

      DelayMicroseconds(500);

If I use lld_SectorEraseOp(infoSector,0); , it will erase the sector again after writing the data. it's obvious

0 Likes

Hi Subash,

Can you please provide a little more information  -

  • Is your GL-P device a new one or is it an old flash part? Is it possible that the device might have under gone excess number of program/erase cycles already?
  • Did you try using any other sector as info sector? Are you facing this issue in all/most of the sectors or just one particular sector?
  • How many devices are showing this issue?
  • What do you mean by 'delete the data in info sector'? Do you mean erase? If yes, can you please confirm whether the erase operation finished successfully? After a successful sector erase, all locations within the erased sector should contain FFFFh. You have mentioned "Whenever we go inside the if loop then all the values stored in info sector is 0". If erase operation completes successfully and program operation does not finish successfully, then as per my understanding the sector should contain all FFs and not 0.

Regards,

Apurva

0 Likes

Hi,

*

It has not gone through excess number of program/erase cycle

*

I have tried using three different sector as infosector and I have faced the same issue

*

I am testing in only one device now

*

I mean after deleting the data in info sector, program should write some values to that sector as shown in the code snippet. I mean program goes inside if loop and deletes the data but the program does not write anything as it should write as I am using lld_programOp() function. Erased sector contains FFFF but the data is not written.

0 Likes

Hi Subash,

Could you please modify your code to check the return value of all the lld APIs and proceed from one step to another only when the previous API return value is OK? This is will help us to narrow down to the exact step where your application is failing (erase or program).

- Apurva

0 Likes