hello world program

cancel
Showing results for 
Search instead for 
Did you mean: 

hello world program

123 Views
rashmikj
Contributor I

Hi, 

I am using LS1046ardb Kit. Iam able to compile a sample hello world example in Ubuntu 18 using cross compiler aarch64-linux-gnu-gcc and tranfer the object files to the kit using serial port kermit. When i run the file in the kit , nothing get displayed on the kit console. how do i print messages in the console.

Kindly help.

Labels (1)
0 Kudos
3 Replies

117 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please try whether the attached elf file can be executed to print "Hello World" successfully on your target board.

1. On your host PC create test.c as the following.

#include <stdio.h>

void main()
{
printf("Hello World!");
}

2. Cross compile test.c.

aarch64-linux-gnu-gcc test.c -o test.out

3. Copy test.out to ls1046ardb target board.

root@TinyDistro ~]$ ./test.out
Hello World![root@TinyDistro ~]

0 Kudos

108 Views
rashmikj
Contributor I

Hi,

Thank for the solution. How to transfer the file to the kit? Which protocol is supported?

0 Kudos

94 Views
yipingwang
NXP TechSupport
NXP TechSupport

You could copy the file to USB storage device. Or setting up networking environment, and use "scp" command to copy the file from the PC to the target board.

0 Kudos