FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5932 Discussions

DE1-SOC 'My_First_HPS' -- Hello World!

KAT1
Beginner
1,109 Views

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.

  

Labels (1)
0 Kudos
16 Replies
JingyangTeh
Employee
1,072 Views

Hi


From the looks of it you have successfully boot into the linux environment.

The error message that you are looking at means that the "hello world" application crashed when the application launches.

It means that the application itself is faulty, there are multiple factors that could cause this.

I would not be alarm at this as the hello world is just a simple program in to print something in the linux environment, it does not indicate that there are something wrong with the board it self.


May I ask what is the end goal that you are looking at?


Regards

Jingyang, Teh



0 Kudos
KAT1
Beginner
1,061 Views

Hi,

Thank you for your response.  My end goal is to become familiarized with writing and compiling my own application to run on the DE1-SOC board.  I am starting from my_first_hps tutorial as way to setup all the tools and work my way through running the first application on the DE1-SOC board.  Although I am not concerned with any hardware related issue as the source of the problem, I am trying to determine the reason why this simple program would be faulty, even though I have followed the steps from my_first_hps tutorial as closely as possible.  Without resolving this issue, I assume I cannot complete any other tutorial or exercise that involves applications running on the HPS.  Thus, why I am trying to get to the root cause of this application crash.  Thank you. 

0 Kudos
JingyangTeh
Employee
1,009 Views

Hi


Did you meet any issue when running the make command on your host pc?

And did the application successfully copied over to the board?

Could you issue "ls -l" to check the size of the application on the board?


Regards

Jingyang, Teh


0 Kudos
KAT1
Beginner
993 Views

Hi,

 

Please see my response below to your question.

 

Did you meet any issue when running the make command on your host pc? 

answer:  No.  The following was displayed when I ran the make command.

$ make
arm-eabi-gcc -g -Wall -Dsoc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/ -c main.c -o main.o
arm-eabi-gcc -g -Wall main.o -o my_first_hps

 

And did the application successfully copied over to the board?

answer: Yes.  I could see the file when I did ls -l.  See below.

root@socfpga:~# ls -l
-rwxrwxrwx 1 root root 248524 Sep 28 05:02 my_first_hps

 

Could you issue "ls -l" to check the size of the application on the board?

answer:  see above.  I did notice that in the My_First_HPS.pdf tutorial pdf, the file size shown in the screenshot on page 10 was showing the file size to be 6521.  

0 Kudos
JingyangTeh
Employee
942 Views

Hi


I see that the compiler that are using is not the cross compiler that was describ in the tutorial.

That could be the reason the application could not be run on the linux device.

Could you try using the describe cross compiler "arm-linux-gnueabihf".


Regards

Jingyang, Teh


0 Kudos
KAT1
Beginner
912 Views

Hi,

 

I did my best to follow the steps outlined in ug_soc_eds-683187-666301.pdf, section 2.3. Windows to install the SoC EDS tools and the cross compiler.  In section 2.3.5 Installing Linaro Bare Metal Toolchain, I followed the instruction, and performed ./install_linaro.sh.  In the Linaro folder, I have the following files and directories:

/c/intelfpga/20.1/embedded/host_tools/linaro
$ ls
gcc  gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-eabi.tar.xz  install_linaro.sh  newlib  newlib-cygwin

 

However, after following these instructions to install the SoC tools, I could not successfully run the 'make' file as described in My_First_HPS.pdf, when using the arm-linux-gnueabihf-gcc cross compiler.  I would get the following error:  


