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++
12603 Discussions

Programming EPCS flash via Nios HAL API

Altera_Forum
Honored Contributor II
943 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
248 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.
0 Kudos
Altera_Forum
Honored Contributor II
248 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!
0 Kudos
Reply