Altera_Forum
Honored Contributor
20 years agoProblem with Flash alt_flash_open_dev()
Problems with: alt_flash_open_dev()
I am running the memtest.c program that Altera provides with the Nios II IDE. It runs as expected when testing RAM but I have problems when testing Flash. If I select "Test CFI Flash" from the Menu and use the default Flash Device "/dev/ext_flash" it always returns: - ERROR: Could not open /dev/ext_flash I have looked thru this Forum and found a number of entries that are similar to my problem. But have not isolated my problem yet. ====== My System Info ==================== - Stratix II EP2S60 - NiosII using the altera avalon cfi flash Interface. - Using QuartusII 5.1/SP 0.15 and Nios2 5.1/Patch 001 - My system.h has: -# define EXT_FLASH_NAME "/dev/ext_flash" -# define ALT_TEXT_DEVICE EXT_SRAM -# define EXT_FLASH_TYPE "altera_avalon_cfi_flash" - The 'system library properties' for memtest.c do NOT have 'small C library' or 'reduced device drivers' selected. ======================================= I stepped thru the program and it appears that: - In the Function TestFlash: fd = alt_flash_open_dev(flashname); (flashname= "/dev/ext_flash") and fd is set = 0x0. - alt_flash_open_dev() calls alt_find_dev(). - alt_find_dev() exits with "return NULL". - I think alt_find_dev is looking thru a list (&alt_flash_dev_list) for the device "/dev/ext_flash". (and doesn't find it) Where is this list (alt_flash_dev_list) generated and how can I look at it? Any ideas why "/dev/ext_flash" would not be in the list? - At this point I don't think the Flash Device itself has been accessed. (ie: read or written ) Is this assumption correct? If I had a Flash H/W problem would the call to alt_find_dev() still work? Trying to isolate to either a S/W or a H/W problem. The Flash we are using is a CFI Flash Spansion S29GL256M. (replacement for a AM29LV256M) Any help you can provide is appreciated. Jim