Forum Discussion

KAT1's avatar
KAT1
Icon for New Contributor rankNew Contributor
1 year ago

DE1-SOC 'My_First_HPS' -- Hello World!

Hi,

I have made my way through 'My_First_HPS' tutorial targeting the DE1-SOC board. However, when I execute the downloaded my_first_hps executable on my DE1-SOC board, instead of seeing the 'Hello Word!' printed I see 'Killed' printed. I assume the executable is being prevented from running. On the other hand, I am more a FPGA developer than a software/embedded person. Can someone possible explain why this is happening and how I should go about resolving it?

Thank you.

16 Replies

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi

    I just tried out the flow for building the application and did not met any error in the process.

    Let me share the steps I have done.

    1. Download the compiler toolchain.

    wget https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz

    tar xf gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz

    rm gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz

    export PATH=`pwd`/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf/bin:$PATH

    export CROSS_COMPILE=arm-none-linux-gnueabihf-

    2. Download the hwlibs. Starting from 20.1 quartus version it is no longer added together with quartus. (https://www.rocketboards.org/foswiki/Documentation/HWLib#SoC_Abstraction_Layer_40SoCAL_41)

    git clone https://github.com/altera-opensource/intel-socfpga-hwlib

    cd intel-socfpga-hwlib/tools

    ./install_linaro.sh

    3. Make changes to the make file to point to the new hwlib directory. I have attached the copy I am using.

    4. Make should run without error. Attached the application that compiled by me. I have not tested out, could you try it out on your device?

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

    Hi,

    I followed your exact instructions to install the tools. If i would also do the two export path commands that you provided, then I would get the following error:

    $ make
    arm-none-linux-gnueabihf-gcc -g -Wall -Dsoc_cv_av -I/cygdrive/c/intelFPGA/20.1/embedded/host_tools/linaro/intel-socfpga-hwlib/armv7a/hwlib/include/soc_cv_av -I/cygdrive/c/intelFPGA/20.1/embedded/host_tools/linaro/intel-socfpga-hwlib/armv7a/hwlib/include -c main.c -o main.o
    process_begin: CreateProcess(NULL, arm-none-linux-gnueabihf-gcc -g -Wall -Dsoc_cv_av -I/cygdrive/c/intelFPGA/20.1/embedded/host_tools/linaro/intel-socfpga-hwlib/armv7a/hwlib/include/soc_cv_av -I/cygdrive/c/intelFPGA/20.1/embedded/host_tools/linaro/intel-socfpga-hwlib/armv7a/hwlib/include -c main.c -o main.o, ...) failed.
    make (e=2): The system cannot find the file specified.
    make: *** [main.o] Error 2

    On the other hand, if I would skip doing the export path commands, then the make run would be successful, as shown below.

    $ make
    gcc -g -Wall -Dsoc_cv_av -I/cygdrive/c/intelFPGA/20.1/embedded/host_tools/linaro/intel-socfpga-hwlib/armv7a/hwlib/include/soc_cv_av -I/cygdrive/c/intelFPGA/20.1/embedded/host_tools/linaro/intel-socfpga-hwlib/armv7a/hwlib/include -c main.c -o main.o
    gcc -g -Wall main.o -o my_first_hps-fpga

    The output would be a .exe file as shown below.

    $ ls
    main.c main.o Makefile 'Makefile - Copy' my_first_hps-fpga.exe

    I copied the my_first_hps-fpga.exe over onto the board SD card, and I tried running it. It gave me the following error:

    root@socfpga:~# ./my_first_hps-fpga.exe
    -sh: ./my_first_hps-fpga.exe: cannot execute binary file

    I also tried running the application that you had compiled with the following error.

    root@socfpga:~# ./my_first_hps-fpga
    ./my_first_hps-fpga: /lib/libc.so.6: version `GLIBC_2.34' not found (required by ./my_first_hps-fpga)

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi

    I see that you are running the compilation in a windows environment.

    Did you run it in the msys2 ? (https://www.msys2.org/)

    https://www.rocketboards.org/foswiki/Documentation/HWLib#Windows_Installation

    I managed to run it without the error you are seeing

    Could you try the binary compiled using the arm-linux-gnueabihf as suggested from the how-to attached.

    I downloaded the compiler with the link below:

    https://releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabihf/

    and exported the following env var.

    export PATH=`pwd`/gcc-linaro-5.5.0-2017.10-i686-mingw32_arm-linux-gnueabihf/bin:$PATH

    export CROSS_COMPILE=arm-linux-gnueabihf-

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi

    Since there are no feedback for this thread, I shall set this thread to close pending. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.

    If you happened to close this thread you might receive a survey. If you think you would rank your support experience less than 4 out of 10, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.

    Regards

    Jingyang, Teh