1 hellowolrd code
c
#include <stdio.h>
Int main(void)
{
printf("hello world\r\n");
return 0;
}
2 交叉编译arm程序
程序最终是需要运行在板卡上的,我们需要选择 arm 的编译器,为板卡编译程序。这里,我们选择 Petalinux 安装时,附带的编译器
1,运行下面命令,将 arm 编译器加入环境变量,环境变量仅在当前终端有效,后面命令要在当前终端完成。
bash
source /opt/pkg/tools/Xilinx/Vivado/2020.2/settings64.sh
2,交叉编译程序
bash
aarch64-linux-gnu-gcc -o helloworld main.c
3,将程序导入到板卡运行
