AnsweredAssumed Answered

Serial NAND FlexSPI Read Error

Question asked by Pavan Kote on Feb 21, 2019
Latest reply on Mar 12, 2019 by Kerry Zhou

Hi,

We are building a application for Serial NAND Flash(IS37SML01G01) 128MB on NXP1050 Board.
According to datasheet of NAND and Booloader reference example which we got from SDK we created the following LUT Table:-

Protocol:- FlexSPI
Port:- kFLEXSPI_PortB1


##################LUT TABLE###############################
//PAGE READ FROM MEM TO CACHE SDR 13h 3 0 0
[4 * NAND_CMD_LUT_SEQ_IDX_READ_PAGE] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPINAND_OP_PAGE_READ,kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), //0x18 24 bits

//PAGE READ FROM CACHE 03h, 0Bh 2 1 1 to 2112
[4 * NAND_CMD_LUT_SEQ_IDX_READ_CACHE_NORMAL] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x03, kFLEXSPI_Command_CADDR_SDR, kFLEXSPI_1PAD, 0x10), //0x10 16 bits (128/64/32/16/8/4/2/1)
[4 * NAND_CMD_LUT_SEQ_IDX_READ_CACHE_NORMAL + 1] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x80, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

 

######################CODE###################################
status_t flexspi_nand_flash_page_read(FLEXSPI_Type *base, uint32_t dstAddr, uint32_t *DstBuffer, uint32_t length)
{
status_t status;
flexspi_transfer_t flashXfer;
uint16_t jj = 0;
uint32_t DataBuffer[256];
//uint32_t DataBuffer1[SPINAND_PAGE_SIZE];

/* Prepare page read command from flash to cache*/
flashXfer.deviceAddress = dstAddr;
flashXfer.port = NAND_FLEXSPI_PORT;
flashXfer.cmdType = kFLEXSPI_Command;
flashXfer.SeqNumber = 1;
flashXfer.seqIndex = SPINAND_OP_PAGE_READ;
flashXfer.dataSize =(size_t)length;
// flashXfer.data = (uint32_t *)src;
// flashXfer.dataSize = FLASH_PAGE_SIZE;
status = FLEXSPI_TransferBlocking(base, &flashXfer);

if (status != kStatus_Success)
{
return status;
}

status = flexspi_nand_wait_bus_busy(base);
if (status != kStatus_Success)
{
return status;
}

/* Do software reset. */
FLEXSPI_SoftwareReset(EXAMPLE_FLEXSPI);
SysTick_DelayTicks(500U);

/* Prepare page read command from cache to Buffer*/
flashXfer.deviceAddress = dstAddr;
flashXfer.port = NAND_FLEXSPI_PORT;
flashXfer.cmdType = kFLEXSPI_Read;
flashXfer.SeqNumber = 1;
flashXfer.seqIndex = SPINAND_OP_READ_CACHE;
//flashXfer.data = DstBuffer;
flashXfer.data = (uint32_t *)&DataBuffer;
//flashXfer.dataSize = FLASH_PAGE_SIZE;
flashXfer.dataSize = (size_t)length;

status = FLEXSPI_TransferBlocking(base, &flashXfer);

if (status != kStatus_Success)
{
return status;
}

return status;
}

Log which i got from read:-
0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F 0x7F7F21C8 0x7F

 

 

After Prepare page read command from flash to cache command i tried
or

memset(DataBuffer, 0xFFU, sizeof(DataBuffer));
memcpy(DataBuffer, (void *)(EXAMPLE_FLEXSPI_AMBA_BASE + 8000000), length);
or

memset(DataBuffer, 0xFFU, sizeof(DataBuffer));
memcpy(DataBuffer, (void *)(EXAMPLE_FLEXSPI_AMBA_BASE + 0), length);

If we call the above command the application stucks.

 

 

How to get the Base Address which we connected B1 Port.

 

Please help us to solve this issue.

Outcomes