Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Copy user-file from EPCS4 to SDRAM

Altera_Forum
Honored Contributor II
1,122 Views

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.....

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
436 Views

Sorry, big mistake http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif . NULL pointer as destination parameter, didn&#39;t work at all. So: yes it is SPI now and it works stable.

0 Kudos
Altera_Forum
Honored Contributor II
436 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
436 Views

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.
0 Kudos
Reply