I'm trying to implement a dual NAND drive using an MT29F1G08. Drive N0 works ok, but drive N1 didn't work, even configuring it on File_Config.c. I try using finit(NULL) to initialize both drives, but checking on low level routine I found that NAND_DRV_CFG.DrvInst is always 0x00 (meaning that only drive N0 will start).
Find and open File_lib.c and take a look at line 524 - change the numeric zero to one. Your structure should look like this:
/* NAND Flash Configuration */ static NAND_FTL_CFG nand1_cfg = { /* NAND Flash Geometry */ { &nand1_dev.PgLay, NAND1_BLCNT, NAND1_PGCNT, NAND1_PGSZ, NAND_SEC_BLOCK (NAND1_PGCNT,NAND1_PGSZ), NAND_SEC_PAGE (NAND1_PGSZ), NAND_ADDR_CYCLES (NAND1_BLCNT,NAND1_PGCNT,NAND1_PGSZ), NAND1_SWECC, 1 },
Does this work for you?
Yes, this modification works for me. Thanks a lot. Actually the line number in MDK version 4.60 is 486. Why Keil doesn't provide a correction for this?
Probably you are the first one who discovered this problem... :)