Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12409 Discussions

Programming EPCS flash via Nios HAL API

Altera_Forum
Honored Contributor II
762 Views

Hi, 

I must be confused by the difference between the EPCS and parallel CFI type flash. I wrote programming software for the CFI but the EPCS API doesn't make sense to me. How do I query the system for info on the EPCS? There is only one EPCS per system but that doesn't simplify things. There is (i think) a user function, alt_epcs_flash_get_info() but its not making sense to me. Shouldn't I be able to send a pointer to an epcs flash structure to be filled out, or returned a pointer to a structure that I can read? 

 

My basic confusion is that I need to know the block size, etc. Yes, its on the data sheet but shouldn't I get this info from alt_epcs_flash_get_info() or something else. Also, the arguments for alt_epcs_flash_get_info() seem to be redundant. 

 

Thanks, 

greg
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
67 Views

Hi, 

there is a struct automaically initialized on initialization of your device, just before alt_main is called i think. 

You'll find the init in your BSP/alt_sys_init.c in function alt_sys_init() there the MAKRO  

ALTERA_AVALON_EPCS_FLASH_CONTROLLER_INIT ( EPCS_FLASH_CONTROLLER_0, epcs_flash_controller_0);  

should be caled, and therefore the struct epcs_flash_controller_0 is initialized. 

 

So for accesing the EPCS i use this structure, which works well for me.
Altera_Forum
Honored Contributor II
67 Views

Hi dtelrest, I was thinking the EPCS has a different software interface but I see now that it uses the same API as the CFI flash, so my existing code actually works! 

 

Thanks for the clarification!
Reply