cancel
Showing results for 
Search instead for 
Did you mean: 

custom board of STM32mp157f-dk2 , EMMC not detected

asadullah4571
Associate III

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 .





1 ACCEPTED SOLUTION

Accepted Solutions

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.

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.

View solution in original post

8 REPLIES 8
PatrickF
ST Employee

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.

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.

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>

Hi @PatrickF 

now in both linux & u-boot my EMMC is detected 

you can check the logs , but i try to flash the images on emmc but i got error like mmc 1 not found on STMcubeprogrammer.
I edited the tsv file of 157f-dk2. in place of mmc0 i put the mmc1. but not working. please let me know once where i am missing. 
bootpins: (b000) DFU mode.

asadullah4571_0-1726836419172.png

please let me know once where i am missing.

U-boot 
NAND: 0 MiB
MMC: STM32 SD/MMC: 0, STM32 SD/MMC: 1
Loading Environment from MMC... OK
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: 0 (SD)
STM32 SD/MMC: 1 (eMMC)
STM32MP>

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.

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.

Hi @PatrickF 

yes, you are right. right now i am using the stm32mp157f-dk2 image for my custom board. So i found only the sd_card imags (that's why i am using this images ) not the emmc images. so how can i build the emmc image for custom board (stm32mp157f-dk2). or which images should i use for emmc.

I think only some image should be change :-

- 0x03    fip-boot   FIP         none                 fip/fip-stm32mp157f-dk2-optee-sdcard.bin
P 0x04   fsbl1      Binary     mmc0                arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-sdcard.stm32
P 0x05   fsbl2      Binary     mmc0                arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-sdcard.stm32
P 0x08 fip-a         FIP         mmc0                 fip/fip-stm32mp157f-dk2-optee-sdcard.bin


i tried to found the emmc images but I didn't get.
 

 

Hi,

custom board mean custom images.

The starter package images provided by ST works only on ST boards with only the Flash available on those boards. There is no eMMC image for STM32MP157F-DK2 as this board only provide SD-Card..

You should create a Device Tree aligned with your board HW and build using Yocto.
Please have a look to following https://wiki.st.com/stm32mpu/wiki/SDK_for_OpenSTLinux_distribution

Regards

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.

Hi @PatrickF 

I understand. I know there is no emmc in the stm32mp157f-dk2 board. but  i added the emmc in my custom board which is based on stm32mp157-dk2. and i am using the Distribution package.
for my custom board i used the same DTS file which is stm32mp157f-dk2.dts. i added the extra thing in only the same dts file ( i did not make any custom dts file). i know this is not a good way, After complete  validation i will  create my own dts files.
now i am stuck in the emmc boot. currently i am using the SD_Card images.  emmc is detect succefully in u-boot and linux.
i want to try to flash the images from the emmc. but I unable to flash because there is only SD Card images. it make and build  only sd card images for stm32mp157f-dk2. is there any way to create the emmc images for stm32mp157f-dk2(custom board)?.

Hi @PatrickF 
i did the changes on local.conf i added this line STM32MP_DT_FILES_EMMC += "stm32mp157f-dk2"
then i build the image again, and it generats the images for emmc , and i did flash through the cubeprogrammer to emmc . and i change the bootpin (b010) , then it boots succefully from the emmc.

now this chapter is closed now ,