2023-08-28 10:28 PM - edited 2023-08-31 07:28 PM
STM32MP157AAA custom board with DRAM, SD- EMMC, USB and UART , Discrete power( no PMIC) . The board uses discrete oscillators for HSE and RTC, so they are set as Crystal OSC for both in CubeMX USB, UART are correctly configured (same as the default peripheral settings). DRAM is correctly setup based on the used DRAM chip. In .config the PMIC options is disabled and legacy power enabled
The CubemX settings were verified by the SOM manufacturer as being correct. This board has run a previous version of the ECO system without problems.
TF-A uses SCMI but if the file #include "stm32mp15-scmi-u-boot.dtsi" is included, errors occur.
To fix some other CubeMX generated dts file errors:
a. Add a file stm32mp157a-<board>.dsti file in the main dts file. (which CubeMX did not add as an include). This fle is empty.
b.. Add a binman entry to the stm32mp157a-<board>.dsti. Thee definition was found in stm32mp15-scmi-u-boot.dts and if not included u-boot fails with a message that bin-man was not included.
binman: binman {
multiple-images;
};
c. Removing the include file for the M4 that CubemX included (which caused a DMA2 build error)
d. Enable legacy power
e. in .config the "Enable SCMI agent SMCCC" and OP-TEE options are enabled, as well as Clock-> clock driver support =>Enable SCMI clock driver (and RCC clock driver is also enabled)
resulting dts file header:
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
#include "stm32mp157.dtsi"
#include "stm32mp15xa.dtsi"
#include "stm32mp15xxaa-pinctrl.dtsi"
#include "stm32mp157a-board-u-boot.dtsi"
//#include "stm32mp15-m4-srm.dtsi"
//#include "stm32mp15-scmi-u-boot.dtsi"
After building al binaries flashing fails with
11:16:29 : File download complete
11:16:29 : Time elapsed during download operation: 00:00:02.936
11:16:29 : RUNNING Program ...
11:16:29 : PartID: :0x01
11:16:29 : Start operation done successfully at partition 0x01
11:16:29 : Memory Programming ...
11:16:29 : Opening and parsing file: fip-stm32mp157a-board-optee.bin
11:16:29 : File : fip-stm32mp157a-board-optee.bin
11:16:29 : Size : 1.20 MB
11:16:29 : Partition ID : 0x03
11:16:29 : Download in Progress:
11:16:33 : File download complete
11:16:33 : Time elapsed during download operation: 00:00:04.134
11:16:33 : RUNNING Program ...
11:16:33 : PartID: :0x03
11:16:33 : Reconnecting the device ...
UART output:
PANIC at PC : 0x2ffec8f3
Exception mode=0x00000016 at: 0x2ffec8f3
Recompiled u-boot now wbased on the trusted defconfig tree but with legacy power instead of PMIC, gives another panic:
[ttyUSB0]: PANIC at PC : 0x2ffec8f3
[ttyUSB0]: 8f3n mode=0x00000016 at: 0x2ffec
Solved! Go to Solution.
2023-09-10 05:41 AM - edited 2023-09-17 05:08 AM
The key issues was to configure the clock settings and only 2 vdd nodes in the DT of TF-A.
See also the training material in the workshop.
2023-08-30 06:26 AM - edited 2023-08-31 09:26 PM
Experienced the same thing when building the linux kernel for the custom board as for u-boot. Same solution was to change the include headers
Found this topic: The external clock of our board is a crystal, and DK2 is an oscillator. After setting the TF-A DT clock correctly, our board can boot BL2 until U-Boot.
Tried all different settings with Cube MX: Crystal, Disabled, Bypass but nothing works to fix the panic after Cubeprogrammer transferred partition 0x03 Fip-boot and then shows a "reset". the usb connection is lost and cubeMx dumps a bunch of warning dialog boxes.
This board uses also a crystal, but the link mention on many replies from st: https://wiki.st.com/stm32mpu/wiki/Clock_device_tree_configuration_-_Bootloader_specific is broken. Reported this several times but no one is helping ?
CubeMX is set correctly for crystal:
T-FA DT:
When selecting"bypass" in CubeMX the following is generated
clocks {
/* USER CODE BEGIN clocks */
/* USER CODE END clocks */
clk_hsi: clk-hsi {
clock-frequency = <64000000>;
/* USER CODE BEGIN clk_hsi */
/* USER CODE END clk_hsi */
};
clk_lse: clk-lse {
clock-frequency = <32768>;
/* USER CODE BEGIN clk_lse */
/* USER CODE END clk_lse */
};
clk_hse: clk-hse {
clock-frequency = <24000000>;
/* USER CODE BEGIN clk_hse */
/* USER CODE END clk_hse */
};
};
Is this right ? How the select bypass so that it generates:
2023-09-05 12:13 AM - edited 2023-09-05 12:14 AM
Instead of using the makefile.sdk, build the TF-A as follows for
unset LDFLAGS;
unset CFLAGS;
make ARM_ARCH_MAJOR=7 ARCH=aarch32 PLAT=stm32mp1 STM32MP_SDMMC=1 STM32MP15=1 DTB_FILE_NAME=stm32mp157a-board-mx.dtb STM32MP_USB_PROGRAMMER=1
Generates:
build/stm32mp1/release/tf-a-stm32mp157a-board-mx.stm32
using this file with the CLI or in CubeProgrmamer as 1st image:
$sh STM32_Programmer.sh -vb 3 -c port=usb1 -w ../flash/tf-a-stm32mp157a-board-mx-usb.stm32 0x01 --start 0x01
results in:
NOTICE: CPU: STM32MP157AAA Rev.B
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mp1-v23.06.21
After this it stops. where is this point in the boot process ? what works and what not.
2023-09-10 05:41 AM - edited 2023-09-17 05:08 AM
The key issues was to configure the clock settings and only 2 vdd nodes in the DT of TF-A.
See also the training material in the workshop.