Skip to main content
Visitor II
September 3, 2023
Solved

STM32MP151aac custom board kernel not starting

  • September 3, 2023
  • 19 replies
  • 14365 views

I'm trying to get to know stm32mp1 while making a board for this thing.

While using the default image provided by manufacturer seems to work. The kernel used is old compared to the current ST BSP and support from them isn't exactly great so I'm trying to migrate to the latest BSP. This isn't going so well.

Following instructions found in the wiki. I've managed to compile it but when trying to run, it just stops at 'starting kernel'. Recompiling with LL_DEBUG and EARLY_PRINTK, resulted in some more info.

The lines that seems to show an issue are:

[ 1.599531] i2c_dev: i2c /dev entries driver [ 1.606005] syscon-reboot: probe of reboot failed with error -22 [ 1.733737] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping .... [ 2.031116] irq: no irq domain found for gpio@54004000 ! [ 2.036565] gpio-keys joystick: Found button without gpio or irq [ 2.057386] gpio-keys: probe of joystick failed with error -22 [ 3.458283] Warning: unable to open an initial console. [ 3.465913] Freeing unused kernel image (initmem) memory: 1024K [ 3.487792] Run /init as init process 
[ 3.866045] udevd[133]: Starting version 244
[ 3.893045] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:18 Unknown group 'tty', ignoring
[ 3.917955] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:19 Unknown group 'tty', ignoring
[ 3.926963] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:20 Unknown group 'tty', ignoring
[ 3.947840] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:21 Unknown group 'tty', ignoring
[ 3.956848] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:22 Unknown group 'tty', ignoring
[ 3.988188] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:23 Unknown group 'tty', ignoring
[ 3.997197] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:24 Unknown group 'tty', ignoring
[ 4.028175] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:25 Unknown group 'dialout', ignoring
[ 4.047834] udevd[134]: /lib/udev/rules.d/50-udev-default.rules:27 Unknown group 'kmem', ignoring
[ 13.991414] arm-scmi firmware:scmi-0: Invalid channel descriptor for 'scmi-0'
[ 13.998713] arm-scmi: probe of firmware:scmi-0 failed with error -22
[ 14.011959] platform wifi-pwrseq: deferred probe pending
[ 14.017331] amba 48004000.sdmmc: deferred probe pending
[ 14.022685] amba 58005000.sdmmc: deferred probe pending
[ 14.027978] amba 58007000.sdmmc: deferred probe pending
[ 14.033239] platform led: deferred probe pending
[ 14.037911] platform 4c001000.mailbox: deferred probe pending
[ 14.043695] platform mlahb:m4@10000000: deferred probe pending
[ 14.049587] platform 48002000.dma-router: deferred probe pending
[ 14.055633] platform 4c000000.hwspinlock: deferred probe pending
[ 14.061701] platform 50000000.rcc: deferred probe pending
[ 14.067138] platform 50001020.pwr: deferred probe pending
[ 14.072595] platform 5000d000.interrupt-controller: deferred probe pending
[ 14.079536] platform soc:pin-controller@50002000: deferred probe pending
[ 14.086282] platform soc:pin-controller-z@54004000: deferred probe pending
[ 14.093221] platform 48000000.dma: deferred probe pending
[ 14.098692] platform 48001000.dma: deferred probe pending
[ 14.104128] platform 58000000.dma: deferred probe pending
[ 14.109585] platform 5a006000.usbphyc: deferred probe pending
[ 14.115368] platform 50001000.pwr: deferred probe pending
[ 14.120822] platform 4000f000.serial: deferred probe pending
[ 14.126520] platform 40010000.serial: deferred probe pending
[ 14.132237] platform 40018000.serial: deferred probe pending
[ 14.137954] platform 5c000000.serial: deferred probe pending
[ 14.143652] platform 54003000.rng: deferred probe pending
[ 14.149122] platform 58002000.nand-controller: deferred probe pending
[ 14.155606] platform 5800a000.ethernet: deferred probe pending
[ 14.161559] platform 49000000.usb-otg: deferred probe pending
[ 14.167348] platform 5800d000.usbh-ehci: deferred probe pending
[ 14.173332] platform 5c004000.rtc: deferred probe pending
[ 14.178788] platform 40013000.i2c: deferred probe pending
[ 14.184223] platform 5c002000.i2c: deferred probe pending
[ 14.189677] platform 50028000.thermal: deferred probe pending
[ 14.195463] platform 5a002000.watchdog: deferred probe pending
[ 14.201356] platform cpufreq-dt: deferred probe pending

