配置TF-A源码
1.对tf-a源码进行解压
$> tar xfz tf-a-stm32mp-2.2.r2-r0.tar.gz
2.打补丁
进入/home/ubuntu/FSMP1A/tf-a-stm32mp-2.2.r2-r0/tf-a-stm32mp-2.2.r2目录
执行
for p in ls -1 ../*.patch
; do patch -p1 < $p; done
3.配置工具链
1)进入/home/ubuntu/FSMP1A/tf-a-stm32mp-2.2.r2-r0目录
2)打开Makefile.sdk文件搜索CROSS_COMPILE
将CROSS_COMPILE后第一段内容更改为arm-linux-gnueabihf-
4.复制设备树
进入/home/ubuntu/FSMP1A/tf-a-stm32mp-2.2.r2-r0/tf-a-stm32mp-2.2.r2目录
执行
1)cp fdts/stm32mp15xx-dkx.dtsi fdts/stm32mp15xx-fsmp1x.dtsi
2)cp fdts/stm32mp157a-dk1.dts fdts/stm32mp157a-fsmp1a.dts
3)修改上层目录下的 Makefile.sdk 编译脚本在 TFA_DEVICETREE 配置项中添加 stm32mp157a-fsmp1a
4)修改 fdts/stm32mp157a-fsmp1a.dts 将
#include “stm32mp15xx-dkx.dtsi”
修改为
#include “stm32mp15xx-fsmp1x.dtsi”
5.编译源码
进入/home/ubuntu/FSMP1A/tf-a-stm32mp-2.2.r2-r0/tf-a-stm32mp-2.2.r2目录
执行
make -f $PWD/…/Makefile.sdk TFA_DEVICETREE=stm32mp157a-fsmp1a TF_A_CONFIG=trusted ELF_DEBUG_ENABLE=‘1’ all
6.固件烧写
1)进入/home/ubuntu/FSMP1A/tf-a-stm32mp-2.2.r2-r0/build/trusted目录
执行
2)sudo dd if=tf-a-stm32mp157a-fsmp1a-trusted.stm32 of=/dev/sdb1 conv=fdatasync
3)sudo dd if=tf-a-stm32mp157a-fsmp1a-trusted.stm32 of=/dev/sdb2 conv=fdatasync
4) sudo dd if=u-boot-stm32mp157a-fsmp1a-trusted.stm32 of=/dev/sdb3 conv=fdatasync