1.解压标准 tf-a 源码包:
tar xfz tf-a-stm32mp-2.2.r2-r0.tar.gz
2.将 ST 官方补丁文件打到 tf-a 源码中:
3.配置交叉编译工具链:
进入~/FSMP1A/tf-a-stm32mp-2.2.r2-r0$ 目录下,打开Makefile.sdk 将如下内容进行更改
4.复制设备树:
cp fdts/stm32mp15xx-dkx.dtsi fdts/stm32mp15xx-fsmp1x.dtsi
cp fdts/stm32mp157a-dk1.dts fdts/stm32mp157a-fsmp1a.dts
修改上层目录下的 Makefile.sdk 编译脚本在 TFA_DEVICETREE 配置项中添加 stm32mp157a-fsmp1a
修改 fdts/stm32mp157a-fsmp1a.dts 将#include "stm32mp15xx-dkx.dtsi" 修改为#include "stm32mp15xx-fsmp1x.dtsi"
5.编译源码
make -f $PWD/../Makefile.sdk TFA_DEVICETREE=stm32mp157a-fsmp1a TF_A_CONFIG=trusted ELF_DEBUG_ENABLE='1' all
编译完成得到以下目录:
6.烧写tf卡
进入/home/ubuntu/FSMP1A/tf-a-stm32mp-2.2.r2-r0/build/trusted目录下,执行以下指令
sudo dd if=tf-a-stm32mp157a-fsmp1a-trusted.stm32 of=/dev/sdb1 conv=fdatasync
sudo dd if=tf-a-stm32mp157a-fsmp1a-trusted.stm32 of=/dev/sdb2 conv=fdatasync
进入/home/ubuntu/FSMP1A/u-boot-stm32mp-v2020.10-stm32mp-r2-r0/u-boot-stm32mp-v2020.10-stm32mp-r2目录下,执行以下指令
sudo dd if=u-boot-stm32mp157a-fsmp1a-trusted.stm32 of=/dev/sdb3 conv=fdatasync
7.测试