This is Pushpa...
I am working on cyclone V SOC with NAND flash boot Baremetal application development. NAND boot is happening fine. I have a requirement to read NAND flash and compute the checksum of the image.
I am using the API's provided for NAND flash interface, below are the functions used by me in my program.
unsigned int WRITE_BUFFER, READ_BUFFER;
I am writing known 32 bytes checksum value into the above address and trying to read back the same. Program is going in interrupt polling loop when its executing the below function inside alt_nand_flash_page_read() function. It is getting stuck inside interrupt polling and not coming out of it and even sometimes if it comes out of this interrupt polling function also read values are 0x00 or 0xFF not the expected values.
res=alt_nand_poll_for_status_register(interrupt_status_register, ALT_NAND_INT_STATUS_TIME_OUT | ALT_NAND_INT_STATUS_LOAD_COMP);
Anything is missing out in our program???, need guidance on the same. Requesting you to provide any example for NAND flash read and write using the altera API's which may help us in resolving the issue soon.
Thanks for contacted us.
By referring to this,
Can you help me to get the status of alt_nand_flash_init, alt_nand_flash_page_write, and alt_nand_flash_page_read?
alt_nand_flash_init status code is ALT_E_SUCCESS
alt_nand_flash_page_write status code is also ALT_E_SUCCESS
alt_nand_flash_page_read status returns 0xFFFFFFFF
read operation is failing.
How to access the command, address and data registers of NAND flash as we do in case of other interfaces like QSPI flash, i can directly send read write commands to the device and it works also.
Where as in case of NAND flash, cyclone V datasheet does not explain much about accessing command, data and address registers. datasheet just explains what commands to send for particular operation but how to access those registers, so that we can do read write operation directly using the register addresses.gard