Strange behaviour with get feature command of NAND SPI Flash MX35LF1GE4AB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Strange behaviour with get feature command of NAND SPI Flash MX35LF1GE4AB

2,204 Views
l_volkmann
Contributor III

Hi,

on our custom board we are using the NOR flash MX25L6433F connected to port A1 for the application and the NAND flash MX35LF1GE4AB connected to port B1 for a read only database.
All SPI commands for the NOR flash are working as expected.
The same applies for the NAND flash except the get/set feature command.
If  I load and start the application via debugging interface and without configured NOR flash,
the  get/set feature command execution last about half a second.
If I flash the application via  the MCU BootUtility, the get/set feature command execution last the same and in addition I have to lock the global interrupt for that command, otherwise the processor reboots immidiatelly after triggering the FlexSPI command.

We are using the following chip configuration and LUT sequence:
  const flexspi_device_config_t deviceMX35LF1GE4ABconfig = {
      .flexspiRootClk = 104000000,
      .flashSize = 0x20000,
      .CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle,
      .CSInterval = 2,
      .CSHoldTime = 5,
      .CSSetupTime = 4,
      .dataValidTime = 0,
      .columnspace = 0,
      .enableWordAddress = 0,
      .AWRSeqIndex = 0,
      .AWRSeqNumber = 0,
      .ARDSeqIndex = 0,
      .ARDSeqNumber = 0,
      .AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle,
      .AHBWriteWaitInterval = 0,
  };
    /* 9 - Get Feature */
    /*[NAND_CMD_LUT_SEQ_IDX_GET_FEATURE*4]     = */
    FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR,       kFLEXSPI_1PAD, 0x0F,kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 8),
    /*[NAND_CMD_LUT_SEQ_IDX_GET_FEATURE*4+1]   = */
    FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_SDR,  kFLEXSPI_1PAD, 0x01,kFLEXSPI_Command_STOP,      kFLEXSPI_1PAD, 0),
    0,0,

    /* 10 - Set Feature */
    /*[NAND_CMD_LUT_SEQ_IDX_SET_FEATURE*4]     = */
    FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR,       kFLEXSPI_1PAD, 0x1F,kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 8),
    /*[NAND_CMD_LUT_SEQ_IDX_SET_FEATURE*4+1]   = */
    FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x01,kFLEXSPI_Command_STOP,      kFLEXSPI_1PAD, 0),
    0,0,

Has someone any idea what we are doing wrong ?
BR
Lutz




Labels (1)
0 Kudos
Reply
8 Replies

2,096 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Lutz,

I am double checking your thread with MACRONIX.

I will update here when there with any feedback.

Thanks for the patience.

best regards,

Mike

0 Kudos
Reply

2,096 Views
l_volkmann
Contributor III

Hi Mike,

in addition to my last reply, I've to mention that READ_FROM_CACHE

behaves the same as GET_FEATURE but not RANDOM_DATA_READ.

BR

Lutz

0 Kudos
Reply

2,096 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Lutz,

Sorry for the later reply.

Could you help to using scope measure the [get/set feature command] signals?

Besides of [get/set feature command], other command set operation as expected. Right?

best regards,

Mike

0 Kudos
Reply

2,096 Views
l_volkmann
Contributor III

Hi Mike,

thanks for your reply, but it did not work.

Fortunately we could fix this just now.

The reason was, that I mixed up instruction number and sequence number

when I started with FlexSpi.

Due to the fact, that it has worked for the NOR  and some NAND flash

commands, I've not double checked versus the processor manual until now.

Best Regards

Lutz

2,096 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Lutz,

Thanks for the info about this root cause was found.

best regards,

Mike

0 Kudos
Reply

2,096 Views
l_volkmann
Contributor III

Hi Mike,

do you mean  signal traces with an with an oscilloskop ?

I've only tried those commands I really need.

To check if workarounds are possible I I've tried some other commands in

the mean time but I'm still not through the whole list.

The following work as expected:

- READ ID (9Fh)

- PAGE READ (13h)

- RANDOM DATA READ(03h)

- WRITE ENABLE (06h)

- SET FEATURE(1Fh),( if GET FEATURE was executed before)

- BLOCK ERASE(D8h)

- PROGRAM LOAD(02h)

With following commands I#m faced with problems:

- GET_FEATURE (0Fh) , bus idle count about 8.800.000

- READ_FROM_CACHE(6B) , bus idle count in the same range as GET_FEATURE

- PROGRAM_EXECUTE(10h), bus idle count is about 440.000

- Internal ECC Status read (7Ch), I got this command not working,

FlexSpi bus seems to go stuck.

Best Regards

Lutz

0 Kudos
Reply

2,096 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Lutz,

I checked below LUT sequnce and make below modification:

our LUT sequence of "Get Feature"

/* 9 - Get Feature */
/*[NAND_CMD_LUT_SEQ_IDX_GET_FEATURE*4] = */
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x0F,kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 8),
/*[NAND_CMD_LUT_SEQ_IDX_GET_FEATURE*4+1] = */
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x01,kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),
0,0,

From the datasheet, the Get Feature timing is below:

pastedImage_1.png

I would recommend to use below LUT of Get Feature:

/* 9 - Get Feature */
/*[NAND_CMD_LUT_SEQ_IDX_GET_FEATURE*4] = */
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x0F,kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x04),

Please try it and let me know the result. Thanks.


Have a great day,
Mike

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

2,096 Views
l_volkmann
Contributor III

Hi Maik,

thanks for your support.

I like to let you know some more details, which might help to point me

the right direction to fix this issue.

Due to the startup behavior of other peripherals, we do not enable pin

muxing during startup but at the respective driver initialization.

So the flash driver init code is something like this:

      rc = flexspi_initDevice(spiAddr,); //-> Calls FLEXSPI_Init from

SDK driver

      if(rc != FLASH_RC::eFLASH_OK)

      {

        TRACE_ERR;

        return rc;

      }

      initFlashDevices(); //-> calls FLEXSPI_SetFlashConfig from SDK driver

      //enables pin muxing for port B1

      //if this is done before initFlashDevices(), the CPU goes stuck or

reboots

      BOARD_InitSpiFlash();

      flexspi_softwareReset(spiAddr); //calls FLEXSPI_SoftwareReset from

SDK driver

I also have added a counter to the bus idle loop in the transfer

blocking call:

    while (!FLEXSPI_GetBusIdleStatus(base))

    {

      count++;

    }

    PRINTF("count:%lu (%d)\r\n",count,(int)xfer->seqIndex);

For each sequence the counter is less than 10 except the GET_FEATURE

command sequence.

If the GET_FEATURE command sequence is executed after PAGE_READ, typical

values are about 8.800.000.

After BLOCK_ERASE or PROGRAM_EXECUTE typical values are about 450.000.

Best Regards

Lutz

0 Kudos
Reply