cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP12020.01-stm32mp-r2 freezes while "starting kernel"

rmaki.1
Associate II

I'm using a custom board(with STM32MP151C) with custom device tree, the distribution is built with ST's Distribution Package (st-image-core).

Now the bootloader (u-boot v2020.01) freezes while "starting kernel" with some strange errors before.

After waiting for a while, linux will reboot.

I had no problem with thud, but I had this problem with dunfell.

Should I search for errors in the DT or is there another reason for not starting the kernel?

NOTICE:  CPU: STM32MP151CAA Rev.Z
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board
WARNING: VDD unknownINFO:    Reset reason (0x214):
INFO:      IWDG2 Reset (rst_iwdg2)
INFO:    Using SDMMC
INFO:      Instance 1
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.2-r2.0(debug):v2.2-dirty
NOTICE:  BL2: Built : 13:36:23, Oct 22 2019
INFO:    Using crypto library 'stm32_crypto_lib'
INFO:    BL2: Doing platform setup
INFO:    RAM: DDR3-DDR3L 16bits 400000Khz
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 : 882895
INFO:    Image id=5 loaded: 0xc0100000 - 0xc01d78cf
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
INFO:    Cannot find st,stpmic1 node in DT
NOTICE:  SP_MIN: v2.2-r2.0(debug):v2.2-dirty
NOTICE:  SP_MIN: Built : 13:36:23, Oct 22 2019
INFO:    ARM GICv2 driver initialized
INFO:    stm32mp IWDG1 (12): Secure
INFO:    ETZPC: UART1 (3) could be non secure
INFO:    ETZPC: SPI6 (4) could be non secure
INFO:    ETZPC: I2C4 (5) could be non secure
INFO:    ETZPC: CRYP1 (9) could be non secure
INFO:    ETZPC: I2C6 (12) could be non secure
INFO:    SP_MIN: Initializing runtime services
INFO:    SP_MIN: Preparing exit to normal world
�
 
U-Boot 2020.01-stm32mp-r2 (Jan 06 2020 - 20:56:31 +0000)
 
CPU: STM32MP151CAA Rev.Z
Model: STMicroelectronics custom STM32CubeMX board
Board: stm32mp1 in trusted mode (st,stm32mp151c-portsetting-mx)
stm32_smc: Failed to exec svc=82001003 op=1 in secure mode (err = -3)
DRAM:  512 MiB
Clocks:
- MPU : 400 MHz
- MCU : 168 MHz
- AXI : 200 MHz
- PER : 64 MHz
- DDR : 400 MHz
 
�WDT:   Started with servicing (32s timeout)
NAND:  0 MiB
MMC:   STM32 SD/MMC: 0
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
invalid MAC address in OTP 00:00:00:00:00:00
stm32_smc: Failed to exec svc=82001003 op=1 in secure mode (err = -3)
Net:   
Error: ethernet@5800a000 address not set.
No ethernet found.
 
Hit any key to stop autoboot:  0 
Boot over mmc0!
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:4...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
256 bytes read in 3 ms (83 KiB/s)
Retrieving file: /splash.bmp
18244 bytes read in 6 ms (2.9 MiB/s)
1:      OpenSTLinux
Retrieving file: /uInitrd
3632474 bytes read in 364 ms (9.5 MiB/s)
Retrieving file: /uImage
7324192 bytes read in 730 ms (9.6 MiB/s)
append: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=0
Retrieving file: /stm32mp151c-portsetting-mx.dtb
52067 bytes read in 9 ms (5.5 MiB/s)
## Booting kernel from Legacy Image at c2000000 ...
   Image Name:   Linux-5.4.56
   Created:      2020-08-05   7:59:52 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7324128 Bytes = 7 MiB
   Load Address: c2000040
   Entry Point:  c2000040
   Verifying Checksum ... OK
## Flattened Device Tree blob at c4000000
   Booting using the fdt blob at 0xc4000000
   XIP Kernel Image
   Loading Ramdisk to cfc89000, end cffffd5a ... OK
   Loading Device Tree to cfc79000, end cfc88b62 ... OK
 
Starting kernel ...
 
 

When building this kernel, the following warning will be displayed

