Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

k230_linux_sdk Developing helloworld

k230_linux_sdk Developing helloworld#

Compile the first program hello world#

Create a hello.c file with the following content

//hello.c file content
#include <stdio.h>
int main()
{
    printf("Hello, World!\n");
    return 0;
}

Compile the program

/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V3.0.2/bin/riscv64-unknown-linux-gnu-gcc hello.c  -o hello

Copy the hello file to the development board and execute it. You can see the output is correct

[root@canaan ~ ]#./hello
Hello, World!
[root@canaan ~ ]#

You can copy the elf file to the development board via rz, scp, adb shell, or mtp

Comments list
Comments
Log in