cancel
Showing results for 
Search instead for 
Did you mean: 

Boot a custom board with STM32MP153CAA from SDMMC2 interface

Todd Barrett
Associate II

We have a custom board with and STM32MP153CAA processor and are trying to get it to boot from an SMCC card on SDMMC2 interface. If I loaded the tf and fip files via a UART I am able to get u-boot running and then use the "run bootcmd_mmc0" to boot the linux kernel from the SDMMC2 car from there. So I know that the electrical connection to the SD card is correct. However we'd like to have the whole boot process read from the card at power up.

I have an SD card laid out with the partition scheme used to boot the discovery boards from SDMMC1 and have written the boot loaders to the card. I have tried setting the OTP word 3 to 0x10 which from ST's documentation I would believe should set up the boot from the SDMMC2 card and have set the boot pins to 101 binary which should tell the processor that the primary boot should be from SDMMC card, but if will not boot. I get nothing at all output to UART-4 which I have set up as console nor any indication that the board is trying to read from SDMMC2.

Does anyone have any guidance.

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

Hi,

I agree the wiki might be more clear.

Most users use default OTP settings.

Specific boot interface and pins (which need OTP settings) are usually seen only on advance users and so, need to dig a little bit more into the details and various documents.

Usual users playing with OTP have some socketed board for their development phase.

Setting Word3 =0x10 just tell that you want to use SD-Card on SDMMC2, but you must also define on which pins (using Word 5 6 and 7).

Please look athttps://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#Boot_from_SD_card

0693W00000NoyxZQAR.pngIn your case, BootROM requires CLK, CMD and D0, so according to your pins, you should define:

  • SDMMC2_CK as PE3, AF9, no pull, medium speed
  • SDMMC2_CMD as PG6, AF10, pull-up, medium speed
  • SDMMC2_D0 as PB14, AF9, pull-up, medium speed

This translate on:

Word5 = 0x76A45391

Word6 = 0x00002E94

Word7 = unused

(please double-check my values before burning them)

See https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#OTP_WORD_5_to_7_-_AFmux_configuration

This would allow to boot from SD-Card from SDMMC2 using your custom pins.

In https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_trace_analyzer, 'debugger' mean same debugger HW you use with CubeIDE supporting OpenOCD. Usually an STLink.

In fact Any debugger able to access the running target (without reset it) and dump the 0x2ffc1c00 0x2ffc23FF should be ok (then need to run the provided python script to decode the BootROM trace dump)

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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

6 REPLIES 6
PatrickF
ST Employee

Hi,

there could be multiple causes:

  • bad BOOT pins
  • badly programmed SD-Card
  • badly formatted TF-A binary (especially header)
  • bad OTP
  • bad HW around SD-Card (supplies, pull-ups, etc...)

Could you please provide OTP values you set-up (Word3, and Word5/6/7) and pins you use for SDMMC2_CLK, CMD and D0 (bare minimum required for BootROM to load TF-A) ?

Please check also https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#Debug_and_Error_messages

and try to get the BootROM trace using https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_trace_analyzer

Regards,

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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.
Todd Barrett
Associate II

So as I said I've set the OTP word-3 to 0x10 which is the best I could decipher from your documentation. I could not decipher your explanation of the AFMuxes so I let those alone. The explanation on the wiki page describes 3 AFMux words 5-7 however the explanation references only 32 bits which I can't divide up into 3 words unless the words are 10 2/3 bits apiece which is ridiculous. What is the AFMux? The data sheet for the SOC doesn't even mention them. If there's 3 words why doesn't the wiki describe them all. I would suggest to ST that the whole wiki section describing the OTP words be written more carefully, especially since writing the wrong thing to those registers could brick an entire board. What's "AFMux Value"? What's "Pin ID"? If it points to a pin how do you specify the pin with a number when all the pins are specified by letters and numbers. Maybe I understand "Pin Mode" from the document but that's about it.

.After loading the tf-a and fip files from a UART I can get the u-boot prompt on UART4 and command the board to boot from the sdmmc2 card using "run bootcmd_mmc0". The board boots an initramfs from the SD card and then I can mount other partitions on the card after linux boots so I believe the circuitry around the card is ok.

We use the following pins.

SDMMC2_D2 -- PB3

SDMMC2_D3 -- PB4

SDMMC2_D0 -- PB14

SDMMC2_D1 -- PB15

SDMMC2_CK -- PE3

SDMMC2_CMD -- PG6

What's "the debugger" mentioned in your second link referencing the page concerned with getting the BootROM trace.

PatrickF
ST Employee

Hi,

I agree the wiki might be more clear.

Most users use default OTP settings.

Specific boot interface and pins (which need OTP settings) are usually seen only on advance users and so, need to dig a little bit more into the details and various documents.

Usual users playing with OTP have some socketed board for their development phase.

Setting Word3 =0x10 just tell that you want to use SD-Card on SDMMC2, but you must also define on which pins (using Word 5 6 and 7).

Please look athttps://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#Boot_from_SD_card

0693W00000NoyxZQAR.pngIn your case, BootROM requires CLK, CMD and D0, so according to your pins, you should define:

  • SDMMC2_CK as PE3, AF9, no pull, medium speed
  • SDMMC2_CMD as PG6, AF10, pull-up, medium speed
  • SDMMC2_D0 as PB14, AF9, pull-up, medium speed

This translate on:

Word5 = 0x76A45391

Word6 = 0x00002E94

Word7 = unused

(please double-check my values before burning them)

See https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#OTP_WORD_5_to_7_-_AFmux_configuration

This would allow to boot from SD-Card from SDMMC2 using your custom pins.

In https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_trace_analyzer, 'debugger' mean same debugger HW you use with CubeIDE supporting OpenOCD. Usually an STLink.

In fact Any debugger able to access the running target (without reset it) and dump the 0x2ffc1c00 0x2ffc23FF should be ok (then need to run the provided python script to decode the BootROM trace dump)

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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.
Todd Barrett
Associate II

Thank you so much for your answer. This is just what I needed. From the values that you've put down I can now understand most of what the AFMux words specify. However, I can't really check completely if you've specified them correctly because I can't figure out what the "AFMux Value" specifies (bits 4-7 and 20-23), and why it would be 0x9 for two pins and 0xA for the the third.

PatrickF
ST Employee

Hi,

AFMUX mean the Alternate Function (AF) multiplexer (MUX) value.

Please refer to :

  • product Datasheet "Alternate function" tables (e.g. you will see SDMMC2_CK in row PE3 and column AF9)
  • product Reference Manual GPIO section (look for "alternate function" register)

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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.
Todd Barrett
Associate II

Thank you again. I searched the data sheet for AFMux and found nothing. In retrospect it should have been clear to me that AF was an acronym and I should have searched for just the string mux.