从零开始打造 OpenSTLinux 6.6 Yocto 系统 - STM32MP2(基于STM32CubeMX)(三)

准备stm32mp-ddr-phy

复制代码
参考stm32mp-ddr-phy-A2022.11-r0目录下README.HOW_TO.txt.stm32mp2,非常重要!!!

cd ~/develop/STM32MP2/test/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v25.08.27/sources/ostl-linux

#准备stm32mp-ddr-phy源码
cd stm32mp-ddr-phy-A2022.11-r0/
tar xf stm32mp-ddr-phy-A2022.11-r0.tar.xz
cd stm32mp-ddr-phy-A2022.11/
test -d .git || git init . && git add . && git commit -m "new stm32mp-ddr-phy" && git gc
git checkout -b WORKING

准备TF-A

复制代码
参考tf-a-stm32mp-v2.10.13-stm32mp-r2-r0目录下README.HOW_TO.txt.stm32mp2,非常重要!!!
cd tf-a-stm32mp-v2.10.13-stm32mp-r2-r0/
vi test.sh

#在test.sh增加以下内容,参考README.HOW_TO.txt.stm32mp2的4.2,打补丁+git管理
tar xf tf-a-stm32mp-v2.10.13-stm32mp-r2-r0.tar.xz
cd tf-a-stm32mp-v2.10.13-stm32mp-r2
test -d .git || git init . && git add . && git commit -m "tf-a source code" && git gc
git checkout -b WORKING
for p in `ls -1 ../*.patch`; do git am $p; done
#end of test.sh

/bin/bash test.sh

export FIP_DEPLOYDIR_ROOT=/home/niuke/develop/STM32MP2/test/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v25.08.27/sources/ostl-linux/FIP_artifacts

export FWDDR_DIR==/home/niuke/develop/STM32MP2/test/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v25.08.27/sources/ostl-linux/stm32mp-ddr-phy-A2022.11-r0/stm32mp-ddr-phy-A2022.11

export DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/arm-trusted-firmware
source ~/sdk6.6_mp2
cd tf-a-stm32mp-v2.10.13-stm32mp-r2/
make -f $PWD/../Makefile.sdk.stm32mp2 clean
make -f $PWD/../Makefile.sdk.stm32mp2 stm32

按照步骤,编译成功如下图所示,同时会在arm-trusted-firmware目录下生成多个文件和目录

准备optee

复制代码
参考optee-os-stm32mp-4.0.0-stm32mp-r2-r0目录下README.HOW_TO.txt.stm32mp2,非常重要!!!
!!!注意:如果是在当前的shell环境下面,则不需要重新声明TF-A的环境变量


#将DEPLOYDIR修改成optee
export DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/optee

cd optee-os-stm32mp-4.0.0-stm32mp-r2-r0/
vi test.sh

#在test.sh增加以下内容,参考README.HOW_TO.txt.stm32mp2的4.2,打补丁+git管理
tar xf optee-os-stm32mp-4.0.0-stm32mp-r2-r0.tar.xz
cd optee-os-stm32mp-4.0.0-stm32mp-r2
test -d .git || git init . && git add . && git commit -m "optee-os source code" && git gc
git checkout -b WORKING
tar xf ../fonts.tar.gz
for p in `ls -1 ../*.patch`; do git am $p; done
#end of test.sh

/bin/bash test.sh

cd optee-os-stm32mp-4.0.0-stm32mp-r2/

make -f $PWD/../Makefile.sdk.stm32mp2 clean
make -f $PWD/../Makefile.sdk.stm32mp2 optee

按照步骤,编译成功如下图所示,同时会在optee目录下生成多个文件和目录

准备u-boot

复制代码
参考u-boot-stm32mp-v2023.10-stm32mp-r2-r0目录下README.HOW_TO.txt.stm32mp2,非常重要!!!
!!!注意:如果是在当前的shell环境下面,则不需要重新声明TF-A的环境变量


#将DEPLOYDIR修改成u-boot
export DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/u-boot

cd u-boot-stm32mp-v2023.10-stm32mp-r2-r0/
vi test.sh

#在test.sh增加以下内容,参考README.HOW_TO.txt.stm32mp2的4.2,打补丁+git管理
tar xf u-boot-stm32mp-v2023.10-stm32mp-r2-r0.tar.xz
cd u-boot-stm32mp-v2023.10-stm32mp-r2
test -d .git || git init . && git add . && git commit -m "U-Boot source code" && git gc
git checkout -b WORKING
for p in `ls -1 ../*.patch`; do git am $p; done
#end of test.sh

/bin/bash test.sh

cd u-boot-stm32mp-v2023.10-stm32mp-r2/

make -f $PWD/../Makefile.sdk.stm32mp2 clean
make -f $PWD/../Makefile.sdk.stm32mp2 UBOOT_CONFIG=default UBOOT_DEFCONFIG=stm32mp25_defconfig UBOOT_BINARY=u-boot.dtb DEVICE_TREE=stm32mp257f-ev1 all

按照步骤,编译成功如下图所示,同时会在u-boot和fip目录下生成多个文件和目录

准备kernel - 暂时不需要

下一章

使用STM32CubeMX生成的设备树

编译TF-A

编译optee

编译uboot和fip

相关推荐
AI的探索之旅17 小时前
AI辅助原理图评审:电源去耦、BOOT引脚、VCAP——19项逐一核查,遗漏?不存在的
人工智能·vscode·嵌入式硬件
茯苓gao17 小时前
嵌入式开发笔记:EtherCAT协议从硬件到软件完整配置指南——从零搭建一套EtherCAT通信系统
笔记·嵌入式硬件·学习
GeekArch17 小时前
第24讲:Vibe模式代码风格控制——适配Keil/STM32工程规范
人工智能·stm32·单片机·嵌入式硬件·mcu·决策树·ai编程
自律懒人17 小时前
阿里 Qwen3.8-Max 预览版从零上手指南:2.4T 参数旗舰模型的 5 种接入方式与边界实测
开源
Freedom_my18 小时前
STM32项目3
stm32·单片机·嵌入式硬件
ApacheSeaTunnel18 小时前
Apache SeaTunnel AI CLI Benchmark:7 款大模型、100 个 ETL 任务实测,谁真正能跑起来?
大数据·ai·开源·大模型·数据集成·cli·seatunnel·技术分享·数据同步
国科安芯19 小时前
星间光链路:AS32S601型抗辐射MCU在空间激光通信终端控制中的技术实现
服务器·网络·单片机·嵌入式硬件·物联网·安全·信息与通信
小李不困还能学20 小时前
基于 51 单片机的8 路抢答器设计教程
单片机·嵌入式硬件·mongodb·抢答器
CedarQR20 小时前
万字长文:从零在 RK3588 上部署 PaddleSpeech 中文 TTS 全流程(FastSpeech2 + HiFiGAN)
开发语言·c++·嵌入式硬件·ubuntu·json
萌动的小火苗21 小时前
嵌入式开发中的栈与队列:任务调度为什么依赖数据结构
数据结构·c++·单片机·嵌入式硬件