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.
Hi Pavan Kote,
From your test result, your nand flash should never work.
What's the board you are using now? Your own designed board?
Can you also share the nand flash connections to the RT1050 chip?
About the IS37SML01G01, we still don't have example about it, the reference manual for RT1050 just give the example for winbond W25N01GVZEIG.
Have a great day,
Kerry
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Hi Kerry Zhou,
I am using our MXMRT 1052 custom board. 1Gbit NAND FLASH.
The below screenshot represents NAND connection with harware.
As I am able to read Vendor ID and modify the status registers values.
At First i am getting Flash Erase and Page program Fail Status.
Default NAND Flash will lock all sectors and i am able to successfully remove protection.
Now i am able to erase the sector, program the Page.
But when i am reading the data i am getting garbage values.
I am using IP Command mode to communicate as reference took from NOR Code.
How to read the RX data from AHB cache or IP RX AHB Cache.
If you have any reference Please share the Serial NAND code it will be really helpful.
Have a great day,
Pavan Kote
Hi Pavan Kote,
Can you test the read FlexSPI bus wave on your side, then compare it with the IS37SML01G01 datasheet read timing, just check whether the data on the bus is correct or not.
About the nand flash code, I don't have it on my side, but I already help you check it from our internal side, still didn't find it, if I get any valuable information about it, I will let you know.
In the meanwhile, I suggest you check the flexspi bus wave with read command, if the bus readout data is correct, then we need to check the code side.
Have a great day,
Kerry
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Hi Kerry Zhou,
I uploaded "SerialNAND_CodeOverview_Document.txt" document in which i explain the configurations which i made and code which i use to erase, write and read. Please take a look and guide me how to resolve the Read Problem.
Kindly do the helpful,
Have a great day,
Kerry
Hi Pavan Kote,
Sorry for my later reply.
Could you also share the head file about the SPINAND_OP_BE,SPINAND_OP_PROGRAM_EXEC,SPINAND_OP_PAGE_READ etc.
I need to check your whole LUT table, just make sure it is correct or not.
About the read function, I suggest you refer to the SDK RT1050 :SDK_2.5.0_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\flexspi\nor\polling_transfer
This code read the address 0x600000000 directly, but at first, you must configure the customLUT correctly.
I think you can modify that code, and test it on your side.
You said, after you read the memory with your API function, some address is correct, and some is not correct, could you also share the latest read data with me?
Which data you think is correct, and which is not correct.
Have a great day,
Kerry
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Hi Kerry Zhou,
Now i am able to erase, write and read the data. But almost 60% data is invalid data read from cache.
What is the value for "columnspace" configuration. As i tried different values also include 12 and 13. But in 12 and 13 i am getting only even pages data with gradually garbage and good data.
How to configure and clear AHB RX buffer size.
If i want to read data from processor mapping how can i read the data.
In my board NOR is connected to A1 Port & NAND is connected to B1 Port.
What is the base address of B1.
Register Log:-
FLSHCR0[0] = 0x0
FLSHCR0[1] = 0x0
FLSHCR0[2] = 0x40000
FLSHCR0[3] = 0x0
Have a great day,
Pavan