Forum Discussion

Waveform's avatar
Waveform
Icon for New Contributor rankNew Contributor
5 years ago
Solved

Quartus 19.1 NIOS II ED error: Makefile:1012: recipe for target '***.elf' failed

Hello!

I try to port on Quartus 19.1 working NIOS II project, which was early built on Quartus II 18.1.

After installing all the necessaries (Eclipse and WSL , Ubuntu 18.04 and with all packages and updates), creating new bsp and application project, I get the following error, when i try to build all:

wsl make all
Info: Building /mnt/d/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/
make --no-print-directory -C /mnt/d/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/
[BSP build complete]
Info: Compiling src/Main.c to obj/default/src/Main.o
nios2-elf-gcc.exe -xc -MP -MMD -c -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/HAL/inc -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/ -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/drivers/inc -pipe -D__hal__ -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREADED -O0 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -o obj/default/src/Main.o src/Main.c
Info: Compiling src/ad9576.c to obj/default/src/ad9576.o
nios2-elf-gcc.exe -xc -MP -MMD -c -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/HAL/inc -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/ -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/drivers/inc -pipe -D__hal__ -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREADED -O0 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -o obj/default/src/ad9576.o src/ad9576.c
Info: Compiling src/dac7568.c to obj/default/src/dac7568.o
nios2-elf-gcc.exe -xc -MP -MMD -c -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/HAL/inc -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/ -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/drivers/inc -pipe -D__hal__ -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREADED -O0 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -o obj/default/src/dac7568.o src/dac7568.c
Info: Compiling src/stmpe1600.c to obj/default/src/stmpe1600.o
nios2-elf-gcc.exe -xc -MP -MMD -c -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/HAL/inc -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/ -ID:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/drivers/inc -pipe -D__hal__ -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREADED -O0 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -o obj/default/src/stmpe1600.o src/stmpe1600.c
Info: Linking qsys-app.elf
nios2-elf-g++.exe -T'D:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/linker.x' -msys-crt0='D:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/obj/HAL/src/crt0.o' -msys-lib=hal_bsp -LD:/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/ -Wl,-Map=qsys-app.map -O0 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -o qsys-app.elf obj/default/src/Main.o obj/default/src/ad9576.o obj/default/src/dac7568.o obj/default/src/stmpe1600.o -lm -msys-lib=m
nios2-elf-insert.exe qsys-app.elf --thread_model hal --cpu_name nios2_gen2_0 --qsys true --simulation_enabled false --id 305419896 --sidp 0x400 --timestamp 1594123377 --stderr_dev jtag_uart_0 --stdin_dev jtag_uart_0 --stdout_dev jtag_uart_0 --sopc_system_name qsys_system --jdi /mnt/d/Work_FPGA/AXI_DIO64/axie_system_controller_V0/Software/hal_bsp/../../axie_system_controller.jdi
InvocationTargetException: null
Makefile:1012: recipe for target 'qsys-app.elf' failed
make: *** [qsys-app.elf] Error 1
make: *** Deleting file 'qsys-app.elf'

What may be cause of this error and how it could be fixed?

  • Hi!

    The problem is solved, due to help of russian Intel distributor's engineering support. Thanks to Roman!
    He pointed me to two things:
    - need of dividing workspace project and source software directories. It must be different directories inside common project directory.
    - use "New' - "NIOS II Application and Bsp from template" for generaion of new project structure. When I was generating new BSP, I used "New" - "NIOS II Board support package" and got such strange error:

    Executing: wsl;nios2-bsp hal . ../../qsys_system.sopcinfo
    --cpu-name nios2_gen2_0
    (D:\Temp\axie_system_controller_restored\software\qsys_bsp)
    /bin/bash: -c: line 0: syntax error near unexpected token `;'
    /bin/bash: -c: line 0: `;nios2-bsp hal .
    ../../qsys_system.sopcinfo --cpu-name nios2_gen2_0'


    Those advices helps me to build my project succesfuly in Quartus Prime Standart 19.1.

