本文将以Myirtech的MYD-YF13X以及STM32MP135F-DK为例,讲解如何使用STM32CubeMX结合Developer package实现最小系统启动。
1.开发准备
1.1 Developer package准备
a.Developer package下载:
https://www.st.com/en/embedded-software/stm32mp1dev.html
b.解压后进入source目录:
c.源码准备(可以根据每一个source目录下的README.HOW_TO.txt中第三点准备):
TFA源码
$> cd tf-a-stm32mp-v2.6-stm32mp-r2-r0
$> tar xf tf-a-stm32mp-v2.6-stm32mp-r2-r0.tar.xz
$> cd tf-a-stm32mp-v2.6-stm32mp-r2
$> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
OP-TEE源码
$> cd optee-os-stm32mp-3.16.0-stm32mp-r2-r0
$> tar xf optee-os-stm32mp-3.16.0-stm32mp-r2-r0.tar.xz
$> cd optee-os-stm32mp-3.16.0-stm32mp-r2
$> tar xf ../fonts.tar.gz
$> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
U-Boot源码
$> cd u-boot-stm32mp-v2021.10-stm32mp-r2-r0
$> tar xf u-boot-stm32mp-v2021.10-stm32mp-r2-r0.tar.xz
$> cd u-boot-stm32mp-v2021.10-stm32mp-r2
$> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
Kernel源码
$> cd linux-stm32mp-5.15.67-stm32mp-r2-r0
$> tar xf linux-5.15.67.tar.xz
$> cd linux-5.15.67
$> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
请阅读WIKI完成 Install_the_SDK。
请根据WIKI给出的命令/步骤安装 CubeProgrammer and libusb installation。
首先看一下Myirtech的原理图框架:
打开STM32CubeMX, 根据芯片的part number选择正确的芯片封装开始项目创建,例如:Myirtech使用的是STM32MP135DAF7,
点击“Generate Code”之后会生成一个近乎空的project,设备树结构:
TFA:
PC $> cd
PC $> ln -s /local/home/xxx/Desktop/STM32CubeMX/myir_bring_up/DeviceTree/myir_bring_up/tf-a/* fdts/
OP-TEE:
PC $> cd
PC $> ln -s /local/home/xxx/Desktop/STM32CubeMX/myir_bring_up/DeviceTree/myir_bring_up/optee-os/* core/arch/arm/dts/
U-Boot:
PC $> cd
PC $> ln -s /local/home/xxx/Desktop/STM32CubeMX/myir_bring_up/DeviceTree/myir_bring_up/u-boot/* arch/arm/dts/
培训资料未完,请关注下一期文章。