Author Topic: How to flash Nios code to NVM? Sof2flash tool fails in Quartus 18.1  (Read 3165 times)

Alexander K.

  • Active Member
  • *
  • Posts: 2
So far I've managed to flash sof files to EPC flash by creating the jic file.
But now I also want the elf file (generated by Nios gcc) also to be flashed into EPC flash.
Using Nios Programmer failes due to bug in sof2flash since 17.1 (related to cyclone 10)
There must be also other way:
I assume I've to add the hex file (converted from elf) to the "Convert Programming Files" tool.
Unfortunately the address where this hex file is placed seems to be wrong. The Nios application is not starting.
I'm basically using the provided Quartus design but added small Nios application.

Starting and debugging Nios application directly via Jtag works, so application itself is correct.

Alexander K.

  • Active Member
  • *
  • Posts: 2
Re: How to flash Nios code to NVM? Sof2flash tool fails in Quartus 18.1
« Reply #1 on: December 28, 2019, 11:35:50 AM »
So now it works finally.
From Nios Project Context menu select Make Targets... -> Build... (Shift+F9)
Select target mem_init_generate
This will create a hex file called "epcq_controller.hex" in "min_init" folder with small boot loader and your nios app included
Open "Convert Programming File" tool.
If this hex file is not already there, add by click on "Add Hex Data".
Leave "Big Endian" and "Absolute Address".
Select recently generated "epcq_controller.hex".
Click generate, open generated jic file using programmer.

or open following XML cof file with the conversion tool and replace with your files:

<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>