配置DUO在Arm64平台的交叉编译工具链

我想用手里的斐讯N1给DUO交叉编译个C程序来控制GPIO,IIC什么的,看到了官方有这个教程:https://milkv.io/docs/duo/application-development/wiringx。但是这个交叉编译工具链不支持ARM64.

于是我爬论坛又看到了这个教程:ARM平台编译DUO固件,里面有arm64的交叉编译工具。如果用斐讯N1编译buildroot编译到猴年马月,但是用来编译几个简单的C程序倒挺合适。

于是我把两者结合了一下,直接给出完成的工具链,我主要把arm64的工具链加到了交叉编译环境中,然后改了下envsetup.sh里的x86工具链名字为arm64的,然后打包,其他没了:
这是速度极快的阿里云链接

至于用法:
1.我用的斐讯N1,把速度极快的阿里云链接下载下来,解压到/root这个目录。
2.安装依赖sudo apt-get install wget git make
3.配置环境变量
cd duo-examples
source envsetup.sh
4.这样我们就可以像单片机那样写c程序控制io了,这里我们编译个helloworld试试
cd hello-world
make
5.这个时候我们发现目录多了个helloworld 和helloworld.o 我们把helloworld用SCP传到DUO上面
scp helloworld的绝对路径 root@192.168.x.x:helloworld
6.进入DUO,发现helloworld已经上传到/root目录下面了,执行./helloworld,控制台就会打印出helloworld

If you have a working Baidu account, you may want to take files from there:

Moreover, some people, including me, would appreciate it if you upload all those files somewhere else, like at Google Drive, Dropbox or somewhere else (thanks in advance if you do).

This is my modified DUO cross-compilation tool chain.

1 Like

这是123 云盘的,文章的阿里云盘会失效duo-examples.zip官方版下载丨最新版下载丨绿色版下载丨APP下载-123云盘

Check out my latest reply in the comments section.

1 Like

Thanks a lot, the Dropbox link seems okay. I think you only downloaded the ARM64 SDK.
I can also see you modified the environment setup script so it points to the ARM64 SDK path now.

Could you also download other archives from the Baidu Cloud, please?

sorry my google drive dont have more space ,but if you can visit 123云盘 is fast and download directly,

maybe i can. milkv.zip - Google Drive

1 Like

Thanks a lot. The Google Drive link works; and the 123pan requires login (and likely installing their software as well).

Have you tried their TinyCC? Feels like it’s a C compiler one could run directly on a Duo board.

no I am still a beginner.

我打包的时候可能出现了问题,/duo-examples/duo-sdk/riscv64-linux-musl-arm64这个文件夹里面有些文件出现了错误,自己去用https://community.milkv.io/t/m1-arm64-debian11-uos-v20/255这个教程下面的hosttool里面的riscv64-linux-musl-arm64替换吧