Forum Discussion

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

Copy user-file from EPCS4 to SDRAM

I boot both configuration and NIOS software from a EPCS4. Works fine, the flash programmer is doing a great job. I also define a character set (pixel map) that resides in the 8th (and upper) 64K block of my EPCS4, and the programmer says everything is OK. The only thing left to do is copy that datablock to SDRAM after booting the NIOS. I went through the HAL and found two macros that perform the initialization of the EPCS flash controller interface: ALTERA_AVALON_EPCS_FLASH_CONTROLLER_INSTANCE(name,dev) and ALTERA_AVALON_EPCS_FLASH_CONTROLLER_INIT(name, dev). The dev struct is filled with all the right numbers and I found that very encouraging. However the alt_epcs_flash_read(alt_flash_dev* flash_info, int offset, void* dest_addr, int length) also defined by the HAL gets stuck somewhere and does not exit. After debugging I found that a alt_avalon_spi_command is taking care of the communication with the EPCS instead of the - maybe obsolete - ASMI interface? Is this correct? And if it is, does anybody have some idea of why alt_epcs_flash_read locks up? Thanks in advance for any help.....

3 Replies

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

    If I clear understand you try to read/write to EPCS using your own program after booting.

    If yes, i can explain how to do it in details.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Dear AlexS,

    Please update me with the procedure how to store my own data on epcs device, I am using Cyclone II 2c20 device with epcs4 in active serial configuration, and a SRAM for NIOS II, I want to store sof file, NIOS II code (which is already tested) with my own data.

    If you have some sample code please update me with the same.

    Thanks.