该仓包含鸿蒙轻内核LiteOS-M移植支持Nucleo-F767Zi
开发板的工程代码,支持Ninja、GCC、IAR
等方式进行编译。
获取OpenHarmony完整仓代码,建议使用获取方式3:从代码仓库获取
方法获取代码。假设检出目录为~/openHarmony
。
在本地目录,执行 git clone https://gitee.com/harylee/nucleo_f767zi.git
检出代码,假设检出目录为~/nucleo_f767zi
。 执行如下命令把检出工程的device
、vendor
目录复制到openHarmony
工程的相应目录。
cp -r ~/nucleo_f767zi/device/st ~/openHarmony/device/st
cp -r ~/nucleo_f767zi/vendor/st ~/openHarmony/vendor/st
chmod +x ~/openHarmony/device/st/nucleo_f767zi/build.sh
下载arm交叉编译器,git clone https://gitee.com/harylee/gcc-arm-none-eabi-10-2020-q4-major.git
,将交叉编译器环境变量bin
目录配置到.bashrc
文件中或者配置device/st/nucleo_f767zi/liteos_m/config.gni
文件中board_toolchain_path
宏为交叉编译器bin
路径。
在OpenHarmony根目录:
haryslee@dev:~/OpenHarmony$ hb set
[OHOS INFO] Input code path: # 直接按回车,然后选择nucleo_f767zi产品即可
OHOS Which product do you need? nucleo_f767zi@st
haryslee@dev:~/OpenHarmony$ hb build
~/openHarmony/out/nucleo_f767zi
/目录中,通过STM32 ST-LINK Utility软件将镜像文件下载至单板即可。需要确保已经安装好make
和arm gcc
。
执行命令git clone https://gitee.com/openharmony/kernel_liteos_m.git
检出kernel-liteos-m
代码。假设检出目录为~/kernel-liteos-m
。
执行下述命令检出三方库,假设检出目录为~/kernel-liteos-m
。
mkdir ~/third_party
git clone https://gitee.com/openharmony/third_party_bounds_checking_function.git ~/third_party/bounds_checking_function
git clone https://gitee.com/openharmony/third_party_cmsis.git ~/third_party/cmsis
git clone https://gitee.com/openharmony/third_party_musl.git ~/third_party/musl
git clone https://gitee.com/harylee/nucleo_f767zi.git
检出代码,假设检出目录为~/nucleo_f767zi
。 执行如下命令把检出工程的、cortex-m7_nucleo_f767zi_gcc
目录复制到kernel-liteos-m
工程的targets
目录。cp -r ~/nucleo_f767zi/cortex-m7_nucleo_f767zi_gcc ~/kernel-liteos-m/targets/cortex-m7_nucleo_f767zi_gcc
打开终端,切换到目录~/kernel-liteos-m/targets/cortex-m7_nucleo_f767zi_gcc
,执行make clean; make -j
即可启动编译。
烧录、运行类似第一小节的ninja
部分。
需要确保已经安装好IAR Embedded Workbench
。
执行命令git clone https://gitee.com/openharmony/kernel_liteos_m.git
检出kernel-liteos-m
代码。假设检出目录为~/kernel-liteos-m
。
在本地目录,执行 git clone https://gitee.com/harylee/nucleo_f767zi.git
检出代码,假设检出目录为~/nucleo_f767zi
。 执行如下命令把检出工程的、cortex-cortex-m7_nucleo_f767zi_iar
目录复制到kernel-liteos-m
工程的targets
目录。
cp -r ~/nucleo_f767zi/cortex-m7_nucleo_f767zi_iar ~/kernel-liteos-m/targets/cortex-m7_nucleo_f767zi_iar
~/kernel-liteos-m/targets/cortex-m7_nucleo_f767zi_iar/EWARM
,双击文件Project.eww
,打开IAR软件。即可开始编译、烧录、调测运行。此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。