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
563 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
13 Replies
NGord
New Contributor I
545 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
456 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
424 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
414 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
326 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
257 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
211 Views

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

0 Kudos
JingyangTeh
Employee
167 Views

Hi


Sorry for the confusion.

For the NiosV there is a new tool to be used for creating the hex for bootloader.

The command tool to used is :


elf2flash --input software/app/debug/<Nios V application>.elf \

--output flash.srec --reset <reset offset + base address of GSFI AVL MEM> \

--base <base address of GSFI AVL MEM> \

--end <end address of GSFI AVL MEM>


riscv-none-embed-objcopy --input-target srec --output-target ihex \

flash.srec <Nios V application>.hex



Instead of one command to generate the hex it is separated into 2 steps.


https://www.intel.com/content/www/us/en/docs/programmable/726952/22-1-21-2-0/software-design-flow-56009.html



Regards

Jingyang, Teh


0 Kudos
NGord
New Contributor I
149 Views

Thats great - just what I wanted..

One more thing:
My Nios2 haad use of Exception Vector set within Platform designer.
For Nios V it must be set with the Nios V command shell because MAX10 doesnt have a BSP editor!
Any advice how I do that with the niosv-bsp command?


NGord_0-1718877532511.png

 

0 Kudos
NGord
New Contributor I
133 Views

Sorry I was bit hasty there..

riscv-none-embed-objcopy doesnt exist in Quartus 23.1 std/lite edition.. The documentation is incorrect.

NGord_0-1718883294048.png

 

 

0 Kudos
JingyangTeh
Employee
52 Views

Hi


For the NiosV they make the exception vector editable in the BSP Editor.

You are able to change the exception vector in the BSP Editor under the BSP linker script.


Which doc you referring to that uses the riscv-none-embed-objcopy ?


Regards

Jingyang, Teh




0 Kudos
NGord
New Contributor I
39 Views

 riscv-none-embed-objcopy  is in your reply dated 20th June.

Once again, I repeat, BSP editor is only available in Quartus Pro and Quartus Pro doesnt support MAX10!!

Nios V isnt properly supported it seems - if you want me to migrate from Nios2 to NiosV then Intel need to sort the tools out.

0 Kudos
NGord
New Contributor I
30 Views

Here is the answer to one issue..
https://www.intel.com/content/www/us/en/support/programmable/articles/000092029.html?wapkw=riscv32-unknown-elf-objcopy

 

 

Still an answer to this..

One more thing:
My Nios2 had use of Exception Vector which was enabled in the NiosII IP within Platform designer.
For Nios V it must be set with the Nios V command shell because only Quartus Pro has  BSP editor in Platform Designer and Quartus Pro doesnt support MAX10.!
Any advice how I do that with the niosv-bsp command?


NGord_0-1719312315287.png

 

 

0 Kudos
Reply