cancel
Showing results for 
Search instead for 
Did you mean: 

Various issues when starting kernel on custom stm32mp151aac board

I'm still trying to get a fully error free bootup on the stm32mp151 based board. I'm using ST git's for the bootstages and kernel/rootfs are build using the ST yocto layers.

But because i'm unsure which are actually errors and which are just warnings I can ignore. Nor want to start 5 threads for each one, I figured it was best to combine them in one. Chances are likely they are inter related anyway.

I get this error, but further in the bootlog optee is properly initialized, so can this be ignored?

 [ 0.109710] Driver 'scmi-optee' was unable to register with bus_type 'tee' because the bus was not initialized.

This is the main issue, am I forgetting someting in the DT? (attached)

 

[ 0.516254] sysfs: cannot create duplicate filename '/devices/platform/cpufreq-dt'
[ 0.516281] CPU: 0 PID: 38 Comm: kworker/u2:3 Not tainted 6.1.28-dirty #1
[ 0.516303] Hardware name: STM32 (Device Tree Support)
[ 0.516314] Workqueue: events_unbound deferred_probe_work_func
[ 0.516363] unwind_backtrace from show_stack+0x10/0x14
[ 0.516398] show_stack from dump_stack_lvl+0x40/0x4c
[ 0.516425] dump_stack_lvl from sysfs_warn_dup+0x58/0x64
[ 0.516455] sysfs_warn_dup from sysfs_create_dir_ns+0xe8/0xfc
[ 0.516482] sysfs_create_dir_ns from create_dir+0x1c/0x164
[ 0.516512] create_dir from kobject_add_internal+0xa4/0x208
[ 0.516540] kobject_add_internal from kobject_add+0x5c/0xcc
[ 0.516569] kobject_add from device_add+0x110/0x6a0
[ 0.516606] device_add from platform_device_add+0x120/0x250
[ 0.516641] platform_device_add from platform_device_register_full+0x108/0x158
[ 0.516674] platform_device_register_full from stm32_cpufreq_probe+0xf0/0x198
[ 0.516710] stm32_cpufreq_probe from platform_probe+0x5c/0xbc
[ 0.516740] platform_probe from really_probe+0xe0/0x414
[ 0.516767] really_probe from __driver_probe_device+0x9c/0x130
[ 0.516791] __driver_probe_device from driver_probe_device+0x30/0xc0
[ 0.516815] driver_probe_device from __device_attach_driver+0xa8/0x120
[ 0.516840] __device_attach_driver from bus_for_each_drv+0x80/0xd0
[ 0.516864] bus_for_each_drv from __device_attach+0xac/0x214
[ 0.516886] __device_attach from bus_probe_device+0x84/0x8c
[ 0.516909] bus_probe_device from deferred_probe_work_func+0x94/0xd4
[ 0.516932] deferred_probe_work_func from process_one_work+0x1d8/0x518
[ 0.516968] process_one_work from worker_thread+0x220/0x50c
[ 0.516997] worker_thread from kthread+0xd8/0xf4
[ 0.517024] kthread from ret_from_fork+0x14/0x2c
[ 0.517050] Exception stack(0xde8adfb0 to 0xde8adff8)
[ 0.517066] dfa0: 00000000 00000000 00000000 00000000
[ 0.517082] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 0.517096] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 0.517109] kobject_add_internal failed for cpufreq-dt with -EEXIST, don't try to register things with the same name in the same directory.

 

What are those device links?

 

[ 3.571308] stpmic1 0-0033: PMIC Chip Version: 0x21
[ 3.626911] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 0-0033
[ 3.651272] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 0-0033
[ 3.660104] stpmic1-regulator 5c002000.i2c:stpmic@33:regulators: Failed to create device link (0x180) with 0-0033

 

These can be ignored?

 

[ 3.904198] dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
[ 3.921734] dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator

[ 9.682918] systemd[1]: Huge Pages File System was skipped because of an unmet condition check (ConditionPathExists=/sys/kernel/mm/hugepages).

[ 10.247547] systemd[1]: File System Check on Root Device was skipped because of an unmet condition check (ConditionPathIsReadWrite=!/).

[ 10.303876] systemd[1]: systemd-journald.service: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[ 10.345984] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)

 

21 REPLIES 21

@allard.potmaIt's probably indeed the same issue, so your posts are where they belong.

Well I've tried adding the pmic things to the optee device tree... After building with Yocto (st recipes) result is even worse than it was before.

 

