Forum Discussion

bpere15's avatar
bpere15
Icon for New Contributor rankNew Contributor
5 years ago

NIOS SBT not generating elf

Hi I am running Quartus 19.1 Lite and recently I was able to successfully build my software projects. However now when I do I get the following error

Info: Linking test.elf
nios2-elf-g++.exe -T'C:/Users/bpere/Desktop/work_fpga_folder/continupus_pulse_width2/software/test_bsp/linker.x' -msys-crt0='' -msys-lib= -LC:/Users/bpere/Desktop/work_fpga_folder/continupus_pulse_width2/software/test_bsp -msmallc -Wl,-Map=test.map -Os -g -Wall -mno-hw-div -mno-hw-mul -mno-hw-mulx -mgpopt=global -o test.elf obj/default/hello_world_small.o -lm -msys-lib=m
nios2-elf-g++.exe: error: missing argument to '-msys-crt0='
nios2-elf-g++.exe: error: missing argument to '-msys-lib='
make: *** [test.elf] Error 1
Makefile:1010: recipe for target 'test.elf' failed

I have tried the solutions posted here:

https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/Issue-in-Nios-Eclipse-elf-not-generated/td-p/1187247

https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/EDS-on-Quartus-19-1-on-Windows-linker-error/td-p/658481

and they temporarily allow me to build once however a simple "hello world" project does not run correctly. Subsequent builds produces this error:

Info: Building /mnt/c/Users/bpere/Desktop/work_fpga_folder/continupus_pulse_width2/software/test2_bsp/
make --no-print-directory -C /mnt/c/Users/bpere/Desktop/work_fpga_folder/continupus_pulse_width2/software/test2_bsp/
[BSP build complete]
Info: Creating test2.objdump
nios2-elf-objdump.exe --disassemble --syms --all-header --source test2.elf >test2.objdump
nios2-elf-objdump.exe: can't disassemble for architecture UNKNOWN!

Makefile:1020: recipe for target 'test2.objdump' failed
make: *** [test2.objdump] Error 1
make: *** Deleting file 'test2.objdump'

please help

3 Replies

  • EricMunYew_C_Intel's avatar
    EricMunYew_C_Intel
    Icon for Frequent Contributor rankFrequent Contributor

    Hi, Bryant



    Can you try below workarounds ?


    #1

    Open a NIOS2 command shell

    try and make an NIOS2 application

    You get the following error: nios2-elf-gcc.exe: error: CreateProcess: No such file or directory

    To resolve this you need run the following command prior to calling make, "export WSLENV=PATH/l:${WSLENV}"

    #2

    With the above fix you can compile all the files but the link fails:

    nios2-elf-g++.exe: error: missing argument to '-msys-lib='

    To resolve this you need to modify the application Makefile and change the following line:

    APP_LDFLAGS += -msys-lib=$(call adjust-path-mixed,$(SYS_LIB)) to APP_LDFLAGS += -msys-lib=$(SYS_LIB)

    In adjust-path-mixed should not be used in this case as SYS_LIB is a name of a library not a PATH to the library

    #3

    The final problem is that from eclipse debugging fails with the following error:

    wslpath: /mnt/f/main_clean/Software/omni_ip/projects/wfm_ss/example/wfm/wfm_app/wfm.elf.srec: No such file or directory

    wslpath: /mnt/f/main_clean/Software/omni_ip/projects/wfm_ss/example/wfm/wfm_app/wfm.elf.srec: No such file or directory

    Using cable "USB-BlasterII [USB-1]", device 1, instance 0x01

    Pausing target processor: OK

    Restarting target processor

    rm: cannot remove '/mnt/f/main_clean/Software/omni_ip/projects/wfm_ss/example/wfm/wfm_app/wfm.elf.srec': No such file or directory

    To resolve this problem the Application Makefile must be modified again with the following change:

    BUILD_PRE_PROCESS := to BUILD_PRE_PROCESS := touch $(ELF).srec


    Thanks.


    Eric