Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20677 Discussions

generate .jic file from .sof and .elf

ScottShin
New Contributor I
2,309 Views

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.)

 

0 Kudos
1 Solution
JohnT_Intel
Employee
2,255 Views

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.


View solution in original post

0 Kudos
5 Replies
JohnT_Intel
Employee
2,296 Views

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.


0 Kudos
ScottShin
New Contributor I
2,257 Views

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.

螢幕擷取畫面 2020-10-23 090104.png螢幕擷取畫面 2020-10-23 090723.png

螢幕擷取畫面 2020-10-23 093456.png螢幕擷取畫面 2020-10-23 094729.png

 螢幕擷取畫面 2020-10-23 090928.png

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.txt

result information:

program sof.flash result 

螢幕擷取畫面 2020-10-23 095734.png

program elf.flash result 

螢幕擷取畫面 2020-10-23 095906.png

Any advice, I will appreciate.

0 Kudos
JohnT_Intel
Employee
2,256 Views

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.


0 Kudos
ScottShin
New Contributor I
2,251 Views

Thanks, I solve the problem. although at first, it jumps out massage "exceed flash memory", but I change  SOF's property to compression.

0 Kudos
JohnT_Intel
Employee
2,249 Views

Hi,


Glad that you are able to resolved the issue. Feel free to file new forum if you have any other queries.


0 Kudos
Reply