Thank you @kerryzhou for your reply. I followed your advice and the demo really seems to be what I was looking for.
Unfortunately, the demo does not work properly for me. It always ends on Nand_Flash_Init because the status is failed. I went to debug the code, and it always fails in fsl_semc_nand_flash.c in function semc_nand_get_onfi_timing_configure on line 223 in condition:
if (nandOnfiParameterConfig.signature == nandOnfiTag)
where nandOnfiTag is previously defined as:
nandOnfiTag = FOUR_CHAR_CODE('O', 'N', 'F', 'I')
The actual ONFI parameter configuration, that has just been read on the previous lines, is full of zeros instead of meaningful values. Yet the status of that read operation was OK.
This is a very strange issue. It seems to me that the NAND flash is alive, but giving strange data. Couldn't this be caused by some mistake in the demo?
For instance, these macros below confuse me. The first one is completely unused, the other 2 are used. And I have no idea where these values came from.
#define EXAMPLE_SEMC_START_ADDRESS (0x80000000U)
#define EXAMPLE_SEMC_NAND_AXI_START_ADDRESS (0x9E000000U)
#define EXAMPLE_SEMC_NAND_IPG_START_ADDRESS (0x00000000U)
Could you please think about what might be the cause and solution? I will be grateful for any help.
Thank you in advance. Best regards, Vojtech.