stm32mp135d bringup

本文详细指导了STM32MP135D的移植过程,包括安装交叉编译链、获取并编译TF-A、Optee、U-Boot和Linux的步骤,以及使用Buildroot或Yocto进行文件系统编译。同时提供了快速开始脚本和遇到问题时的社区资源链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

关于 stm32mp135d的移植 一共分为4个部分

tf-a(trusted-firmware)
optee
u-boot
linux

文件系统编译后面再说,使用 buildroot 或者 yocto

我的板子型号为: STM32MP135D-AE
代码正点原子为基础

在这之前,如果要从头bringup板子,可以先从这里生成一下设备树

一、安装交叉编译链

下载及部署交叉编译环境
下载: arm gcc

tar xf gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz
sudo mv gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf /usr/local/gcc-arm-10
echo 'export PATH=/usr/local/gcc-arm-10:$PATH' | tee -a ~/.bashrc
source ~/.bashrc

不想麻烦,直接快速开始

二、获取bsp代码并编译

1. tf-a(trust-firmware)

如果是自己生成的设备树文件,将生成的tf-a目录下的代码,复制到clonetf-a仓库的的fdts目录之下
仓库地址为:

git clone https://github.com/Aaron-xx/tf-a.git

如果无法访问github的话,使用这个:

git clone https://gitee.com/Aaron-lx/tf-a.git

我的设备树名字为stm32mp135d-aaron,如果增加了自己设备树,在此项目根目录的Makefile.sdk中将stm32mp135d-aaron替换为自己的设备树

sed -i 's/stm32mp135d-aaron/stm32mp135d-atk/g' Makefile.sdk

编译:

./build.sh

二、optee

如果是自己生成的设备树文件,将生成的optee目录下的代码,复制到cloneoptee仓库的的core/arch/arm/dts目录之下
仓库地址为:

git clone https://github.com/Aaron-xx/optee.git

如果无法访问github的话,使用这个:

git clone https://gitee.com/Aaron-lx/optee.git

我的设备树名字为stm32mp153d-aaron,如果增加了自己设备树,在此项目根目录的Makefile.sdk中将stm32mp135d-aaron替换为自己的设备树

sed -i 's/stm32mp135d-aaron/stm32mp135d-atk/g' Makefile.sdk

编译:

./build.sh

三、u-boot

如果是自己生成的设备树文件,将生成的u-boot目录下的代码,复制到cloneu-boot仓库的的arch/arm/dts/ 目录之下
仓库地址为:

git clone https://github.com/Aaron-xx/u-boot.git

如果无法访问github的话,使用这个:

git clone https://gitee.com/Aaron-lx/u-boot.git

我的设备树名字为stm32mp153d-aaron,如果增加了自己设备树,在此项目根目录的Makefile.sdk中将stm32mp135d-aaron替换为自己的设备树

sed -i 's/stm32mp135d-aaron/stm32mp135d-atk/g' Makefile.sdk

编译:

./build.sh

四、linux

如果是自己生成的设备树文件,将生成的linux目录下的代码,复制到clonelinux仓库的的arch/arm/boot/dts/ 目录之下
仓库地址为:

git clone https://github.com/Aaron-xx/linux.git

如果无法访问github的话,使用这个:

git clone https://gitee.com/Aaron-lx/linux.git

我的设备树名字为stm32mp153d-aaron,如果增加了自己设备树
模仿这样,在arch/arm/boot/dts/Makefile增加两行即可

DTC_FLAGS_stm32mp135d-aaron += -@
dtb-$(CONFIG_ARCH_STM32) += \
...
stm32mp135d-aaron.dtb   \

编译:

./build.sh

三、快速开始

必须把交叉编译环境装好
从此连接下载两个脚本

git clone https://gitee.com/Aaron-lx/bringup-sh.git

创建一个项目文件夹,将两个脚本放进去

sudo chmod +x build-all.sh
sudo chmod +x compile.sh
./build-all.sh

清除编译结果

./compile clean # 清除 tf-a optee u-boot 编译结果
./compile linux clean # 清除 linux 编译结果

四、st社区关于bringup问题链接

如果遇到bringup的问题,应该有用:
How to bring up STM32MP1
STM32MP1 bring-up troubleshooting guide


至此,bringup stm32mp135d 板子 结束,后续会添加一些设备以及相关设备驱动支持,内核裁减等

能力一般水平有限,希望能帮到您

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值