Altera_Forum
Honored Contributor
21 years agoProgramming the EPCS
Hi All,
We found a problem in the AVALON HAL. We are using a CFI flash from Spansion, when registering the Flash, the code will put the flash into Query Mode several times in a row. This causes the Flash from Spansion to go back into Reset mode, and thus the registration fails. We have circumvented this, by removing the un-necessay line (*flash->write_command)(flash->dev.base_addr, 0x55, QUERY_MODE); However, since the Flash Programming tool, still doesn't work we have opted to create piece of code which will read a firmware off the USB and write it to the flash ( fortunately SRecord files are easy to parse ). The problem is that since the programming tool doesn't work, we are forced to use the same method to write the EPCS controllers flash/EEPROM/Whatever. I am uncertain about what functions I should use. Using the alt_flash_open_dev(EPCS_CONTROLLER); seems to work.. kinda.. I can open the flash, and reading the info also returns the correct information, reading from the flash is also done ok. However when writing, the alt_flash_write(...) function will hang, most of the time. Sometimes it will actually return, and I can proceed. I may be totally wrong here, perhaps I should use the alt_flash_epcs_dev epcs_flas; alt_epcs_flash_init (&epcs_flas); functions, but using these functions create a linker error (alt_epcs_flash_init is apparently not being compiled).. any pointers??