1.对tf-a源码进行解压
$> tar xfz tf-a-stm32mp-2.2.r2-r0.tar.gz
2.打补丁
$> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
3.配置交叉编译工具链
将Makefile.sdk中EXTRA_OEMAKE修改为
EXTRA_OEMAKE=CROSS_COMPILE=arm-linux-gnueabihf-
4.复制设备树
cp fdts/stm32mp15xx-dkx.dtsi fdts/stm32mp15xx-fsmp1x.dtsi
cp fdts/stm32mp157a-dk1.dts fdts/stm32mp157a-fsmp1a.dts
修改上层目录下的 Makefile.sdk 编译脚本在 TFA_DEVICETREE 配置项中添加 stm32mp1 57a-fsmp1a
TFA_DEVICETREE ?= stm32mp157a-fsmp1a stm32mp157a-dk1 stm32mp157d-dk1 stm32 mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32m p157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1
修改 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.查找镜像文件
cd ../ build/trusted
镜像文件为:
tf-a-stm32mp157a-fsmp1a-trusted.stm32
7.测试
烧录到板子上并测试