|
海思AI芯片开发之Hello World
确认模组的芯片型号,由于没有找到直接查看型号的命令,通过几个命令尝试,最终在dmesg命令中看到设备驱动加载的芯片型号为Hi3516DV300。
dmidecode | grep "Product Name"
uname -a
Linux localhost 4.9.37 #8 SMP Wed May 29 17:13:27 CST 2019 armv7l GNU/Linux
这是运行Linux 4.9.37版本的内核,主机名为localhost,CPU硬件类型为armv7l
一般的应用开发可以通过ssh远程登录,有些场景需要连接串口线,如烧写内核和根文件系统镜像,驱动开发等
因摄像头模组出厂时已经安装过系统,不需要重新安装或升级SDK
编写程序
创建hello.cpp文件,代码内容如下:
#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Hello World! dfy888" << std::endl;
return 0;
}
交叉编译
arm-himix200-linux-gcc -Wall -g -lpthread -lm -ldl -lstdc++ -mcpu=cortex-a7 -O2 -o hello hello.cpp
上传到模组
在上传程序之前,先使用命令df -hT查看flash分区使用情况,以确保目录有足够的剩余空间可以使用。
在我的摄像头模组环境下,用户程序目录挂载在/mnt/mtd
在模组上运行程序
进入/mnt/mtd目录,执行hello程序
chmod +x hello
./hello
如果看到输出,恭喜你,你的开发环境和开发流程都已成功。
|
|