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 Sim