Skip to main content
Graduate II
September 14, 2024
Solved

custom board of STM32mp157f-dk2 , EMMC not detected

  • September 14, 2024
  • 1 reply
  • 4423 views

Hi , i am using the stm32mp157DAC processor , where in custom board i added the emmc with SDMMC2, 
in my hardware there is 3 bootpin, boot0 boot1 boot2 .
i did changes in u-boot DTS
i did changes in Linux DTS  only 

in u-boot DTS i added this line in SDMMC2.
&sdmmc2 {
pinctrl-names = "default", "opendrain", "sleep";
pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_a>;
pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_a>;
non-removable;
no-sd;
no-sdio;
st,neg-edge;
bus-width = <8>;
vmmc-supply = <&v3v3>;
vqmmc-supply = <&vdd>;
mmc-ddr-3_3v;
status = "okay";
};
---------------Pinctrl pinmux---------------------------------------------

sdmmc2_b4_pins_a: sdmmc2-b4-0 {
pins1 {
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('C', 7, AF10)>, /* SDMMC2_D7 */
<STM32_PINMUX('E', 5, AF9)>, /* SDMMC2_D6 */
<STM32_PINMUX('G', 6, AF10)>; /* SDMMC2_CMD */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 3, AF9)>; /* SDMMC2_CK */
bias-disable;
drive-push-pull;
slew-rate = <3>;
};
};
 
sdmmc2_b4_od_pins_a: sdmmc2-b4-od-0 {
pins1 {
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('C', 7, AF10)>, /* SDMMC2_D7 */
<STM32_PINMUX('E', 5, AF9)>; /* SDMMC2_D6 */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 3, AF9)>; /* SDMMC2_CK */
bias-disable;
drive-push-pull;
slew-rate = <3>;
};
pins3 {
pinmux = <STM32_PINMUX('G', 6, AF10)>; /* SDMMC2_CMD */
bias-disable;
drive-open-drain;
slew-rate = <1>;
};
};
 
sdmmc2_b4_sleep_pins_a: sdmmc2-b4-sleep-0 {
pins {
pinmux = <STM32_PINMUX('A', 8, ANALOG)>, /* SDMMC2_D4 */
<STM32_PINMUX('A', 9, ANALOG)>, /* SDMMC2_D5 */
<STM32_PINMUX('B', 3, ANALOG)>, /* SDMMC2_D2 */
<STM32_PINMUX('B', 4, ANALOG)>, /* SDMMC2_D3 */
<STM32_PINMUX('B', 14, ANALOG)>, /* SDMMC2_D0 */
<STM32_PINMUX('B', 15, ANALOG)>, /* SDMMC2_D1 */
<STM32_PINMUX('C', 7, ANALOG)>, /* SDMMC2_D7 */
<STM32_PINMUX('E', 3, ANALOG)>, /* SDMMC2_CK */
<STM32_PINMUX('E', 5, ANALOG)>, /* SDMMC2_D6 */
<STM32_PINMUX('G', 6, ANALOG)>; /* SDMMC2_CMD */
};
};

in linux DTS file same like this only .

this is the schamatic where emmc is connected

asadullah4571_0-1726309871572.png

Note:   After this changes i did not change anything ,
i boot from the SD card , in U-boot i run this command 
stm32 > emmc list
MMC: STM32 SD/MMC: 0
 
i do not want to boot from emmc just i want to check where my emmc is working properly or not or i want to see ion linux as well as u-boot that emmc is detected that's it only.