I/TC: OP-TEE version: 3.19.0-dev (gcc version 12.2.0 (GCC)) #1 Fri Oct 14 19:00:05 UTC 2022 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp151a-tios-mx.dts
I/TC: DTB enables console (non-secure)
E/TC:0 0 probe_dt_drivers:750 Probe sequence result: 0x80000000
E/TC:0 0 Panic

 

 

Building optee with the altered device tree (attached) doesn't show any issues.

Next up was using the original one but build to show debug. For some reason, the scripts that build a working setup before now don't even manage to build something that get tf-a loaded... (no errors during build, using the same repo's, dt's identical to the yocto version etc...)

Panic at PC : 0x2ffeb4d1

 

allard.potma
Associate II

Not sure if this is the problem, and why, but I think this:

interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;

needs to be:

interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;

In optee

 

So atleast I managed to fix my scripts, no idea how though..

For some reason the fip build did something that optee doesn't like...

Either way, attached are three logs, all of which have optee debug enabled:

  • badprogram: the output when I try to program the stm with the earlier posted altered optee dt
  • goodprogram: the output when It programs the stm without having altered the dt
  • boot.log: After 'goodprogram' this is the output of the stm when booting

@allard.potmaTried altering that interrupt line, same kind of panic.

 

NOTICE:  CPU: STM32MP151AAC Rev.Z
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mp1-v23.06.21
NOTICE:  BL2: v2.8-stm32mp1-r1.1(release):61924c0(61924c04)
NOTICE:  BL2: Built : 18:44:39, Nov 24 2023
NOTICE:  BL2: Booting BL32
I/TC: Early console on UART#4
I/TC: 
I/TC: Embedded DTB found
I/TC: OP-TEE version: 3.19.0-stm32mp-r1.1-dev (gcc version 11.3.0 (GCC)) #7 Fri Nov 24 19:00:30 UTC 2023 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: WARNING: All debug access are allowed
I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp151a-tios-mx.dts
I/TC: DTB enables console (non-secure)
E/TC:0 0 probe_dt_drivers:750 Probe sequence result: 0x80000000
E/TC:0 0 Panic at core/kernel/dt_driver.c:754 <probe_dt_drivers>
E/TC:0 0 TEE load address @ 0xde000000
E/TC:0 0 Call stack:
E/TC:0 0  0xde002601
E/TC:0 0  0xde014581
E/TC:0 0  0xde0139e1
E/TC:0 0  0xde0150b5
E/TC:0 0  0xde00242f
E/TC:0 0  0xde00019c 

 

According to this it is/was a known bug in ST optee repo?

Christophe Guibout
ST Employee

Hello @michiel.tjampens ,


@michiel.tjampens wrote:

I get this error, but further in the bootlog optee is properly initialized, so can this be ignored?

 [ 0.109710] Driver 'scmi-optee' was unable to register with bus_type 'tee' because the bus was not initialized.

You can ignore this message.

BR,

Christophe

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
DMårt
Senior III

@michiel.tjampens @Christophe Guibout @allard.potma 

Hi!

I got the same issue! STM32MP151AAC3 processor here.

Question: How can I configure so Op-tee will be in debug-mode?

 

 

NOTICE:  CPU: STM32MP151AAC Rev.Z
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
INFO:    PMIC version = 0x21
INFO:    Reset reason (0x15):
INFO:      Power-on Reset (rst_por)
INFO:    FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO:    FCONF: Reading firmware configuration information for: stm32mp_io
INFO:    FCONF: Reading firmware configuration information for: stm32mp_fuse
INFO:    Using USB
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.8-stm32mp1-r2.0(debug):8a4da21f2-dirty(8a4da21f)
NOTICE:  BL2: Built : 23:01:45, Aug  5 2024
INFO:    BL2: Doing platform setup
INFO:    RAM: DDR3-DDR3L 16bits 533000kHz
INFO:    Memory size = 0x20000000 (512 MB)
INFO:    DFU USB START...
INFO:    phase ID :3, Manifestation 3 at c714f9a2
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 0x2ffff000
INFO:    Image id=1 loaded: 0x2ffff000 - 0x2ffff1ea
INFO:    FCONF: Reading FW_CONFIG firmware configuration file from: 0x2ffff000
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 0xde000000
INFO:    Image id=4 loaded: 0xde000000 - 0xde00001c
INFO:    OPTEE ep=0xde000000
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 0xde000000
INFO:    Image id=8 loaded: 0xde000000 - 0xde028e08
INFO:    BL2: Skip loading image id 9
INFO:    BL2: Loading image id 2
INFO:    Loading image id=2 at address 0xc0500000
INFO:    Image id=2 loaded: 0xc0500000 - 0xc0511bd8
INFO:    BL2: Skip loading image id 16
INFO:    BL2: Loading image id 5
INFO:    Loading image id=5 at address 0xc0100000
INFO:    Image id=5 loaded: 0xc0100000 - 0xc0214c94
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde000000
INFO:    SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Embedded DTB found
I/TC: OP-TEE version: 8a4da21f2-dev (gcc version 12.3.0 (GCC)) #7 Mon Aug  5 15:59:33 UTC 2024 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp151a-stm32-computer-firmware-mx.dts
I/TC: OP-TEE ST profile: system_services
E/TC:0 0 probe_dt_drivers:795 Probe sequence result: 0x80000000
E/TC:0 0 Panic

 

 

