cancel
Showing results for 
Search instead for 
Did you mean: 

How to change emmc interface

SChen.11
Associate III

Hi everyone,

The stm32mp1 use SDMMC2 as default emmc controller. Now, I need use SDMMC1 to connect emmc flash. And I saw the OTP need changed. Bud I am confuse about IOs of SDMMC1. Does it also need setting some OTP bits to pinmux CK, CMD, D0?

This picture show need change bit to chose SDMMC1.

0690X000008As5SQAS.png

This picture is confused me. When I use SDMMC1, is it need configure CMD, CK,D0 to default pinmux on SDMMC1? If it is needed, where to configure those?

0690X000008As5cQAC.png

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

Hello,

You have already find most information, just missing to set in OTP5-6 the definition of new pins to be used during boot.

In order to use eMMC on SDMMC1 and using (for example) SDMMC1_CK = PC12, SDMMC1_D0 = PC8, SDMMC1_CMD = PD2 pins (only 3 pins used during BootROM first stage of boot), you need to program the following:

  • OTP3 = 0x00080002     disable SD boot, select eMMC_if_id = SDMMC1
  • OTP5 = 0x38C43CC1
    • SDMMC1_CK = PC12 (bits[15:0]: port0=3=GPIOC, pin0=12, afmux0=12, mode0=0=AF;no pull;medium-speed)
    • SDMMC1_D0 = PC8 (bits[31:16]: port1=3=GPIOC, pin1=8, afmux1=12, mode1=4=AF;pull-up;medium-speed)
  • OTP6 = 0x000042C4
    • SDMMC1_CMD = PD2 (bits[15:0]: port2=4=GPIOD, pin2=2, afmux2=12, mode2=4=AF;pull-up;medium-speed)

You should also update devicetree and rebuild all subsequent level of boot to use SDMMC1 interface and pins (including all eMMC data lines pins , as later stages use 8-bit data mode).

Currently only Toshiba eMMC references presents on STM32MP157x_EV1 boards (THGBMNG5D1LBAIL or THGBMDG5D1LBAIL) are validated with STM32MP1 series.

Some links to complete this post:

wiki/STM32MP15_ROM_code_overview#Boot_from_e-E2-80-A2MMC-E2-84-A2

wiki/How_to_cross-compile_with_the_Developer_Package

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

16 REPLIES 16
PatrickF
ST Employee

Hello,

You have already find most information, just missing to set in OTP5-6 the definition of new pins to be used during boot.

In order to use eMMC on SDMMC1 and using (for example) SDMMC1_CK = PC12, SDMMC1_D0 = PC8, SDMMC1_CMD = PD2 pins (only 3 pins used during BootROM first stage of boot), you need to program the following:

  • OTP3 = 0x00080002     disable SD boot, select eMMC_if_id = SDMMC1
  • OTP5 = 0x38C43CC1
    • SDMMC1_CK = PC12 (bits[15:0]: port0=3=GPIOC, pin0=12, afmux0=12, mode0=0=AF;no pull;medium-speed)
    • SDMMC1_D0 = PC8 (bits[31:16]: port1=3=GPIOC, pin1=8, afmux1=12, mode1=4=AF;pull-up;medium-speed)
  • OTP6 = 0x000042C4
    • SDMMC1_CMD = PD2 (bits[15:0]: port2=4=GPIOD, pin2=2, afmux2=12, mode2=4=AF;pull-up;medium-speed)

You should also update devicetree and rebuild all subsequent level of boot to use SDMMC1 interface and pins (including all eMMC data lines pins , as later stages use 8-bit data mode).

Currently only Toshiba eMMC references presents on STM32MP157x_EV1 boards (THGBMNG5D1LBAIL or THGBMDG5D1LBAIL) are validated with STM32MP1 series.

Some links to complete this post:

wiki/STM32MP15_ROM_code_overview#Boot_from_e-E2-80-A2MMC-E2-84-A2

wiki/How_to_cross-compile_with_the_Developer_Package

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.
SMich.1
Senior

hi, i have some issue with that answer .

i updated the OTP3 , 5, 6 like PAtrik said and my emmc connected to those pins. and i managed to write via stm32Programmer and flash layouts mmc to this emmc so it working but the boot didn't start

what i missed?

PatrickF
ST Employee

Hello,

Which eMMC reference are you using ?

Which silicon revision are you using ? See datasheet (e.g. DS12505) to see where the revision is located on package marking.

There is a know bug on STM32MP15x silicon Rev.B which avoid some(most) eMMC reference to boot correctly, this is solved in Rev.Z silicon revision.

Meanwhile, as an indication, Toshiba THGBMNG5D1LBAIL, THGBMDG5D1LBAIL, and Kingston EMMC04G-M627-X03U have shown to operate correctly on the STM32MP157C-EV1 board which are using Rev.B silicon.

Rev.Z is in production from some months (there could still be some Rev.B in stock at distributors, so you should ask before placing order).

See ES0438: STM32MP151x/3x/7x device limitations

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.
SMich.1
Senior

KLMBG2JENB emmc i using stm32mp153aaa3 rev B

 may be i need to change the pins to no pull ?

Hello,

As stated above, I fear the issue come from the Samsung eMMC together with the STM32MP1 silicon Rev.B .

There is no workaround except changing the eMMC to a Toshiba or Kingston (recommended reference stated above, but other might work) or much better to latest STM32MP1 silicon Rev.Z.

Changing pin settings will not help, it is a matter of timing response from eMMC.

As an ugly workaround (just to confirm it could fly), issuing a manual NRST_CORE low pulse might work.

This will restart the boot process (without any power cycle nor eMMC reset) and could allow to boot correctly as the eMMC memory might respond faster the second time the boot sector content is requested.

I understand it could be a frustrating issue.

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.
SMich.1
Senior

tnx. i will replace the emmc it would be faster.

can i boot the emmc from UBOOT that i uploaded through usb dfu?

I think so, but as I'm more on HW side, I cannot help much on that. There is some related command available in uBoot.

Alternatively, you could do first boot phases from another Flash (Serial-NOR, SD-Card) which only contain TF-A and uBoot. This is supported by CubeProgrammer (there is examples of .tsv files for NOR+SDCARD which might help).

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.
SMich.1
Senior

hey patric we switched the emmc to emmc that in the EV board and the board resets itself all the time. do you have suggestions ?