So please help me where i need to modify the codes as well as where i need to look for please help me out this .





    This topic has been closed for replies.
    Best answer by PatrickF

    Hi,

    you are trying to flash the SD-Card binaries into eMMC. You must use the eMMC ones with right TSV.

    Please have a look to https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout#e-E2-80-A2MMC

    Regards.

    1 reply

    Technical Moderator
    September 16, 2024

    HI @asadullah4571 

    as you only put partial schematics, could you confirm the pinmux is aligned with your board ?

    Did you have any console messages ?

    Did you see any activity on eMMC pins (CLK, CMD in particular) ?

    Regards.

    Graduate II
    September 20, 2024

    Hi @PatrickF 
    I detected the MMC1 in Linux . i unable to detect emmc in u-boot as well as i unable to boot from emmc.I attached the linux, u-boot and tf-a-stm32mp1 dts file whatever i changes in dts files. 

    please check the log , where i am missing 

    Here boot logs:

    2.543600] mmci-pl18x 58005000.mmc: Got CD GPIO
    [ 2.545039] mmci-pl18x 58007000.mmc: mmc1: PL180 manf 53 rev2 at 0x58007000 irq 71,0 (pio)
    [ 2.550939] stm32-display-dsi 5a000000.dsi: Fixed dependency cycle(s) with /soc/dsi@5a000000/panel-otm8009a@0
    [ 2.555582] mmci-pl18x 58005000.mmc: mmc0: PL180 manf 53 rev2 at 0x58005000 irq 70,0 (pio)
    [ 2.565489] mipi-dsi 5a000000.dsi.0: Fixed dependency cycle(s) with /soc/dsi@5a000000
    [ 2.648883] mmc0: new SDHC card at address 0001
    [ 2.654095] mmcblk0: mmc0:0001 SD 14.7 GiB
    [ 2.674016] GPT:Primary header thinks Alt. header is not at the end of the disk.
    [ 2.680018] GPT:10485759 != 30892031
    [ 2.683562] GPT:Alternate GPT header not at the end of the disk.
    [ 2.689695] GPT:10485759 != 30892031
    [ 2.693167] GPT: Use GNU Parted to correct GPT errors.
    [ 2.698455] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11
    [ 2.720819] mmc1: new DDR MMC card at address 0001
    [ 2.727241] mmcblk1: mmc1:0001 004GA1 3.69 GiB
    [ 2.734472] mmcblk1boot0: mmc1:0001 004GA1 2.00 MiB
    [ 2.741631] mmcblk1boot1: mmc1:0001 004GA1 2.00 MiB
    [ 2.749704] [drm] Initialized stm 1.0.0 20170330 for 5a001000.display-controller on minor 0
    [ 2.757598] mmcblk1rpmb: mmc1:0001 004GA1 512 KiB, chardev (244:0)
    [ 2.762268] input: pmic_onkey as /devices/platform/soc/5c007000.etzpc/5c002000.i2c/i2c-1/1-0033/5c002000.i2c:stpmic@33:onkey/input/input0

    root@stm32mp1:~# cd /dev
    root@stm32mp1:/dev# ls
    autofs gpiochip5 loop2 mmcblk0p7 ptyp4 ram7 tty10 tty26 tty41 tty57 ttyp4 vcsa2
    block gpiochip6 loop3 mmcblk0p8 ptyp5 ram8 tty11 tty27 tty42 tty58 ttyp5 vcsa3
    bus gpiochip7 loop4 mmcblk0p9 ptyp6 ram9 tty12 tty28 tty43 tty59 ttyp6 vcsa4
    char gpiochip8 loop5 mmcblk1 ptyp7 random tty13 tty29 tty44 tty6 ttyp7 vcsa5
    console gpiochip9 loop6 mmcblk1boot0 ram0 rfkill tty14 tty3 tty45 tty60 ubi_ctrl vcsa6
    cpu_dma_latency hwrng loop7 mmcblk1boot1 ram1 rtc tty15 tty30 tty46 tty61 uinput vcsa7
    disk i2c-0 mapper mmcblk1rpmb ram10 rtc0 tty16 tty31 tty47 tty62 urandom vcsu
    dri i2c-1 mem mqueue ram11 shm tty17 tty32 tty48 tty63 vcs vcsu1
    fd iio:device0 mmcblk0 net ram12 snd tty18 tty33 tty49 tty7 vcs1 vcsu2
    full iio:device1 mmcblk0p1 null ram13 stderr tty19 tty34 tty5 tty8 vcs2 vcsu3
    fuse initctl mmcblk0p10 ptmx ram14 stdin tty2 tty35 tty50 tty9 vcs3 vcsu4
    galcore input mmcblk0p11 ptp0 ram15 stdout tty20 tty36 tty51 ttySTM0 vcs4 vcsu5
    gpiochip0 kmsg mmcblk0p2 pts ram2 tee0 tty21 tty37 tty52 ttySTM3 vcs5 vcsu6
    gpiochip1 log mmcblk0p3 ptyp0 ram3 teepriv0 tty22 tty38 tty53 ttyp0 vcs6 vcsu7
    gpiochip2 loop-control mmcblk0p4 ptyp1 ram4 tty tty23 tty39 tty54 ttyp1 vcs7 watchdog
    gpiochip3 loop0 mmcblk0p5 ptyp2 ram5 tty0 tty24 tty4 tty55 ttyp2 vcsa watchdog0
    gpiochip4 loop1 mmcblk0p6 ptyp3 ram6 tty1 tty25 tty40 tty56 ttyp3 vcsa1 zero
    root@stm32mp1:/dev#


    but i try to detect in u-boot but fail. 

    - MPU : 800 MHz
    - MCU : 208.878 MHz
    - AXI : 266.500 MHz
    - PER : 24 MHz
    - DDR : 533 MHz
    Core: 361 devices, 44 uclasses, devicetree: board
    WDT: Started watchdog with servicing (32s timeout)
    NAND: 0 MiB
    MMC: STM32 SD/MMC: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    In: serial
    Out: serial
    Err: serial
    invalid MAC address 0 in OTP 00:00:00:00:00:00
    Net:
    Error: ethernet@5800a000 address not set.
    No ethernet found.

    No EFI system partition

    Error: ethernet@5800a000 address not set.

    Error: ethernet@5800a000 address not set.
    Hit any key to stop autoboot: 0
    STM32MP> mmc list
    STM32 SD/MMC: 2 (SD)
    STM32MP>

    Visitor II
    April 23, 2025

    Hi,

    I am facing the same issue with our custom board i was able to detect emmc in linux boot but not in uboot i have made the device tree changes in TF-A,uboot and linux-kernel-source

    this is my device tree configuration which i have added in below files 

    in kernel-source/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi,
    in uboot-source/arch/arm/dts/stm32mp15xx-dkx.dtsi,
    in tfa-source/fdts/stm32mp15xx-dkx.dtsi, and
    in uboot-source/arch/arm/dts/stm32mp157f-dk2-u-boot.dtsi

    &sdmmc2 {
    pinctrl-names = "default", "opendrain", "sleep";
            pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_c>;
            pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_c>;
            pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_c>;
     
            non-removable;
            no-sd;
            no-sdio;
            st,neg-edge;
            bus-width = <8>;
            vmmc-supply = <&v3v3>;
            vqmmc-supply = <&vdd>;
            mmc-ddr-3_3v;
            status = "okay";
     
    };

    Could you please let me know what changes you did due to which you were able to detect emmc on uboot

    Thanks,