Forum Discussion
generate .jic file from .sof and .elf
I'm trying to generate .jic file from .sof and .elf that use Terasic's self-balancing car demo_nios_code practice. All .sof and .elf are not modified, but my .jic can't work like demo_batch_jic's .jic file. The programmer was also successful in my practice.
(tool: Quartus lite18.1 host PC: WIN10 Board: DE10-Nano)
I follow step like below:
1.turn .sof and .elf to .flash by instruction:
sof2flash --input=DE10_Nano_Bal.sof --output=hwimage.flash --epcs --verbose
elf2flash --input=DE10_Nano_bal.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose
2.turn both .flash to .hex by instruction:
nios2-elf-objcopy -I srec -O ihex hwimage.flash hwimage.hex
nios2-elf-objcopy -I srec -O ihex swimage.flash swimage.hex
3.open "convert programming file" GUI configure like the attached picture:
Hope anyone can give me some advice, I will appreciate it.
(I also attach my program file. it wasn't modified.)
Hi,
From the jic generation, I observed that you do not set the address for the hex file. I would recommend to set the address that you used based on your Quartus design.
5 Replies
- JohnT_Altera
Regular Contributor
Hi,
I wouldn't recommend converting the sof -> flash -> hex -> jic.
You should convert the nios II FW code to hex and when you are converting to JIC file then you can include both sof and the Nios II FW.
Please refer to https://www.intel.co.jp/content/dam/altera-www/global/en_US/kdb/rd11122013_865/nios-ii-boot-from-epcq-and-epcs-in-quartus-ii-13_0.pdf.
- ScottShin
Occasional Contributor
Hi sorry took it took long to reply to you.
I trying the way by the document. Added legacy_epcs_flash_controller in the Qsys, I also set Nios's reset_vector in epcs_flash_controller. then I convert the program file to .jic.
I program successfully, but my function didn't work. seem like Nios doesn't boot right.
That is my memory file.
Meanwhile, I also try the Nios2 flash programmer, but GUI has a problem that can't read the Epcs layout patch file. So I type instruction to implement the flash programmer in Nios2 commend shell , then I got information after both flash programmer instruction finish.
flash programmer instruction :
#sof transfer to flash
sof2flash --input="output_files/balcar_nios.sof" --output="software/balcar_soft_bsp/flash/balcar_nios_epcs_flash_controller_0.flash" --epcs
#program sof flash
nios2-flash-programmer "software/balcar_soft_bsp/flash/balcar_nios_epcs_flash_controller_0.flash" --base=0x1101000 --epcs --sidp=0x11020B0 --id=0x0 --timestamp=1603266025 --device=2 --instance=0 '--cable=DE-SoC on localhost [USB-1]' --program --erase-all --override=c:/nios2-flash-override.txt#elf transfer to flash
elf2flash --input="software/balcar_soft/balcar_soft.elf" --output="software/balcar_soft_bsp/flash/balcar_soft_epcs_flash_controller_0.flash" --epcs --after="software/balcar_soft_bsp/flash/balcar_nios_epcs_flash_controller_0.flash"#program elf.flash
nios2-flash-programmer "software/balcar_soft_bsp/flash/balcar_soft_epcs_flash_controller_0.flash" --base=0x1101000 --epcs --sidp=0x11020B0 --id=0x0 --timestamp=1603266025 --device=2 --instance=0 '--cable=DE-SoC on localhost [USB-1]' --program --override=c:/nios2-flash-override.txtresult information:
program sof.flash result
program elf.flash result
Any advice, I will appreciate.
- JohnT_Altera
Regular Contributor
Hi,
From the jic generation, I observed that you do not set the address for the hex file. I would recommend to set the address that you used based on your Quartus design.
- ScottShin
Occasional Contributor
Thanks, I solve the problem. although at first, it jumps out massage "exceed flash memory", but I change SOF's property to compression.
- JohnT_Altera
Regular Contributor
Hi,
Glad that you are able to resolved the issue. Feel free to file new forum if you have any other queries.