Forum Discussion

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

Generic Tri-State Controller for CFI flash on terasic-de2-115

Hello All,

I'm trying to use the 8MB CFI flash of the terasic-de2-115 board. (I' using Quartus 13.0sp1)

I have added these three components in order to get the flash running:

Flash_generic_tristate_controller

^

|

|

tristate_conduit_pin_sharer

^

|

|

tristate conduit bridge

and configured the tristate controller the following way:

module assignments:

embeddedsw.configuration.hwClassnameDriverSupportList altera_avalon_lan91c111,altera_avalon_cfi_flash

embeddedsw.configuration.hwClassnameDriverSupportDefault altera_avalon_cfi_flash

embeddedsw.CMacro.SETUP_VALUE 60

embeddedsw.CMacro.WAIT_VALUE 160

embeddedsw.CMacro.HOLD_VALUE 60

embeddedsw.CMacro.TIMING_UNITS ns

embeddedsw.CMacro.SIZE 8388608u

embeddedsw.memoryInfo.MEM_INIT_DATA_WIDTH 8

embeddedsw.memoryInfo.HAS_BYTE_LANE 0

embeddedsw.memoryInfo.IS_FLASH 1

embeddedsw.memoryInfo.GENERATE_DAT_SYM 1

embeddedsw.memoryInfo.GENERATE_FLASH 1

embeddedsw.memoryInfo.DAT_SYM_INSTALL_DIR SIM_DIR

embeddedsw.memoryInfo.FLASH_INSTALL_DIR APP_DIR

connection point assignments:

embeddedsw.configuration.isFlash 1

embeddedsw.configuration.isMemoryDevice 1

embeddedsw.configuration.isNonVolatileStorage 1

I get the warning "Warning: cfi_flash: Properties (isFlash,isMemoryDevice,isNonVolatileStorage) have been set on interface uas - in composed mode these are ignored"

in QSYS. Regarding to the FAQ this one can be ignored?

When I download the bitstream to the target and use the "nios2-flash-programmer-gui" to write a file to the flash everything seems to work.

I'm also able to read the written data back from the flash and so I think that the wireing of the IP-Core and the timing is valid.

Now I want to access the flash with the standard HAL driver "altera_avalon_cfi_flash" and the standard flash functions like "alt_flash_open_dev, alt_write_flash, alt_read_flash"!

But sadly when I call the function alt_flash_open_dev I always get 0 returned. When I step into this function I see that the linked list from the llist module is empty.

So for me it seems that the flash is not recognized by the cfi flash driver. When I open my bsp settings file with the bsp editor and switch to the "Drivers" tab I see

that the "Driver Name" is set to none for my altera_generic_tristate_controller!

So my final question is why the bsp is not recognizing that I need the cfi_flash driver for my tristate controller? Do I need to add an additional prameter other than embeddedsw.configuration.hwClassnameDriverSupportDefault=altera_avalon_cfi_flash?

I have my tristate controller in a qsys subsystem where also the Nios2 processor is located! Can this be a problem?

I hope that somebody is able to help me.

best regards

Thomas

3 Replies

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

    After moving the tristate controller out of the qsys subsystem the driver is added and the function alt_flash_open_dev returns a valid pointer.

    It seems that quartus 13.0sp1 has a problem with submodules and tristate controllers. Is this a known issue?

    Anybody can tell if this problem is fixed in a later version of the toolchain?

    best regards

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

    --- Quote Start ---

    After moving the tristate controller out of the qsys subsystem the driver is added and the function alt_flash_open_dev returns a valid pointer.

    It seems that quartus 13.0sp1 has a problem with submodules and tristate controllers. Is this a known issue?

    Anybody can tell if this problem is fixed in a later version of the toolchain?

    best regards

    Thomas

    --- Quote End ---

    Hi Thomas,

    I am currently having the same problem, and I am using version 13.1.4. However, when you say you moved the tristate controller out of the qsys subsystem, where did you move it to? Was it deleted from your entire project? When you used alt_flash_open_dev to return this valid pointer, were you able to read and write to the flash correctly? Sorry for all of the questions, and thank you in advance.

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

    Thomas,

    I also have a problem like this. Could you expand on your solution a little bit more? What did you mean when you said you moved the tristate controller out of the qsys subsystem? Also, how did you get a tristate controller (CFI) with the correct control lines for the flash part on the DE2-115 board. I'm currently using that board trying to get flash up and running and when I build the tristate controller I don't get some of the control signals like WP and RST.