Bring up the STM32MP135x - ST Training Course based on MYD-YF13X (Ⅲ)
2023-10-18
1528
This article will take MYIR’s MYD-YF13X and STM32MP135F-DK as examples, and continue to explain how to use STM32CubeMX combined with the developer package to implement the booting of the minimal system.
Following "Bring up the STM32MP135x - ST Training Course based on MYD-YF13X (I)"
"Bring up the STM32MP135x - ST Training Course based on MYD-YF13X (II)"
4.2 USB Boot: FW_CONFIG Configuration and Compilation
In the device tree file generated by STM32CubeMX, there is a config file “stm32mp135d-myir_bring_up-mx-fw-config.dts”, which defines the size of the DDR and contains the “stm32mp13-fw-config.dtsi” file. Once the DDR part of the configuration is completed, this file does not need to be changed and can be compiled directly to generate the “stm32mp135d-myir_bring_up-mx-fw-config.dtb” file, which is loaded into the board by TF-A in the form of a FIP package.
Please read WIKI How_to_configure_TF-A_FIP to learn about the FIP and the commands to generate it.
The FW_CONFIG file compiles:
PC $> cd
PC $> source
PC $> make -f ../Makefile.sdk TF_A_CONFIG=optee TF_A_DEVICETREE=stm32mp135d-myir_bring_up-mx DEPLOYDIR=../../myir_fip/arm-trusted-firmware/ stm32
After successful compilation:
In order to generate the FIP package, the rest of the components still need to be compiled: OP-TEE and U-Boot. We first compile the images of the components based on the nearly empty device tree of OP-TEE and U-Boot generated by STM32CubeMX. Note: Here we just compile a fake OP-TEE & U-Boot image first so that we can package up the FIP and load FW_CONFIG into it.
Compile OPTEE:
PC $> cd < optee-os-stm32mp-3.16.0-stm32mp-r2_path >
PC $> source
PC $> make -f ../Makefile.sdk CFG_EMBED_DTB_SOURCE_FILE=stm32mp135d-myir_bring_up-mx DEPLOYDIR=../../myir_fip/optee/ optee
Three files are generated after compilation, which need to be packaged into the FIP:
Compile U-Boot, and package FIP:
PC $> cd < u-boot-stm32mp-v2021.10-stm32mp-r2_path >
PC $> source
PC $> export FIP_DEPLOYDIR_ROOT=../../myir_fip /*Perform before any stage if requires FIP update*/
PC $> make -f ../Makefile.sdk FIP_CONFIG=optee UBOOT_DEFCONFIG=stm32mp13_defconfig DEVICETREE=stm32mp135d-myir_bring_up-mx DEPLOYDIR=../../myir_fip/u-boot/ all
Compile successfully and obtain:
Burn the generated FIP file to the board via USB and STM32CubeProgrammer. Test FW_CONFIG:
PC $> cd ../../myir_fip
PC $> STM32_Programmer_CLI -c port=usb1 -c port=usb1 -d arm-trusted-firmware/tf-a-stm32mp135d-myir_bring_up-mx-usb.stm32 0x1 -s 0x1 -d fip/fip-stm32mp135d-myir_bring_up-mx-optee.bin 0x3 -s 0x3
The serial port log after burning is as follows.
In the previous step, the serial port log stopped at:
"
INFO: handle USB : Suspend int
INFO: USB Suspend mode
INFO: handle USB : Reset
"
Stuck at further load FIP, FW_CONFIG. In this section, FW_CONFIG has been packed into the FIP and burned into the board, the serial port outputs more information, please check the highlight section, and eventually stops at the OP-TEE stage, and the Error Reporting section is also highlighted. Note: if the serial output is with "x/TC", it proves that it has already jumped to OP-TEE running, for example:
“
I/TC: Early console on UART#4
“
NOTICE: CPU: STM32MP135D Rev.Y
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23
…
INFO: handle USB : Reset
INFO: phase ID :3, Manifestation 0 at c716602a
INFO: Send detach request
INFO: Receive DFU Detach
INFO: DFU USB STOP...
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x30006000
INFO: Image id=1 loaded: 0x30006000 - 0x300061fa
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000
INFO: FCONF: Reading firmware configuration information for: mce_config
INFO: FCONF: Reading firmware configuration information for: dyn_cfg
INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewall
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0xce200000
INFO: Image id=4 loaded: 0xce200000 - 0xce20001c
INFO: OPTEE ep=0xce200000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x1
INFO: BL2: Loading image id 8
INFO: Loading image id=8 at address 0xce200000
INFO: Image id=8 loaded: 0xce200000 - 0xce2772e8
INFO: BL2: Loading image id 2
INFO: Loading image id=2 at address 0xc0400000
INFO: Image id=2 loaded: 0xc0400000 - 0xc040a4d0
INFO: BL2: Skip loading image id 16
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0000000
INFO: Image id=5 loaded: 0xc0000000 - 0xc00e4534
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0xce200000
INFO: SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC:
I/TC: Non-secure external DT found
I/TC: Embedded DTB found
E/TC:0 0 display_get_fb_addr_from_dtb:55 Can't find optee-framebuffer
E/TC:0 0 Panic at core/arch/arm/mm/core_mmu.c:364
E/TC:0 0 TEE load address @ 0xce200000
E/TC:0 0 Call stack:
E/TC:0 0 0xce203cb5
E/TC:0 0 0xce21bc1d
E/TC:0 0 0xce2040bb
E/TC:0 0 0xce2037e9
E/TC:0 0 0xce200198
Notes: If it is on STM32MP135F-DK, the serial port output is as follows:
NOTICE: CPU: STM32MP135F Rev.?
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23
ERROR: nvmem node board_id not found
INFO: PMIC version = 0x21
INFO: Reset reason (0x35):
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):()
NOTICE: BL2: Built : 05:42:16, Jul 11 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000kHz
INFO: Memory size = 0x20000000 (512 MB)
INFO: DFU USB START...
INFO: handle USB : Suspend int
INFO: USB Suspend mode
INFO: handle USB : Reset
INFO: handle USB : Reset
INFO: phase ID :3, Manifestation 0 at c71661a6
INFO: Send detach request
INFO: Receive DFU Detach
INFO: DFU USB STOP...
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x30006000
INFO: Image id=1 loaded: 0x30006000 - 0x30006246
PANIC at PC : 0x2ffe7a87
Exception mode=0x00000016 at: 0x2ffe7a87
PANIC appears after load image id 1, please note the difference between the design of the MYIR board and the STM32MP135F-DK: in addition to the different design of the power supply part, there is also a different selection of chips. MYIR uses the stm32mp135d series, while the demo board uses the stm32mp135f series. The difference between the two series is whether or not to include SAES, PKA, etc., secure IP and whether or not the DDRMCE attributes. MCE is enabled by default on the F series, and the FW_CONFIG file defines the area for DDR encryption, which needs to be configured by invoking MCE. The encryption process will use the RNG module, so the configuration of MCE, firewall need to enable the RNG in the TFA phase.
After enabling RNG, recompiling TFA, Deploy TF-A and FIP, the serial port output is as follows ( same as MYIR output):
NOTICE: CPU: STM32MP135F Rev.?
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23
ERROR: nvmem node board_id not found
INFO: PMIC version = 0x21
INFO: Reset reason (0x35):
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):()
NOTICE: BL2: Built : 07:44:48, Jul 11 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000kHz
INFO: Memory size = 0x20000000 (512 MB)
INFO: DFU USB START...
INFO: handle USB : Suspend int
INFO: USB Suspend mode
INFO: handle USB : Reset
INFO: handle USB : Reset
INFO: phase ID :3, Manifestation 0 at c71661a6
INFO: Send detach request
INFO: Receive DFU Detach
INFO: DFU USB STOP...
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x30006000
INFO: Image id=1 loaded: 0x30006000 - 0x30006246
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000
INFO: FCONF: Reading firmware configuration information for: mce_config
INFO: FCONF: Reading firmware configuration information for: dyn_cfg
INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewall
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0xde200000
INFO: Image id=4 loaded: 0xde200000 - 0xde20001c
INFO: OPTEE ep=0xde200000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x1
INFO: BL2: Loading image id 8
INFO: Loading image id=8 at address 0xde200000
INFO: Image id=8 loaded: 0xde200000 - 0xde2772e8
INFO: BL2: Loading image id 2
INFO: Loading image id=2 at address 0xc0400000
INFO: Image id=2 loaded: 0xc0400000 - 0xc040a600
INFO: BL2: Skip loading image id 16
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0000000
INFO: Image id=5 loaded: 0xc0000000 - 0xc00e4534
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0xde200000
INFO: SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC:
I/TC: Non-secure external DT found
I/TC: Embedded DTB found
E/TC:0 0 display_get_fb_addr_from_dtb:55 Can't find optee-framebuffer
E/TC:0 0 Panic at core/arch/arm/mm/core_mmu.c:364
E/TC:0 0 TEE load address @ 0xde200000
E/TC:0 0 Call stack:
2024-09-23
Ethernet Driver Porting Guide Based on MYIR's NXP i.MX.93 Development Board
Ethernet Driver Porting Guide Based on MYIR's NXP i.MX.93 Development Board MYD-LMX9X
2024-08-16
QT Development Guide for NXP i.MX 93 Development Board by MYIR
1. OverviewQt is a cross-platform graphical application development framework that is applied to devices and platforms of different sizes, while providing different license versions for users to choos
2024-06-16
Application Notes | Setting up OTA Functionality on MYIR's NXP i.MX 93 Development Board
1. OverviewOver-the-Air Technology (OTA) is a technology that enables remote management of mobile terminal equipment and SIM card data via the air interface of mobile communication. In this article, O
2024-06-13
Ubuntu System Porting Guide for Renesas RZ/G2L-based Remi Pi
1. OverviewLinux system platform has a variety of open source system building frameworks, which facilitate the developer in building and customizing embedded systems. Currently, some of the more commo
2024-05-22
Boosting the Power Industry: Notes on Porting the IEC61850 Protocol to the MYD-YF13X
Part 1: OverviewIEC 61850 is an international standard for communication systems in Substation Automation Systems (SAS) and management of Decentralized Energy Resources (DER). Through the implementati
2023-12-07
Developing AIGC using DNN through MYIR's Renesas RZ/G2L based Board
This evaluation report is provided by developer "ALSET" from MYIR’s forum. This article will introduce how to develop AIGC image using Deep Neural Networks (DNN) through MYIR’s Renesas RZ/G2
2023-10-31
How to Select MYIR's STM32MP1 based SOMs?
Choosing a suitable processor is a difficult problem that every engineer may face in the early stage of development. How do you choose a processor that fits into product development? Today, we will an
2023-09-26
Bring up the STM32MP135x - ST Training Course based on MYD-YF13X (II)
This article will take MYIR’s MYD-YF13X and STM32MP135F-DK as examples, and continue to explain how to use STM32CubeMX combined with the developer package to implement the booting of the minimal syste
2023-09-21
Take Great Advantages of SemiDrive's Super Powerful D9-Pro Processor
MYIR has launched the MYC-JD9360 System-On-Module and MYD-JD9360 development board based on SemiDrive’s D9-Pro processor in August. The D9-Pro is a super powerful MPU with six Arm Cortex-A55 cores (up