Altera_Forum
Honored Contributor
17 years agoHow to convert NIOS2 SW file to HEX
I need to program a CFI Flash (NOT EPCS) device that is attached to my Cyclone2 with both the HW and SW images. It appears one method that fits my needs is to follow appnote an478 and create a flash POF from the hw image SOF and sw image ELF. Then use the default config to load a PFL design in the FPGA to allow me to write to the CFI Flash over the JTAG interface.
I think my problem is that I am assuming the SW image needs to be loaded into the "Convert Programming File" tool to create the POF (combines HW and SW image) but should be added as HEX data. I'm having trouble trying to convert my ELF file to HEX while being able to append the bootloader to the image (sw needs bootloader to transfer instructions from CFI Flash to external sdram). elf2hex does not allow the use of bootloader or offset address i've tried elf2flash, which does let me attach the bootloader, but then when I try the following command I get an error: nios2-elf-objcopy --input-target srec --output-target ihex sw.flash sw.hex error ":Interleave must be positive"