$ make
arm-linux-gnueabihf-gcc -g -Wall main.o -o my_first_hps
process_begin: CreateProcess(NULL, arm-linux-gnueabihf-gcc -g -Wall main.o -o my_first_hps, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [my_first_hps] Error 2

 

On the other hand, after modifying the make file to call out the arm-eabi-gcc cross compiler, then I could complete the compilation and generate the my_first_hps executable.  See below:

 

$ make
arm-eabi-gcc -g -Wall -Dsoc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/ -c main.c -o main.o
arm-eabi-gcc -g -Wall main.o -o my_first_hps

 

Have I installed the SoC EDS tools incorrectly?  Please advise on how I can get the tools installed correctly to use the intended arm-linux-gnueabihf-gcc cross compiler.

 

Thank you!

 

 

0 Kudos
JingyangTeh
Employee
868 Views

Hi


Sorry for the late reply.

Could you try out the adding the compiler to the PATH variable so that it could find the correct compiler


After going into the gcc folder and entering the command below:

"export PATH=`pwd`/gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-eabi/bin:$PATH"


After that could you try the make file again.


Regards

Jingyang, Teh



0 Kudos
JingyangTeh
Employee
808 Views

Hi


Are you able to launch the correct compiler after adding the path into the system environment?


Regards

Jingyang, Teh


0 Kudos
KAT1
Beginner
762 Views

Hi,

 

I tried entering the export path in the 'gcc' folder, but it indicated that the path cannot be found.  Below see below.

 

C:\intelFPGA\20.1\embedded\host_tools\linaro\gcc>"export PATH=`pwd`/gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-eabi/bin:$PATH"
The system cannot find the path specified.

 

 

And below are the sub-folders and files under the 'gcc' folder...

 

Directory of C:\intelFPGA\20.1\embedded\host_tools\linaro\gcc

12/04/2019 11:03 AM <DIR> .
02/22/2024 10:44 PM <DIR> ..
12/04/2019 11:03 AM <DIR> arm-eabi
12/04/2019 11:03 AM <DIR> bin
12/04/2019 11:03 AM 10,507 gcc-linaro-7.5.0-2019.12-win32-manifest.txt
12/04/2019 11:02 AM <DIR> include
12/04/2019 11:04 AM <DIR> lib
12/04/2019 10:53 AM <DIR> libexec
12/04/2019 11:02 AM <DIR> share
12/04/2019 09:45 AM <DIR> usr

 

0 Kudos
JingyangTeh
Employee
644 Views

Hi


Could you please try downloading the linaro toolchain with the command below:


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


Once finish please try the make command again this time with


make

arm-none-linux-gnueabihf-gcc -g -Wall -Dsoc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/ -c main.c -o main.o

arm-eabi-gcc -g -Wall main.o -o my_first_hps


instead of the the arm-eabi-gcc or arm-linux-gnueabihf-gcc



Regards

Jingyang, Teh


0 Kudos
KAT1
Beginner
615 Views

Hi,

I followed the instruction as indicated.  And, below is the sub-directory that was created under the 'linaro' folder.

/cygdrive/c/intelFPGA/20.1/embedded/host_tools/linaro
$ ls
gcc install_linaro.sh
gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf newlib
gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-eabi.tar.xz newlib-cygwin

 

However, when executing the 'make' command, I got the following error message:

$ make
arm-none-linux-gnueabihf-gcc -g -Wall -Dsoc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/ -c main.c -o main.o
process_begin: CreateProcess(NULL, arm-none-linux-gnueabihf-gcc -g -Wall -Dsoc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/ -c main.c -o main.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [main.o] Error 2

 

Please advise.  Thanks.

0 Kudos
KAT1
Beginner
597 Views

Hi,

 

FYI - I also tried renaming the /gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf subfolder to /gcc, and then tried running the make file.  This time I got the following error message:

$ make
arm-none-linux-gnueabihf-gcc -g -Wall -Dsoc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/ -c main.c -o main.o
process_begin: CreateProcess(C:\intelFPGA\20.1\embedded\host_tools\linaro\gcc\bin\arm-none-linux-gnueabihf-gcc, arm-none-linux-gnueabihf-gcc -g -Wall -Dsoc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -IC:/intelFPGA/20.1/embedded/ip/altera/hps/altera_hps/hwlib/include/ -c main.c -o main.o, ...) failed.
make (e=193): Error 193
make: *** [main.o] Error 193

 

Hope this provides you more information as to what the problem may be.  

0 Kudos
JingyangTeh
Employee
523 Views

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?

 

 

 

 

0 Kudos
KAT1
Beginner
486 Views

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)

 

 

 

0 Kudos
JingyangTeh
Employee
466 Views

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

JingyangTeh_0-1712128431699.png

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-

 

 

0 Kudos
JingyangTeh
Employee
149 Views

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

0 Kudos
Reply