Forum Discussion

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

Failed to open the flash device

Hi,

I want to read the flash thru the EPCS device.

The HAL alt_flash_open_dev() always returns 0.

When I debug/trace the this function call, it seems that the HAL system can not find such device.

Does any one know how I can fix this problem?

BTW:

The system.h does contain a defintion of the flash:# define EXT_FLASH_NAME "/dev/ext_flash"# define EXT_FLASH_TYPE "altera_avalon_cfi_flash"# define EXT_FLASH_BASE 0x00000000# define EXT_FLASH_SETUP_VALUE 40# define EXT_FLASH_WAIT_VALUE 160# define EXT_FLASH_HOLD_VALUE 40# define EXT_FLASH_TIMING_UNITS "ns"# define EXT_FLASH_UNIT_MULTIPLIER 1# define EXT_FLASH_SIZE 8388608# define EXT_FLASH_CONTENTS_INFO ""

Regards,

Kwok Wong

3 Replies

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

    Hello kwokwong,

    What kind of flash, board, Nios version are you using? There has been some trouble with 16 bit flashs in 8 bit mode. Please try to use the search function of the forum to get some hints. Let us know if you have solved the problem.

    Bye,

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

    kwokwong,

    I'm afraid your diagnosis is incorrect,

    The system.h snippet shows that you have a CFI flash in your system, NOT an EPCS. That would require a snippet like

    # define EPCS_CONTROLLER_NAME "/dev/epcs_controller"# define EPCS_CONTROLLER_TYPE "altera_avalon_epcs_flash_controller"# define EPCS_CONTROLLER_BASE 0x02100000# define EPCS_CONTROLLER_IRQ 5# define EPCS_CONTROLLER_DATABITS 8# define EPCS_CONTROLLER_TARGETCLOCK 20# define EPCS_CONTROLLER_CLOCKUNITS "MHz"

    Do you have one of these in your system?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by rugbybloke@Dec 8 2004, 05:10 AM

    kwokwong,

    i'm afraid your diagnosis is incorrect,

    the system.h snippet shows that you have a cfi flash in your system, not an epcs. that would require a snippet like

    # define epcs_controller_name "/dev/epcs_controller"# define epcs_controller_type "altera_avalon_epcs_flash_controller"# define epcs_controller_base 0x02100000# define epcs_controller_irq 5# define epcs_controller_databits 8# define epcs_controller_targetclock 20# define epcs_controller_clockunits "mhz"

    do you have one of these in your system?

    --- Quote End ---

    Thanks rugbybloke. I did confuse the external flash with the flash connected to the EPCS controller.

    I can now 'open' the /dev/epcs_controller device to read the flash!

    Regards,

    Kwok Wong