赞
踩
1.1 添加自己的开发板
根据所参考的官方开发板创建自己开发板的设备树文件
- $ cp ./fdts/stm32mp157f-dk2.dts ./fdts/stm32mp151-custom.dts
-
- $ cp ./fdts/stm32mp15xx-dkx.dtsi ./fdts/stm32mp151-custom.dtsi
stm32mp151-custom.dts
文件#include "stm32mp15xx-dkx.dtsi"
改为:
#include "stm32mp15xx-custom.dtsi"
----
- model = "STMicroelectronics STM32MP157D-DK1 Discovery Board";
-
- compatible = "st,stm32mp157d-dk1", "st,stm32mp157";
改为
- model = "STMicroelectronics STM32MP157D-Custome Discovery Board";
-
- compatible = "st,stm32mp157d-custom", "st,stm32mp157";
增加nor flash设备树
pinctrl
文件cp stm32mp15-pinctrl.dtsi ./stm32mp15-pinctrl-custom.dtsi
将PC10改为PE6
修改stm32mp15xx-100ask.dtsi文件
#include "stm32mp15-ddr3-1x4Gb-1066-binG.dtsi"
//改为
#include "stm32mp15-ddr3-1x2Gb-1066-Custom.dtsi"
内存的修改使用STM32CubeMX生成的设备树,打开STM32CubeMX,新建一个STM32MP157A-DK1开发板的一个工程,点击System view找到DDR单击,目标板是两个16位组成32位所以选择位宽32bits,选择大小4Gb,点击Project Manager选择项目存储位置,然后生成代码。复制生成代码到stm32mp15-ddr3-2x2Gb-1066-binG.dtsi中,注意最后一行包含一个头文件。这里直接附上修改好的代码。
- # Set default TF-A config
-
- TF_A_CONFIG ?= optee trusted emmc nand nor sdcard uart usb NMC
-
- ....
-
- # Init default config settings
-
- TF_A_DEVICETREE_Custom?= stm32mp151_NMC
-
- TF_A_EXTRA_OPTFLAGS_Custom ? = STM32MP_SPI_NOR=1 PSA_FWU_SUPPORT=1 STM32MP_FORCE_MTD_START_OFFSET=0x00080000
-
- TF_A_BINARY_ Custom?= tf-a
-
- TF_A_MAKE_TARGET_Custom ? = all
然后执行:
make -f $PWD/../Makefile.sdk all
部署:
$> export FIP_DEPLOYDIR_ROOT=$PWD/../../FIP_artifacts
$> make -f $PWD/../Makefile.sdk DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/arm-trusted-firmware all
在以下路径中能找到生成的stm32文件
sources\arm-ostl-linux-gnueabi\FIP_artifacts\arm-trusted-firmware
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。