Changing the eMMC pins with OTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 06:10 AM
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.
Solved! Go to Solution.
- Labels:
-
STM32MP15 Lines
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 08:34 AM
​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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 08:34 AM
​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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 09:17 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 11:08 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 11:30 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 11:43 PM
Great, thanks. What about the speed? Is medium-speed correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-02 11:51 PM
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-03 06:24 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-03 06:43 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-03 06:48 AM
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.