Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

NiosV

NGord
New Contributor I
377 Views

Hi I am in the process of converting a MAX10 Nios2 design to a MAX10 NiosV. It boots from Flash loaded into DDR

All is good with the compiling apart from I need to convert the elf file to a hex file.
Nios2 was done with Eclipse tools and it created the script


alt-file-convert.exe -I elf32-littlenios2 -O hex --input=app.elf --output=mem_init/ext_flash.hex --base=0x44000000 --end=0x45ffffff --reset=0x44430000 --out-data-width=8 --boot="C:\intelfpga_lite\23.1std\nios2eds\components\altera_nios2\boot_loader_cfi.srec"

Now i have to use NiosV command line to do the same, but the alt-file-convert.exe command doesnt exist.

I think it may be something like this:

elf2flash --input=sw/app/build/app.elf --output=sw/app/build/mem_init/ext_flash.hex --epcs –-offset 0x0 --end=0x45ffffff --boot="C:/intelFPGA_lite/23.1std/niosv/components/bootloader/niosv_g_bootloader"

Note the --base and --reset that alt-file-convert.exe used can't be used with elf2flash - is that
correct?


0 Kudos
7 Replies
NGord
New Contributor I
359 Views

I dont think I should have "--epcs" mode set for QSPI?


if I remove that then I can add "--base" and "--reset".

That only leaves "--out-data-width=8" - I take it I dont need that for QSPI either

Also   "-I elf32-littlenios2" and  "-O hex" are superfluous for elf2flash I take it.


0 Kudos
JingyangTeh
Employee
270 Views

Hi


Could you try the command below:

nios2-elf-objcopy -O ihex file.elf output_file.hex


Regards

Jingyang, Teh


0 Kudos
NGord
New Contributor I
238 Views

nios2-elf-objcopy is not recognised by niosv command shell.

Moreover I got elf2flash to create a hexfile but when I use 'convert programming file' in Quartus to create a pof file for qspi programming , I discover that the hexfile isnt Intel format which it meeds to be for it to work!

So I reiterate:

What is the NiosV equivalent of the Nios2 command?:

alt-file-convert.exe -I elf32-littlenios2 -O hex --input=app.elf --output=mem_init/ext_flash.hex --base=0x44000000 --end=0x45ffffff --reset=0x44430000 --out-data-width=8 --boot="C:\intelfpga_lite\23.1std\nios2eds\components\altera_nios2\boot_loader_cfi.srec"


 

0 Kudos
NGord
New Contributor I
228 Views

It seems elf2flash creates an s-record file which is no good .
I need an equivalent for alt-file-convert.exe which created an Intel hex file!!!

I think I can use a 3rd party hex editor to convert between s-records and Intel Hex though, I can try that.


elf2hex creates an Intel hex file but doesnt allow a bootloader to be added, although the command line doesnt complain when I add it!
I tried it and it created a file 78MB which is an order of magnitude bigger than it should be.

It seems to me Nios V toolset isnt ready for me to replace Nios II . 

Moreover Platform designer in the Pro version of Quartus has a BSP editor. Thats all very well but Quartus Pro doesnt support MAX10!!

 



0 Kudos
JingyangTeh
Employee
140 Views

Hi

 

The nios2-elf-obj is available under the nios2 command shell.

To launch you can use the nios2-elf-objcopy.exe shown below:

 

2024-06-06_15h41_22.png

 

Regards

Jingyang, Teh

 

0 Kudos
JingyangTeh
Employee
71 Views

Hi


Any update on this case?

Have you managed to locate the exe in your windows system?


Regards

Jingyang, Teh


0 Kudos
NGord
New Contributor I
25 Views

Thats the point I am trying to use Nios V not Nios II !!!!! 
Please try reading the thread.

0 Kudos
Reply