2025-05-29 8:40 AM
Dear community,
we use STM32MP1 SoC in some of our projects. Normally, we use eMMC card, so we use just two DIP switch positions: 000 (for uploading images into eMMC) and 010 (for booting from eMMC). We utilize SD card after booting from eMMC for storing our data.
Once I prepared bootable SD card and tried booting from SD using DIP switch 101 position. And nothing happened.
As long as we setup pins for SD card (in CubeMX, for example) and build images, Linux, U-boot and DTB become updated, so LInux and U-boot know, what actual pinout of SD card is. I wonder, at the first boot stage while BootROM selects media to proceed booting: eMMC, SD, USB (according to DIP switch position) how does it know actual SD (or eMMC) card pinout ?
I miss something important, please, guide me.
Solved! Go to Solution.
2025-06-02 12:34 AM
Yes, wrong OTP could easily brick the board.
OTP are on time programming and cannot be overridden.
There is no way to test it.
In mass production product, it is usually not a big deal to risk to brick few boards (or device if they are socketed).
That's explain we recommend to use the default pins unless it is seen as mandatory during board pin muxing study.
This example might help you to define OTP for SD-Card on SDMMC2
https://community.st.com/t5/stm32-mpus-products-and-hardware/boot-a-custom-board-with-stm32mp153caa-from-sdmmc2-interface/m-p/125860
Regards.
2025-05-29 11:17 PM
hi @mishuk ,
please refer to AN5031 (for STM32MP15) and https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_code_overview#Boot_from_SD_card
And if you don't want to Flashload your SD-Card on target using CubeProgrammer, see: https://wiki.st.com/stm32mpu/wiki/How_to_populate_the_SD_card_with_dd_command
Regards
2025-05-30 3:41 AM
Hi, Patrick
thank you for your reply. Now I know, that I should update OTP for setting actual pin layout for booting from SD card. That`s fine.
I tried reading OTP data (like described in wiki), but it fails. My log follows:
mishuk@mishukhp:~/stm/STM32CubeProgrammer/bin$ ./STM32_Programmer_CLI -c port=usb1 -otp displ
-------------------------------------------------------------------
STM32CubeProgrammer v2.14.0
-------------------------------------------------------------------
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN : 003300403432510B37373739
DFU protocol: 1.1
Board : --
Device ID : 0x0500
Device name : STM32MP15xx
Device type : MPU
Revision ID : --
Device CPU : Cortex-A7
UPLOADING OTP STRUCTURE ...
Partition : 0xF2
Size : 1024 Bytes
Uploading OTP data:
Error: unable to get the associate alternate setting of partition ID: 0xf2
Error: please make sure that your alternate settings have string descriptors with the right format
Error: the specified partition: 0xf2 is unreachable
Error: Read OTP Partition failed
Error: Uploading the OTP structure failed
Error: Initializing the OTP structure failed
Where did I get wrong ? How can I read and update OTP data ?
I forgot to mention that we are stuck with infrastructure based on STM ecosystem release 3, and I use STM32CubeProgrammer v2.14.0
2025-05-30 5:51 AM
Hi,
maybe try the lightweight https://wiki.st.com/stm32mpu/wiki/STM32PRGFW-UTIL
You should update to latest STM32CubeProgrammer (it should not create regression, whatever ecosystem you are using).
Regards
2025-05-30 9:22 AM
Patrick,
the latest STM32CubeProgrammer (2.19) also failed to read OTP data. But I succeeded to read OTP data using U-boot (fuse command). In STM OTP mapping I found that SD card might be
Does in mean that there is no way to boot from SD card connected to SDMMC3 ?
Next question: according to STM OTP mapping, OTP words 5-7 stand for non default AFmux. I suggest, that using these 3 words I can describe up to 6 pins, that is enough for SD 4-bit wide bus. I wonder, what is the order for pin description: does word5[15:0] refer to SDMMC_CK or SDMMC_CMD or any of SDMMC_Dx ?
2025-05-30 9:31 AM
Hi,
I confirm, no possible to boot from SDMMC3.
for OTP AFMUX remapping, you just need to define the 3 pins used by the BootROM, i.e. CLK/CMD/D0 as stated in AN5031 and wiki (CDIR is optional and depend on your level translator if any).
As it is quite tricky, I think you could find some working OTP example of SD-Card remapping on SDMMC2 in this forum.
The whole SD-Card pins are defined in DT for later usage by TF-A/uBoot/Linux, and could use 4 bits modes and higher speeds.
Regards.
2025-06-01 7:49 AM
Hi,
@PatrickF , you wrote "As it is quite tricky, I think you could find some working OTP example of SD-Card remapping on SDMMC2 in this forum".
If I flash OTP erroneously (with fuse prog ...), that will brick my board. Can I try OTP remapping with fuse override ... ? Does shadow registers persist after reboot (without power-off the board) ?
2025-06-02 12:34 AM
Yes, wrong OTP could easily brick the board.
OTP are on time programming and cannot be overridden.
There is no way to test it.
In mass production product, it is usually not a big deal to risk to brick few boards (or device if they are socketed).
That's explain we recommend to use the default pins unless it is seen as mandatory during board pin muxing study.
This example might help you to define OTP for SD-Card on SDMMC2
https://community.st.com/t5/stm32-mpus-products-and-hardware/boot-a-custom-board-with-stm32mp153caa-from-sdmmc2-interface/m-p/125860
Regards.