S29JL032J70TFI020 bottom boot Flash component unable to erase/program Sector 0 and 1.

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

cross mob
Anonymous
Not applicable

We are working with S29JL032J60TFI010 bottom boot Flash component for one of our products.

The boot-loader code runs on an Atmel processor and uploads the firmware binary to the flash component.

The boot-loader works fine when we try to upload the firmware (erase and program) starting at sector 2.

However, we need to load the firmware starting at sector 0 . Same Erase/Program functions don't work for sector 0 and 1. From the datasheet it looks like Write Protect pin # 14 cannot be left floating so we tried connecting it to Vcc . But the sector erase operation still won't work on these two sectors.

Also, the  lld_StatusGetReg() function was not executed successfully and we were unable to get the status (protected/unprotected) of the two sectors.

Is there any way to ensure that sector 0 and 1 are not in the write protected state? or Another way to make the erase/program work for these two outermost sectors?

I will appreciate any inputs!

Thank you!

Mrinali

0 Likes
9 Replies
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Mrinali,

As per the datasheet (http://www.cypress.com/file/217481/download), S29JL032J60TFI010 is a top boot device (not bottom boot), please double check the MPN.

Could you please provide some more details about this issue?

1. Are you able to program/erase sectors other than sectors 0 and 1?

2. What is the data that you read from status register (lld_StatusGetReg())?

3. How many devices are having this issue? Are you observing it with all of the devices that you tested?

Thanks and Regards,

Sudheesh

0 Likes
Anonymous
Not applicable

Hi Sudheesh,

Thank you for responding. I really apologize for the error . The Flash we are using is this:

S29JL032J70TFI020,  (Bottom boot).

This is a replacement flash so we are in the process of updating our boot loader code accordingly. To answer your questions:

1. Are you able to program/erase sectors other than sectors 0 and 1?

Yes, we are able to erase and program sectors other than 0 and 1 (we were able to receive a valid checksum as well).

2. What is the data that you read from status register (lld_StatusGetReg())?

When I try to call lld_StatusGetReg() function, it is executed partially. I know this as I send characters to the serial terminal from inside the function.  Here is the modified function:

//START OF FUNCTION:

FLASHDATA lld_StatusGetReg

(

FLASHDATA *  base_addr,      /* device base address in system */

ADDRESS      offset          /* address offset from base address */

)

{

  FLASHDATA sector_protected = 0x0;

  FLASHDATA status_reg = 0x0000;

  DEVSTATUS status;

tx_when_ready('Q');

  status = lld_StatusGet(base_addr, offset);

tx_when_ready('Q');

  if(status == DEV_NOT_BUSY)

  {

      status_reg |= DEV_RDY_MASK;

  tx_when_ready('A');

  }

  else if(status == DEV_WRITE_BUFFER_ABORT) /* Can happen only because of failed program op*/

  {

    status_reg |= DEV_RDY_MASK;

    status_reg |= DEV_PROGRAM_MASK;

tx_when_ready('B');

// tx_when_ready('R');

  }

  else if(status == DEV_EXCEEDED_TIME_LIMITS) /* Can happen either by failed program or erase op */

  {

    status_reg |= DEV_RDY_MASK;

    status_reg |= DEV_PROGRAM_MASK;

    status_reg |= DEV_ERASE_MASK;

tx_when_ready('C');

  }

  else if(status == DEV_SUSPEND) /* Only erase suspend can be detected by DQ polling */

  {

    status_reg |= DEV_RDY_MASK;

    status_reg |= DEV_ERASE_SUSP_MASK;

tx_when_ready('D');

tx_when_ready('R');

  }

  if((status != DEV_BUSY) && (status != DEV_WRITE_BUFFER_ABORT))

  {

  /* find if sectior protected by reading autoselct offset 0x02*/

  tx_when_ready('E');

  lld_AutoselectEntryCmd(base_addr);

  offset &= ~(0xFF);

  #ifndef LLD_CONFIGURATION_X8X16_AS_X8

  #ifndef LLD_CONFIGURATION_X8_AS_X8

  offset |= 0x02;

  #else

  offset |= 0x04;

  #endif

  #else

  offset |= 0x04;

  #endif

  tx_when_ready('X');

  sector_protected = (FLASH_RD(base_addr, offset));

  tx_when_ready('F');

  lld_AutoselectExitCmd(base_addr);

  tx_when_ready('G');

  }

    if(sector_protected == 0x1)

    {

        status_reg |= DEV_SEC_LOCK_MASK;

tx_when_ready('P');

tx_when_ready('R');

    }

else{

tx_when_ready('U');

tx_when_ready('P');

}

    return status_reg;

}

//END OF FUNCTION

I receive Q, Q and an A (DEV_NOT_BUSY) on the serial terminal. When it reaches the function call :    lld_AutoselectEntryCmd(base_addr);  ,  It is able to execute first two write commands but gets stuck at the third write command:

FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_AUTOSELECT_CMD);  so no result is received from the function (hangs at this point).

