cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the eMMC pins with OTP

ANiko.3
Associate II

Hello,

I have a custom board based on STM32MP151-C with an eMMC on the following pins:

  • SDMMC2_CK PE3 (AF09)
  • SDMMC2_D0  PE6 (AF07)
  • SDMMC2_CMD   PG6 (AF10)

I read that the ROM expects the the SDMMC2_D0 pin on PB14 so I need to change it by using values from the OTP. I found this link (https://community.st.com/s/question/0D50X0000AkQJiHSQW/how-to-change-emmc-interface) and did the same as the ST Support, just for my pins. Here are my results.

  • OTP3 = 0x00000004    SDMMC2 (uses non default AFmux defined in OTP)
  • OTP5 = 0x38745394
    • SDMMC2_CK = PE3 (bits[15:0]: port0=5=GPIOE, pin0=3, afmux0=9, mode0=4=AF;pull-up;medium-speed)
    • SDMMC2_D0 = PC8 (bits[31:16]: port1=3=GPIOC, pin1=8, afmux1=7, mode1=4=AF;pull-up;medium-speed)
  • OTP6 = 0x000076A4
    • SDMMC2_CMD = PG6 (bits[15:0]: port2=7=GPIOG, pin2=6, afmux2=10, mode2=4=AF;pull-up;medium-speed)

Could someone please let me know if I calculated the OTP values correctly? So I dont brick the board.

PS: How do I determine the speed on the pin (low, medium or high)?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
OlivierK
ST Employee

​Hi ANiko.3,

You've stated 2 different configurations for SDMMC2_D0

According to your configuration (PE3/PE6/PG6) , I found

OTP3 = 0x00000004

OTP5= 0x56745394

OTP6 correct.

or to your configuration (PE3/PC8/PG6) , I found

OTP3 = 0x00000004

OTP5= 0x38745394 (correct)

OTP6 correct.

Kind Regards

View solution in original post

10 REPLIES 10
OlivierK
ST Employee

​Hi ANiko.3,

You've stated 2 different configurations for SDMMC2_D0

According to your configuration (PE3/PE6/PG6) , I found

OTP3 = 0x00000004

OTP5= 0x56745394

OTP6 correct.

or to your configuration (PE3/PC8/PG6) , I found

OTP3 = 0x00000004

OTP5= 0x38745394 (correct)

OTP6 correct.

Kind Regards

Hi,

note that there is no SDMMC2_D0 on PC8, so the second config will not work.

Also note that eMMC boot is working only with few memory brand if you have silicon Rev.B. Silicon Rev.Z is corrected. See ES0438 for details (this is mentioned in the post you refer, so I think you are already aware).

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.
ANiko.3
Associate II

Hi to both of you and thatnks for the answer. Yes, I made a typo with the SDMMC2_D0 pin (PC8 is coming from the example), so the first configuration is the one I need.

@PatrickF​ We have the Rev.Z and the THGBMNG5D1LBAIL eMMC, so there shouldnt be a problem, but thanks for mentioning anyway.

I have a question for the Pin Mode. I set the Pin Mode to 4 which means "AF ; pull-up ; medium-speed"

  • All three pins in question have a pull-up resistor of 10k to the 3.3V. Is that meant by the pull-up in the pin mode?
  • The eMMC we have is THGBMNG5D1LBAIL. Is medium-speed the correct settings

Thanks.

With those OTP settings, we enable the internal pull-up (this is already the case with default BootROM eMMC pins). No issues to have both internal and external pull-up.

External pull-up on some eMMC signals are anyway required to avoid (slight) overconsumption from the eMMC in STANDBY (where all MP1 pins are floating as no VDDCORE), this is because usually the eMMC is still partly powered in platform Standby mode (e.g. VCCQ=VDD).

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.

Great, thanks. What about the speed? Is medium-speed correct?

Medium-speed is ok as BootROM use limited speed of around 16MHz (as only few hundred of kB are loaded for TF-A). This is to maximize compatibility whatever the external circuitry.

Later on (in TF-A or uBoot) SDMMC is set in 8 bits mode are higher frequency according to device tree settings (which also adapt the IO speed).

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.
ANiko.3
Associate II

Hello,

I set the OTP words 3, 5 and 6, but somehow the board doesnt boot. Here are my values now when I read them out of the OTP:

03 0x00000004     0         0         0         0         0         0

05 0x56745394     0         0         0         0         0         0

06 0x000076a4     0         0         0         0         0         0

The power consumption is a bit higher than when the CPU is in the serial boot mode. The TF-A is not sending anything over UART4 though. The Boots pins should be set correctly: 010.

Any thoughts?

Hello,

is the board fall back to Serial Boot (coud be seen on PA13 toggling. note that it is open drain driven, so need an external pull-up) ?

If yes, you need to analyze the Boot trace by doing a SYSRAM dump. See https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#Debug_and_Error_messages and https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_trace_analyzer

To dump the SYSRAM traces, without resetting the board after failure, you could use the following command on your Linux PC

openocd -f board/stm32mp15x_dk2.cfg -c 'init;cortex_a smp off;halt;dump_image traces.bin 0x2ffc1c00 2048;resume;shutdown'

Otherwise, your TF-A has been launch and you need to debug it.

Maybe see https://community.st.com/s/article/FAQ-STM32MP1-Bring-up-procedure

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.
alenik-mm
Associate II

Hi Patrick,

it was the TF-A device tree -I had to update it. Now I can boot up to the U-Boot successfully. Thanks again for your support.