And the CubeProgrammer output

 

  01:35:51 : UR connection mode is defined with the HWrst reset mode
  01:35:51 : USB speed   : High Speed (480MBit/s)
  01:35:51 : Manuf. ID   : STMicroelectronics
  01:35:51 : Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
  01:35:51 : SN          : 002600373431510433383938
  01:35:51 : DFU protocol: 1.1
  01:35:51 : Board       : --
  01:35:51 : Device ID   : 0x0500
  01:35:52 : Start Embedded Flashing service
  01:35:52 : Memory Programming ...
  01:35:52 : Opening and parsing file: tf-a-stm32mp151a-stm32-computer-firmware-mx-usb.stm32
  01:35:52 :   File          : tf-a-stm32mp151a-stm32-computer-firmware-mx-usb.stm32
  01:35:52 :   Size          : 220.41 KB 
  01:35:52 :   Partition ID  : 0x01 
  01:35:52 : Download in Progress:
  01:35:54 : File download complete
  01:35:54 : Time elapsed during download operation: 00:00:02.480
  01:35:54 : RUNNING Program ... 
  01:35:54 :   PartID:      :0x01 
  01:35:55 : Start operation done successfully at partition 0x01
  01:35:55 : Memory Programming ...
  01:35:55 : Opening and parsing file: fip-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.bin
  01:35:55 :   File          : fip-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.bin
  01:35:55 :   Size          : 1.31 MB 
  01:35:55 :   Partition ID  : 0x03 
  01:35:55 : Download in Progress:
  01:35:56 : File download complete
  01:35:56 : Time elapsed during download operation: 00:00:01.744
  01:35:56 : RUNNING Program ... 
  01:35:56 :   PartID:      :0x03 
  01:35:57 : Reconnecting the device ...
  01:36:27 : Error: Unable to reconnect the target device: time out expired
  01:36:27 : Error: Start operation failed at partition 0x03
  01:36:27 : Error: TSV flashing service failed
  01:36:27 : Disconnected from device.

 

 

 

I've given up on getting the stm32mp1 working properly, to many unsolved/undocumented issues and in the end it wasn''t fast enough to my liking.

Regarding optee debug. According to the script i made to build optee, this needs to be the make in the make

CFG_TEE_CORE_LOG_LEVEL=4 DEBUG=1

Meaning it's defined at build time, not a configuration ( i think).

@michiel.tjampens 

I understand. ST seems to produce a processor (STM32MP151) and they don't care about the software. No examples etc and no "How to build - Step by step" instructions.

I will give STM32MP151AAC3 a try. I trying to copy and paste the STM32MP157 .dts files into STM32MP151 .dts files as much as possible. They are after all, the same processor. 

It's CFG_TEE_CORE_LOG_LEVEL=3 for Debug.

 

I tried doing that in the beginning (start from 157) but if I remember correctly there are significant differences...

I zipped all the dts's I made: https://we.tl/t-IoIeFy4mdE

Those are also for the 151a, was using a SoM made by Myir that uses a PMIC. Might be of use.

Hello @DMårt ,

To investigate the panic in Optee, increasing the debug log level is a good idea, and you can also use GDB.

ST provides a wiki with step by step instructions:

- How to debug OP-TEE

In this page, there are some explanations about how to enable debug logs: see "Debug with traces" chapter.

- How to use GDB

ST also provides some boards (Evaluation and Discovery) with related software upstreamed into community : having a look into these examples could help to progress in your investigations.

BR,

Christophe

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.