Forum Discussion
Writing EPCS64 Device For Remote Update
Hi,
I would like to use the Remote Update mode of Cyclone III device. I have achieved lots of things but I could not accomplish writing EPCS64. I want to write my factory image hw1+sw1 at base 0x00000000 and my application image hw2+sw2 at base 0x00200000 by using the tools in Quartus II 8.1 and Nios II 8.1 IDE but not using Nios II software tools of EPCS Flash Controller. I could write my two .sof file to EPCS64 device by combining them in .jig file by using Convert Programming Files tool. However, I could not write my .elf files. Could anyone help me about this issue? Thanks.19 Replies
- Altera_Forum
Honored Contributor
Hi Kevin and Slacker,
I have tried nios2-flash-programmer-gui to program the EPCS64 device. However, I could not find how I can program the second hw/sw pair to the base address 0x00200000. Do I have to modify the bootlooder in order to program the second pair? Thanks - Altera_Forum
Honored Contributor
Hi Omernuz,
You can use the stock Nios II Flash Programmer for programming your first flash SOF/ELF pair into flash, but for the second pair you'll need to know a bit more. You'd also have to modify the bootloader for the second pair or, like I've done in the past, just use a separate onchip memory for this bootloader. I can describe an approach for doing this, if you like, but I'd recommend reading the following AN (and, perhaps, playing with the source code) before that: http://www.altera.com/literature/an/an458.pdf Best Regards, slacker - Altera_Forum
Honored Contributor
The easiest way to get the NIOS II Flash Programmer working is using the GUI. I think there is a menu item for it in the Eclipse SBTs or you can run nios2-flash-programmer-gui from the console.
In the GUI, choose "New" on the File menu and then point it to your .sopcinfo file. Click the "Add..." button to add your sof and elf files. Click the "Start" button to program the flash. Before the Nios II Flash Programmer can work, you must already have the SOF file corresponding to the .sopcinfo file you used active in the FPGA. You can use the Nios II Programmer or the nios2-configure-sof command line to load the SOF file first. - Altera_Forum
Honored Contributor
Thanks, Kelvin one more question
How can I achieve programming hw1+sw1 and hw2+sw2 by using Nios II Flash Programmer? I have searched lots of document of Altera but I have not found the answer. - Altera_Forum
Honored Contributor
--- Quote Start --- Can I use Nios II Flash Programmer for writing flash both hw1+sw1 and hw2+sw2? --- Quote End --- Yes you can. - Altera_Forum
Honored Contributor
Hi Kevin,
Can I use Nios II Flash Programmer for writing flash both hw1+sw1 and hw2+sw2? - Altera_Forum
Honored Contributor
The more I think about it, I don't think the elf2hex utility will work for this purpose. I think elf2hex may only work when there is one simple section in your ELF file you are trying to convert. What you need is the entire object file in a format compatible with the boot loader.
Perhaps you could try elf2flash and then use srec_cat to convert the flash file to a hex file. Is there a reason you don't just use the Nios II flash programmer? That would probably be easier. - Altera_Forum
Honored Contributor
Thanks, Kevin
I have also tried it, but I could not convert my .elf file to .hex file. My code in The Nios II Command Shell for elf2hex is "$SOPC_KIT_NIOS2/bin/elf2hex" --base=0x001C664B --end=0x001CED0B --little-endian-mem --no-zero-fill --input="remote_with_nios.elf" --output="remote_with_nios.hex" --width=8 However, I have got only one line, in other words the hex file has not been created. Where is the problem? Thanks for your answer again. - Altera_Forum
Honored Contributor
I have never tried it, but if you convert your .elf files to .hex files first, I expect you should be able to add them in the Convert Programming Files dialog. There is a utility in the Nios console named "elf2hex" which may work for this.
An additional word of warning: the default EPCS boot loader will not be able to boot a software image other than the first hw+sw image at address 0.