Based on that I found another post that might be related, so I checked the dts files. No mention of mco1.

Next step was compiling the original device tree files with the same BSP mentioned earlier...

The complains raised by the compiler were that it couldn't find the sram and optee group. Have those been removed from stm32mp151.dtsi? According to another post the sram was renamed to sram1 but can't find that either. If so, is there a changelog somewhere that helps with migrating from an old bsp version?

    This topic has been closed for replies.
    Best answer by michiel.tjampens

    Finally solved it. Not that I understand the why nor the how...

    Reason was missing interrupt information in the pmic: stpmic@33 node...

    pmic: stpmic@33 {
    	...
    	interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;
    	interrupt-controller;
    	#interrupt-cells = <2>;
     ...
    };

    Why would missing interrupt info inside the pmic -that clearly is providing power- cause the emmc to not be found?

    Is there somewhere a piece of code that waits for the pmic before it does anything?

    @debuggingMight explain the issue you also had with pmic enabled ...

    19 replies

    Graduate II
    October 5, 2023

    What defconfig do you use for the kernel ? multi_v7_defconfig as mentioned in the ECO readme or the one used for u-boot ?

    Which device tree, the same one from u-boot or a different customized one ?

    your dts is quite close to mine but I do not use PMIC on I2C4  and  your MMC2 is 4 bits wide?> In my board MMC2 is the EMMC width 8 bits

    pinmux = <STM32_PINMUX('A', 8, AF9)>, /* SDMMC2_D4 */
    <STM32_PINMUX('A', 9, AF10)>, /* SDMMC2_D5 */
    <STM32_PINMUX('B', 3, AF9)>, /* SDMMC2_D2 */
    <STM32_PINMUX('B', 4, AF9)>, /* SDMMC2_D3 */
    <STM32_PINMUX('B', 14, AF9)>, /* SDMMC2_D0 */
    <STM32_PINMUX('B', 15, AF9)>, /* SDMMC2_D1 */
    <STM32_PINMUX('D', 3, AF9)>, /* SDMMC2_D7 */
    <STM32_PINMUX('E', 5, AF9)>, /* SDMMC2_D6 */
    <STM32_PINMUX('G', 6, AF10)>; /* SDMMC2_CMD */
    Visitor II
    October 5, 2023

    The multi_v7 one, but enabled LL_Debug & earlyprintk. Same device tree as u-boot, the lab mentioned that I should do this.

    Graduate II
    October 7, 2023

    I am now close or at the same point where you are that Linux does not start. From your git, it seems you use the Debian rootfs. My approach was using the starter package and create and bootable SD card. (The starter package can also be used to create the data on the EMMC via USB). Then  update the TF-A, U-boot, Optee build artifacts and update the bootfs with the kernel uImage and uboot files. IMHO I can just use the same rootfs as it's is also based on ECO 5.0.0 For further steps in debugging I got some inspiration from this https://medium.com/@villebaillie25/how-to-debug-your-linux-bsp-fd8bcb929544 

    Visitor II
    October 8, 2023

    Well yes and no about the debian rootfs. I'd prefer to use it and tried to, but given that the issue is that the kernel can't find the rootfs, that doesn't make much difference.

    Thats why rootfs used so far is the one you get from yocto (following the ST guide), thought it would be best to use ST stuff so I can get help here if it doesn't work...

    Can't use a SD card yet because the carrier I made for the module hasn't got sd card slot populated.. Figured internal emmc was less error prone than external sd...

    Currently tried following https://forum.digikey.com/t/debian-getting-started-with-the-stm32mp157/12459. This helps to do the building of the bootstages without the sdk, but it's for sd card.

    Visitor II
    October 8, 2023

    Ah, didn't see that edit before:

    "your dts is quite close to mine but I do not use PMIC on I2C4 and your MMC2 is 4 bits wide?> In my board MMC2 is the EMMC width 8 bits"

    Hm, I used that because the dts file from Myir (module manufacturer) didn't seem to refer to 8 bits so I figure the stm32mp151 has 4bit wide. Checked datasheet of the proc and has indeed 8 bits... So check the dts again and found it did specify 8 bit afterall (must have overlooked it somehow because the pinctrl was split).

    Altered the CubeMX project accordingly and rebuilding stuff etc. Shouldn't make a difference to the issue given that the bus was specified at 4 bits... But if it ends up working, it will be faster.

    Update: Rebuild the yocto dist with the changes, didn't make a difference.

    michiel.tjampensAuthorAnswer
    Visitor II
    October 8, 2023

    Finally solved it. Not that I understand the why nor the how...

    Reason was missing interrupt information in the pmic: stpmic@33 node...

    pmic: stpmic@33 {
    	...
    	interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;
    	interrupt-controller;
    	#interrupt-cells = <2>;
     ...
    };

    Why would missing interrupt info inside the pmic -that clearly is providing power- cause the emmc to not be found?

    Is there somewhere a piece of code that waits for the pmic before it does anything?

    @debuggingMight explain the issue you also had with pmic enabled ...

    Graduate II
    October 9, 2023

    Greadt find. My board uses legacy, regulator power. No PMIC. I had to remove all PMIC related power from the DTs and create new DTs for  regulator power.  The PMIC (likely STPMIC1) uses I2C and perhaps it also uses and interrupt to the MP .and perhaps the kernel did not enable the power to EMMC ?. Just a guess..

    debugging_0-1696867129548.png

    BTW when I use mmc dev 0 ; mmc info in U-boot prompt it shows 4 bit for EMMC while the DT specifies 8 bit.. An older ECO that boots fine from EMMC also shows 4 bit for EMMC.

    I am still stuck at kernel boot prompt...

     

    Visitor II
    October 9, 2023

    The pmic is enabled by tf-a because u-boot is loaded from emmc. All buck's are set to always on, so doubt they go out without reason. But I gues that depends on the implementation.

    Hm, mmc info here properly shows 8bit for mmc 1. So in you case mmc 0= emmc and mmc1 = sd? Because sd only goes up to 4bit.

    Graduate II
    October 12, 2023

    Perhaps the reason is I am booting from an SD card and you boot EMMC ?

    Do you use stCubeprogrammer via usb to flash the EMMC ?

    Seen the capacities, MMC0=SD  (16GB) and MMC1=EMMC. (4GB).

    mmc dev 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    STM32MP> mmc info
    mmc info
    Device: STM32 SD/MMC
    Manufacturer ID: 11
    OEM: 0
    Name: 004GA0
    Bus Speed: 52000000
    Mode: MMC High Speed (52MHz)
    Rd Block Len: 512
    MMC version 5.0
    High Capacity: Yes
    Capacity: 3.7 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 KiB
    HC WP Group Size: 4 MiB
    User Capacity: 3.7 GiB WRREL
    Boot Capacity: 2 MiB ENH
    RPMB Capacity: 512 KiB ENH
    Boot area 0 is not write protected
    Boot area 1 is not write protected

    Visitor II
    October 12, 2023

    Yes, tsv file and usb dfu via CubeProgrammer.

    Device: STM32 SD/MMC
    Manufacturer ID: 1
    OEM: 0
    Name: S40004
    Bus Speed: 52000000
    Mode: MMC High Speed (52MHz)
    Rd Block Len: 512
    MMC version 5.1
    High Capacity: Yes
    Capacity: 3.6 GiB
    Bus Width: 8-bit
    Erase Group Size: 512 KiB
    HC WP Group Size: 8 MiB
    User Capacity: 3.6 GiB WRREL
    Boot Capacity: 4 MiB ENH
    RPMB Capacity: 4 MiB ENH
    Boot area 0 is not write protected
    Boot area 1 is not write protected

    Main difference seems to be the 8-bit and double the boot capacity.