Skip to main content
Visitor II
November 13, 2020
Solved

local build TF-A crashes during boot, STM32MP157A-DK1 kit

  • November 13, 2020
  • 1 reply
  • 1129 views

Hello

i'm trying to get started with the STM32MP1 env, and I'm having some issues building the trusted firmware boot image, after following the steps from: https://wiki.st.com/stm32mpu/wiki/STM32MP15_TF-A

I'm, building it with the following commands, on the v2.2-stm32mp branch, with gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) , no changes on the git branch:

make distclean
 
make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=aarch32 ARM_ARCH_MAJOR=7 PLAT=stm32mp1 DTB_FILE_NAME=stm32mp157a-dk1.dtb FDT_SOURCES=fdts/stm32mp157a-dk1.dts DEBUG=1 STM32MP_SDMMC=1 dtbs
 
make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=aarch32 ARM_ARCH_MAJOR=7 PLAT=stm32mp1 DTB_FILE_NAME=stm32mp157a-dk1.dtb FDT_SOURCES=fdts/stm32mp157a-dk1.dts DEBUG=1 STM32MP_SDMMC=1

I can see the following messages on the serial console:

NOTICE: CPU: STM32MP157AAC Rev.B
NOTICE: Model: STMicroelectronics STM32MP157A-DK1 Discovery Board
NOTICE: Board: MB1272 Var1.0 Rev.C-01
INFO: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: PMIC version = 0x10
INFO: Using SDMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.2-r2.0(debug):v2.2-stm32mp-r2
NOTICE: BL2: Built : 11:17:04, Nov 13 2020
INFO: Using crypto library 'stm32_crypto_lib'
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000Khz
INFO: Memory size = 0x20000000 (512 MB)
INFO: BL2 runs SP_MIN setup
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2ffeb000
INFO: Image id=4 loaded: 0x2ffeb000 - 0x2ffff000
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0100000
INFO: STM32 Image size : 903902
INFO: Image id=5 loaded: 0xc0100000 - 0xc01dcade
WARNING: Skip signature check (header option)
NOTICE: ROTPK is not deployed on platform. Skipping ROTPK verification.
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2ffeb000
INFO: SPSR = 0x1d3
 
Undefined instruction at: 0x2ffeb00c
 
Undefined instruction at: 0x2ffd4370
 

The SD-CARD image is build with create_sdcard_from_flashlayout.sh, based on the following script:

#Opt	Id		Name		Type		IP		Offset		Binary
-		0x01	fsbl1-boot	Binary		none	0x0			arm-trusted-firmware/tf-a-stm32mp157a-dk1-serialboot.stm32
-		0x03	ssbl-boot	Binary		none	0x0			bootloader/u-boot.stm32
P		0x04	fsbl1		Binary		mmc0	0x00004400	arm-trusted-firmware/tf-a.stm32
P		0x05	fsbl2		Binary		mmc0	0x00044400	arm-trusted-firmware/tf-a.stm32
PD		0x06	ssbl		Binary		mmc0	0x00084400	bootloader/u-boot.stm32
P		0x07	boot		System		mmc0	0x00284400	st-image-bootfs-openstlinux-weston-stm32mp1.ext4
P		0x08	rootfs		FileSystem	mmc0	0x05284400	st-image-weston-openstlinux-weston-stm32mp1.ext4

U_BOOT (also local build) and the other images are ok, as it will boot properly if I use tf-a-stm32mp157a-dk1-trusted.stm32 instead of the locally compiled binary

Are there any knows issues regarding TF-A build ?

I can't see anything related to the GCC version in https://wiki.st.com/stm32mpu/wiki/PC_prerequisites

(edit reason: wrong gcc version)

Thanks,

Alexandru

    This topic has been closed for replies.
    Best answer by Olivier GALLIEN

    Hi @EAlex.1​ ,

    I'm a bit surprise by your build command and value of CROSS_COMPILE

    Simple command line to properly buid a TF-A in provided SDK is :

    make -f Makefile.sdk TF_A_CONFIG=trusted TFA_DEVICETREE=<board>

    I guess you should rather look at page :

    https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Building_and_deploying_the_TF-A_for_the_first_time

    Rather than https://wiki.st.com/stm32mpu/wiki/STM32MP15_TF-A which expose a solution for expert likely more error prone.

    Hope it help,

    Olivier

    1 reply

    Technical Moderator
    November 16, 2020

    Hi @EAlex.1​ ,

    I'm a bit surprise by your build command and value of CROSS_COMPILE

    Simple command line to properly buid a TF-A in provided SDK is :

    make -f Makefile.sdk TF_A_CONFIG=trusted TFA_DEVICETREE=<board>

    I guess you should rather look at page :

    https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Building_and_deploying_the_TF-A_for_the_first_time

    Rather than https://wiki.st.com/stm32mpu/wiki/STM32MP15_TF-A which expose a solution for expert likely more error prone.

    Hope it help,

    Olivier

    EAlex.1Author
    Visitor II
    November 18, 2020

    Thank you

    i will re-read that wiki page, and in the meantime i'll use the provided binary