WARNING: st-initrd-1.0-r0 do_package: Manifest build-openstlinuxweston-stm32mp1-portsetting/tmp-glibc/sstate-control/manifest-x86_64_x86_64-nativesdk-st-image-resize-initrd.packagedata not found in stm32mp1_portsetting cortexa7t2hf-neon-vfpv4 cortexa7t2hf-neon cortexa7t2hf-vfp cortexa7hf-neon-vfpv4 cortexa7hf-neon cortexa7hf-vfp armv7vet2hf-neon-vfpv4 armv7vehf-neon-vfpv4 armv7vet2hf-neon armv7vehf-neon armv7vet2hf-vfp armv7vehf-vfp armv7at2hf-vfp armv7ahf-vfp armv6thf-vfp armv6hf-vfp armv5tehf-vfp armv5ehf-vfp armv5thf-vfp armv5hf-vfp allarch x86_64_x86_64-nativesdk (variant '')?

(Additional information)

The error log was successfully acquired by the following method.

I couldn't get the error log by earlyprintk by changing only menuconfig.

I was able to get the following error log by adding the description of early printk to extlinux.conf. I am still analyzing it.

https://wiki.st.com/stm32mpu/wiki/Dmesg_and_Linux_kernel_log#earlyprintk

Starting kernel ...                                                             
                                                                                
(Omit message)                                                
[    2.396500] kobject_add_internal failed for cpufreq-dt with -EEXIST, don't t.
[    2.414421] Unable to get STM32 DDR PMU clock                                
[    2.429193] dwc2 49000000.usb-otg: cannot get otg clock                      
[    2.444640] Unable to get STM32 DDR PMU clock                                
[    2.459535] dwc2 49000000.usb-otg: cannot get otg clock                      
[    2.471286] hctosys: unable to open rtc device (rtc0)                        
[    2.476896] ALSA device list:                                                
[    2.479893]   No soundcards found.                                           
[    2.483577] Warning: unable to open an initial console.                      
[    2.491222] Freeing unused kernel memory: 1024K                              
[    2.501176] Run /init as init process                                        
[    2.619037] udevd[147]: Starting version 244.3+
[    2.635794] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:18 Unknown group 'tty', ignoring
[    2.668101] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:19 Unknown group 'tty', ignoring
[    2.677133] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:20 Unknown group 'tty', ignoring
[    2.708077] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:21 Unknown group 'tty', ignoring
[    2.717110] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:22 Unknown group 'tty', ignoring
[    2.737756] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:23 Unknown group 'tty', ignoring
[    2.746772] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:24 Unknown group 'tty', ignoring
[    2.778096] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:25 Unknown group 'dialout', ignoring
[    2.797766] udevd[148]: /lib/udev/rules.d/50-udev-default.rules:27 Unknown group 'kmem', ignoring

As I proceeded with the analysis, rcc was not probed, so I couldn't detect rcc as a clock providor and found that the various devices that reference rcc are not enabled. However, the status on the device tree of rcc is okay, I don't know how rcc is probed.

The dts file decompiled from the dtb file is shown below.

rcc@50000000 {
			compatible = "st,stm32mp1-rcc-secure\0st,stm32mp1-rcc\0syscon";
			reg = < 0x50000000 0x1000 >;
			#clock-cells = < 0x01 >;
			#reset-cells = < 0x01 >;
			interrupts = < 0x00 0x05 0x04 >;
			clock-names = "hse\0hsi\0csi\0lse\0lsi";
			clocks = < 0x01 0x00 0x01 0x01 0x01 0x02 0x01 0x03 0x01 0x04 >;
			u-boot,dm-pre-reloc;
			pinctrl-names = "default\0sleep";
			pinctrl-0 = < 0x1d >;
			pinctrl-1 = < 0x1e >;
			status = "okay";
			#address-cells = < 0x01 >;
			#size-cells = < 0x00 >;
			phandle = < 0x0c >;
		};

1 REPLY 1
rmaki.1
Associate II

(Additional information)

It turns out that this problem is caused by the activation of rcc and MCO1.

For the time being, this problem can be avoided by deleting the description of MCO1.

However, it is not known why this problem occurred or what the correct fix is.

If anyone knows, please let me know.