Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Can I use AM29lv160 flash direct in IDE ?

there is no AM29lv160 in the drop-down menu that maps the current flash component in SOPC.So i specify the size of the flash device:Address Width:20

Data Width:16

But when I run flash_tests.c, i always get "0"after the line"fd = alt_flash_open_dev(EXT_FLASH_NAME);" I can't use the flash.

I don't know what's the problem with me.Is there anyone that can help me?

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by cameral@Mar 13 2006, 09:37 PM

    there is no am29lv160 in the drop-down menu that maps the current flash component in sopc.so i specify the size of the flash device:address width:20

    data width:16

    but when i run flash_tests.c, i always get "0"after the line"fd = alt_flash_open_dev(ext_flash_name);" i can't use the flash.

    i don't know what's the problem with me.is there anyone that can help me?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=13400)

    --- quote end ---

    --- Quote End ---

    We use this chip in our design with a Cyclone EP1C6. I put in 20 for address and 16 for data and it works ok. There are a couple of things to keep in mind:

    - After hooking up addr, data and the three control lines make sure the other lines (reset, byte, etc.) of the chip are set to reasonable values.

    - If you are running your program out of flash you won&#39;t be able to open the flash device driver with alt_flash_open_dev. You can store your program in flash and then run out of RAM. If you want to run out of flash AND use the flash for data you&#39;ll have to move the programming routines into RAM, otherwise the program will crash when the flash chip gets switched to programming mode. You&#39;ll also have to bypass the check whether the program is in flash, which is in altera_avalon_cfi_flash.h (ALT_CFI_DEV_IN_USE macro). The setting where your program is running from is the "Program memory (.text)" setting in the system library properties.

    - If you have a chip ending in T (top booting) you&#39;ll have to rearrange the flash regions manually. The function alt_read_cfi_table doesn&#39;t figure out that the 160T is top booting so the regions are wrong. For the 160B everything is fine. I added a global variable called "forceTopBoot" which I set to 1 but at some point I&#39;ll rewrite the alt_read_cfi_table to correctly probe the chip for the boot sectors.

    The easiest way to figure out what&#39;s going on is stepping through the initialization with the debugger. Put a breakpoint on the call to ALTERA_AVALON_CFI_FLASH_INIT in alt_sys_init.c and see what happens.

    Hope that helps,

    Andrew