Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHow to use an EPCS Flash
Hallo together,
I'm actually trying to save data from NIOS II into an EPCS64 device. My system contains an EPCS controller. But now the confusion is complete, there are so many files for using an flash... and I'm not sure which to use. There are: - altera_avalon_epcs_flash_controller.h - sys\alt_flash.h - epcs_commands.h And all these headers include different read/write functions. Then I tried an example from the Internet to start.
static alt_flash_fd* epcs16_dev_ptr;
static flash_region *p_epcs_reg_info;
static int num_epcs_regs;
void epcs_open(void)
{
epcs16_dev_ptr = alt_flash_open_dev(EPCS_FLASH_CONTROLLER_NAME);
if (epcs16_dev_ptr == NULL)
{
alt_printf("** Can't open flash device **\n\n");
return;
}
alt_epcs_flash_get_info(epcs16_dev_ptr, &p_epcs_reg_info, &num_epcs_regs);
return;
} But to open the EPCS flash always fails. Is there something else to configure in the EPCS controller before start? Which header and functions are the right? Greets Sim47 Replies
- Altera_Forum
Honored Contributor
First of all make sure you configured epcs pins as Regular I/O, otherwise you could not use them after fpga has configured.
You find this in Quartus design assignments: device and pin options -> dual-purpose pins - Altera_Forum
Honored Contributor
- Altera_Forum
Honored Contributor
Your I/O configuration is correct.
Included headers and alt_flash_open_dev call are ok, too. Silly questions: - Is epcs correctly connected to fgpa and operating; namely, can you already configure fpga (and possibly boot Nios) from epcs? - Did you route signals from Nios epcs controller to i/o pins? - Altera_Forum
Honored Contributor
Yes to both questions. :)
I can boot from EPCS and the signals are connected to NIOS II processor. Greets - Altera_Forum
Honored Contributor
Try calling epcs_open() twice and look if you get the same error.
I remember I once had to use this workaround, although I can't remember what was the actual problem, neither if I fixed it. - Altera_Forum
Honored Contributor
I forgot to give maybe an important information, my flash device is no original altera epcs flash!
Could I access such an flash with an epcs controller? Had I maybe to use other functions (for cfi- flash or something)? Thanks. Sim - Altera_Forum
Honored Contributor
If you are talking about device like Numonyx M25P64 or something like that, the answer is "Yes you can...". I'm using ECPS controller with Numonyx M25P16.
CIao - Altera_Forum
Honored Contributor
--- Quote Start --- I forgot to give maybe an important information, my flash device is no original altera epcs flash! Could I access such an flash with an epcs controller? --- Quote End --- Then probably the hal driver is simply not recognizing the device id. What device are you using? I think you need to modify altera_avalon_epcs_flash_controller.c, adding the specific signature of your flash. - Altera_Forum
Honored Contributor
It is a Micron M25PE16.
- Altera_Forum
Honored Contributor
Does someone know if I can access this device with the epcs controller? Or had I to use an cfi controller?
But I will also load my software from flash and do remote update, so I need the epcs controller. Right? Greets