Forum Discussion
Altera_Forum
Honored Contributor
19 years ago --- Quote Start --- originally posted by queisser@Jul 13 2006, 01:53 PM i'd like to add a firmware upgrade capability to my nios system. since the end user won't have a development system with jtag i'd like to add a way of reprogramming the epcs with fpga configuration and/or my application code.
my question: how do i reformat the programming files (e.g. sof) to program into the epcs with a call to the hal api? i imagine the flash api wants a memory buffer with the raw bytes in it but i'm not sure i understand exactly how the data is formatted in the epcs and how to generate that format starting with the sof file.
i'll start by reverse engineering what's in the epcs right now and comparing it to the various formats i can generate with the altera tools but i'm sure someone already knows the answer.
thanks,
andrew
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16876)
--- quote end ---
--- Quote End --- What I did to figure this out with CFI was erase the flash completely, use the flash programmer to program my design, and then dump the entire flash contents to a file and examine them with a hex editor. It turned out that all the flash programmer was doing was placing binary images of the flash files at the specified offsets in flash. For instance, if I specified that a CPU's reset address was 0x00100000 in flash, then the code I compiled for that CPU would be loaded at 0x00100000 in flash. SOF files were loaded at either 0x00800000 (user) or 0x00C00000 (factory). To get the binary images, search for a tool called srec2bin and run that on the flash files. I don't see why this would be any different with an EPCS device except for the code you'd use to get the data in and out.