6 Replies

  • Hello!


    I'm going to help you during this issue that you are having.


    The message means that your code is too large to fit into memory. The default size for on-chip memory is very small. Most of the tutorials have you use a larger on-chip memory size. Look at the on-chip memory module in QSYS. I should have a size large enough to fit your program. If it doesn't, pick a larger size (8K or 16K for example). Don't forget to re-generate the code in QSYS and re-compile in Quartus.


    Try clicking on the auto-assign base address in the Qsys tool before generating the component.


    If the issue persist, you need to add bytes to your memory size and auto-assign base address.


    Let me know if you have any problem.


    Best regards.

    IsaacVazquez.


    • Waveform's avatar
      Waveform
      Icon for New Contributor rankNew Contributor

      Hello!
      I use generic parallel flash memory for storing and booting nios program code. It connects to NIOS on system planer thru Generic Tri-State Controller and Tristate Condute Bridge as recomended in Embedded Design Handbook. Flash memory has the volume of 64MB, more than enough for any kind of code. OnChip RAM I use only for exception vector and it has capacity of 32 KB. I extended it to 64KB, but no use.
      NIOS CPU is runing on MAX10 device.
      Only thing I want to mention is that, this project nice works and compiles on Quartus Prime Standart 18.1.

      My Regards, Andrey

  • Hi,


    I see, your project works with Quartus 18.1 because Eclipse and Quartus are at the same package. From 19.1 Quartus and Eclipse are separated.


    I saw a KDB to work around your possible issue, can you try this? [1]


    If this does not work with your issue, can you share with me, which steps did you follow to do the 'make all' exactly? So, I can know more about it and do more debug into this.


    [1] https://www.intel.com/content/altera-www/global/en_us/index/support/support-resources/knowledge-base/tools/2019/why-does-nios-build-flow-produce-incorrect--elf-file-size-on-win.html


    Thanks.

    Best regards.


    • Waveform's avatar
      Waveform
      Icon for New Contributor rankNew Contributor

      Hi! Thank you for support in my question.


      I tried to run in wsl command prompt such command, as was recommended in support article:
      make SOPCINFO_FILE=/mnt/d/Temp/axie_system_controller/qsys-system.sopcinfo --no-print-directory -C /mnt/d/Temp/axie_system_controller/Software/hal_bsp/
      And I got the message: [BSP build complete]
      So, it doesn' change the futher situation. After that, I got the same error.
      Also, I added in the application make file such string:
      SOPC_FILE := ../../qsys_system.sopcinfo
      , and it doesn't helped me too.

      I suppose, that the problem is in next tool:
      nios2-elf-g++.exe -T'D:/Temp/axie_system_controller/Software/hal_bsp/linker.x' -msys-crt0='D:/Temp/axie_system_controller/Software/hal_bsp/obj/HAL/src/crt0.o' -msys-lib=hal_bsp -LD:/Temp/axie_system_controller/Software/hal_bsp/ -Wl,-Map=qsys-app.map -O0 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -o qsys-app.elf obj/default/src/Main.o obj/default/src/ad9576.o obj/default/src/dac7568.o obj/default/src/stmpe1600.o -lm -msys-lib=m

      , which must generate the .elf file, but it doesn't do it.

      My be I should try the last version of Quartus Prime standart 20.1?

      Best regards, Andrey

      • Waveform's avatar
        Waveform
        Icon for New Contributor rankNew Contributor

        Hi!

        The problem is solved, due to help of russian Intel distributor's engineering support. Thanks to Roman!
        He pointed me to two things:
        - need of dividing workspace project and source software directories. It must be different directories inside common project directory.
        - use "New' - "NIOS II Application and Bsp from template" for generaion of new project structure. When I was generating new BSP, I used "New" - "NIOS II Board support package" and got such strange error:

        Executing: wsl;nios2-bsp hal . ../../qsys_system.sopcinfo
        --cpu-name nios2_gen2_0
        (D:\Temp\axie_system_controller_restored\software\qsys_bsp)
        /bin/bash: -c: line 0: syntax error near unexpected token `;'
        /bin/bash: -c: line 0: `;nios2-bsp hal .
        ../../qsys_system.sopcinfo --cpu-name nios2_gen2_0'


        Those advices helps me to build my project succesfuly in Quartus Prime Standart 19.1.