3. How many devices are having this issue? Are you observing it with all of the devices that you tested?

At this time we are working on getting this to work so we can replace our existing flash component  (which is going obsolete now) with the Cypress Flash component. My understanding is this will happen on every PCB that is installed with this new flash component.

I will appreciate you input regarding the same. Please let me know if any details are required on my end.

Thank you!

Mrinali Lothey

0 Likes
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Mrinali,

1. Could you please let me know the value that you read from status register of our device?

2. As per your previous response the issue happens when you call lld_AutoselectEntryCmd() function. Could you please provide function definition for this function?

3.Please provide the log messages from serial terminal. It will help us to analyze the code.

4. Which is the flash device that you are trying to replace with Cypress flash?

Thanks and Regards,

Sudheesh

0 Likes
Anonymous
Not applicable

Hi Sudheesh,

Thank you for replying. To answer your questions:

  1.  There is no value read from lld_StatusGetReg() function as this function calls lld_AutoselectEntryCmd  function and hangs at that point.

  2. This is the definition for lld_AutoselectEntryCmd  function:

void lld_AutoselectEntryCmd(

FLASHDATA * base_addr          /* device base address in system */

)

{

  /* Issue Autoselect Command Sequence */

  FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_UNLOCK_DATA1);

  FLASH_WR(base_addr, LLD_UNLOCK_ADDR2, NOR_UNLOCK_DATA2);

  FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_AUTOSELECT_CMD);

}

3. The log messages are just characters sent from the bootloader code to mark the line of code being executed so those may not provide any information apart from the line       of code where the function hangs. Please let me know if you still need the log file and I will share it.

4. We are trying to replace AM29DL800BT70 flash component.

Please let me know if you need any other information on my end.

Thank you!

Mrinali Lothey

0 Likes
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Mrinali,

What does the function "tx_when_ready()"? Will it read or write any commands/data to flash device? Please provide the definition of this function also.

Thanks and Regards,

Sudheesh

0 Likes
Anonymous
Not applicable

Hi Sudheesh,

What does the function "tx_when_ready()"? Will it read or write any commands/data to flash device? Please provide the definition of this function also.

The function simply sends one character to the UART port. It is being used just for debug the program and identify the point where it stops execution or hangs.

Please let me know if you have any questions regarding the same.

Thank you for your help!

Mrinali Lothey

0 Likes
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Mrinali,

Please share the log file with us. I will help us to understand more about the code flow.

I did not see any log messages in function "lld_AutoselectEntryCmd", but in one of our previous response, you mentioned that the third write operation in this function hangs "FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_AUTOSELECT_CMD);". How did you identify this?

Please let us know what is the status value that you read using the function "status = lld_StatusGet(base_addr, offset);" (NOT lld_StatusGetReg).

Thanks and Regards,

Sudheesh

0 Likes
Anonymous
Not applicable

Hi Sudheesh,

I have attached the screen shot of the serial terminal that shows the characters received from the boot loader code. There is no file generated as such.

Below is the modified function that I am using (with tx_when_ready() calls).

/******************************************************************************

*

  • lld_AutoselectEntryCmd - Writes Autoselect Command Sequence to Flash

*

  • This function issues the Autoselect Command Sequence to device.

*

  • RETURNS: void

*

*/

void lld_AutoselectEntryCmd

(

FLASHDATA * base_addr /* device base address in system */

)

{

/* Issue Autoselect Command Sequence */

tx_when_ready('S');

FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_UNLOCK_DATA1);

tx_when_ready('T');

FLASH_WR(base_addr, LLD_UNLOCK_ADDR2, NOR_UNLOCK_DATA2);

tx_when_ready('U');

FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_AUTOSELECT_CMD);

tx_when_ready('A');

}

The "lld_StatusGet" function returns a 'DEV_NOT_BUSY' (an 'A' is returned to the serial terminal).

I can tell the function hangs at "FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_AUTOSELECT_CMD);" as I receive all the other characters (S, T , U). I don't receive an 'A' back, which is called after the "FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_AUTOSELECT_CMD);" statement.

The char 'A' received before receiving the 'S', 'T' & 'U' characters in the same sequence indicates 'DEV_NOT_BUSY' returned from "lld_StatusGet" function (attached in word document).

Please let me know if this helps. I appreciate your help with the same.

Thanks!

Mrinali Lothey

0 Likes
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Mrinali,

Sorry for the delay to get back to you. Are you still facing this issue?

If yes, please provide us the function definition for "FLASH_WR" function.

Thanks and Regards,

Sudheesh

0 Likes