S25FL064L of blank check command

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

cross mob
HiKu_1337496
Level 5
Level 5
Distributor - TED (Japan)
10 solutions authored 100 sign-ins 50 questions asked

HI,

Is there a blank check command for S25FL064L product, as in the GL-S/GL-T series?

If not, is there any firmware code that can be used as a reference for the user to create?

Best Regards,

Kumada

0 Likes
1 Solution
Apurva_S
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi Kumada san,

There are two ways in which this problem can be solved -

  1. The customer can maintain a lookup table for sectors which are programmed and erased. Whenever a sector is programmed or erased, the status of that particular sector should be updated in the look up table. Before programming any particular sector, the status for it should be checked in the look up table and then depending upon its status either the sector should be erased before programming or should be programmed directly.
  2. Before programming a particular sector, the entire sector should be read and stored in a buffer. Each byte of that buffer should be compared with FFh. Even if one byte is found to be mismatched the sector should be erased before reprogramming.

The steps to check whether a 4KB sector is erased or programmed are as follows -

  1. Read 4KB (4096 bytes) from a particular sector and store it in a buffer (rxBuffer).
  2. Compare each byte in the buffer with 0xFF.
  3. As soon as a mismatch is found, update a flag (temp).
  4. Depending upon the final status of the flag, decide to erase or program the sector.

Sample function -

#define EQUAL 1

#define NOT_EQUAL 0

int Blank_Check(uint8_t rxBuffer[])

{

    int temp = EQUAL;

    int i;

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

    {

        if(rxBuffer != 0xFF)

        {

            temp = NOT_EQUAL;   

            break;

        }

    }

    return(temp);

}

​Please let me know if you have any further queries.

Best Regards,

Apurva

View solution in original post

0 Likes
2 Replies
Apurva_S
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi Kumada san,

Unfortunately, there is no blank check command for S25FL064L device. The only way to check whether the sector is programmed or erased is to read the particular sector and compare each byte with FFh. If all bytes are FFh it means the sector is erased. However, even if one bit is found to be zero, it means the sector is programmed and needs to be erased before another program operation.

Please let me know if you need any further assistance from our side.

Best Regards,

Apurva 

0 Likes
Apurva_S
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi Kumada san,

There are two ways in which this problem can be solved -

  1. The customer can maintain a lookup table for sectors which are programmed and erased. Whenever a sector is programmed or erased, the status of that particular sector should be updated in the look up table. Before programming any particular sector, the status for it should be checked in the look up table and then depending upon its status either the sector should be erased before programming or should be programmed directly.
  2. Before programming a particular sector, the entire sector should be read and stored in a buffer. Each byte of that buffer should be compared with FFh. Even if one byte is found to be mismatched the sector should be erased before reprogramming.

The steps to check whether a 4KB sector is erased or programmed are as follows -

  1. Read 4KB (4096 bytes) from a particular sector and store it in a buffer (rxBuffer).
  2. Compare each byte in the buffer with 0xFF.
  3. As soon as a mismatch is found, update a flag (temp).
  4. Depending upon the final status of the flag, decide to erase or program the sector.

Sample function -

#define EQUAL 1

#define NOT_EQUAL 0

int Blank_Check(uint8_t rxBuffer[])

{

    int temp = EQUAL;

    int i;

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

    {

        if(rxBuffer != 0xFF)

        {

            temp = NOT_EQUAL;   

            break;

        }

    }

    return(temp);

}

​Please let me know if you have any further queries.

Best Regards,

Apurva

0 Likes