STM32MPU TF-A 编译

cyang Lv6

TF-A 是 Arm Cortex-A trust firmware 的简称,是第一级的启动加载器(FSBL)。介于 Bootrom 和 U-boot 之间。

一、前提条件

  • Linux Host PC
  • SDK

二、编译

  • 启动环境变量
    1
    source <SDK installation directory path>/environment-setup-<target>-<distro>-linux-gnueabi
  • 进入 SDk 目录
    1
    cd ~/MPU/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/build/sdcard-stm32mp15
  • 编译指令
    1
    make -f $PWD/../Makefile.sdk TF_A_DEVICETREE=stm32mp157a-dk1 TF_A_CONFIG=sdcard ELF_DEBUG_ENABLE='1' all

三、修改代码

  • 在文件 plat\st\stm32mp1\bl2_plat_setup.c 中的函数 print_reset_reason() 中加入一行新的打印。
  • 编译

四、烧写

1
2
3
4
5
// Host
cp ../build/sdcard-stm32mp15/tf-a-stm32mp157a-dk1.stm32 root@10.77.1.59:/home/root

// DK
dd if=tf-a-stm32mp157a-dk1.stm32 of=/dev/mmcblk0p1 bs=1M conv=fdatasync

五、对比

  • 出现了新加的打印
  • BL2 的编译时间不一样
    tf-a

六、参考链接

  1. TF-A
  2. Developer_Package
  3. SDK installation
  4. SDK Download
  • 标题: STM32MPU TF-A 编译
  • 作者: cyang
  • 创建于 : 2024-03-30 16:29:26
  • 更新于 : 2024-03-30 16:29:26
  • 链接: https://blog.cyang.tech/2024/03/30/STM32MPU TF-A 介绍/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论