cancel
Showing results for 
Search instead for 
Did you mean: 

first-stage bootloader for a custom STM32MP13 board with no SD and no JTAG?

cbcooper
Senior

The board was designed incorrectly, they have pins for a JTAG but forgot to actually route them to the MPU.  The eMMC is not going to have a first-stage bootloader on it, and it's looking like it's not possible to flash an SPL to the eMMC over USB alone?  Management won't be happy to do another board spin but it's sure looking like that's the only path forward.

ChatGPT says:

  1. USB DFU alone cannot flash first-stage bootloader (SPL) to eMMC on a totally blank STM32MP135.

  2. This is not a dfu-util bug — it’s how the STM32MP1 ROM works.

  3. You need hardware access to write SPL + U-Boot to eMMC:

  • Option A: SWD / JTAG (ST-LINK)

    • CubeProgrammer can directly write SPL + U-Boot to eMMC.

  • Option B: SD card boot

    • The ROM can load a SPL + U-Boot image from SD into RAM and then copy it to eMMC.

14 REPLIES 14
PatrickF
ST Employee

Hi @cbcooper 

chatGPT is two times wrong (btw, did you try sidekick chat on this page ?):

  • eMMC FSBL is fully supported and vastly used by customers.
  • For MPU lines (all STM32MPxxx), flashing is NOT done with JTAG, but with USB. JTAG is only for debug.

 

Some information on eMMC flashlayout here : https://wiki.st.com/stm32mpu/wiki/TM32CubeProgrammer_flashlayout#e-E2-80-A2MMC

eMMC boot has few HW constrains, please check if your board is aligned with  

PatrickF_0-1765178359045.png

 

see also https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_code_overview#Boot_from_e-E2-80-A2MMC-E2-84-A2

and

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_code_overview#Boot_device_selection_on_STM32MP1_series

 

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.
NEW ! Sidekick STM32 AI agent, see here
cbcooper
Senior

How can I get my first-stage bootloader onto the MMC?

If I execute 

dfu-util -l

it responds

dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [0483:df11] ver=0200, devnum=11, cfg=1, intf=0, path="2-1.3.2.1.1", alt=1, name="@virtual /0xF1/1*512Ba", serial="002100123232510738323637"
Found DFU: [0483:df11] ver=0200, devnum=11, cfg=1, intf=0, path="2-1.3.2.1.1", alt=0, name="@FSBL /0x01/1*128Ke", serial="002100123232510738323637"

so my card is connected.

If I try to write the SPL to the MMC using

dfu-util.exe -a 0 -s 0x08000000:leave -D spl\u-boot-spl.bin

it fails with

Warning: Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release
Opening DFU capable USB device...
Device ID 0483:df11
Device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0110
Warning: DfuSe option used on non-DfuSe device
Device returned transfer size 1024
DfuSe interface name: "FSBL "
Downloading element to address = 0x08000000, size = 93818
Last page at 0x08016e79 is not writeable

If instead I run STM32CubeProgrammer and select USB and hit Connect it seems happy:

cbcooper_0-1765204529457.png

but where I go from there I have no idea.

What's my best path for programming the SPL onto the MMC?

cbcooper
Senior

Regarding the interface between the MPU and the MMC - we're using a THGBMTG5D1LBAIL and it mostly matches the example in section 8.9 "eMMC Flash" of AN5474 except that it's connected in 4 bit mode (D4..D7 unconnected).

The boot pins on the MPU don't seem to match any of the connection examples:

cbcooper_1-1765205685071.png

 

 

cbcooper
Senior

The chat button in the lower-right corner isn't happy:

cbcooper_0-1765205821007.png

Is that what you meant by "sidekick chat on this page"?

Hi,

trying to help, but there is no simple answer, and I'm not expert on this.

 

If using the STM32MP13 in bare-metal (i.e. using STM32CubeMP13 HAL SW), please look at https://wiki.st.com/stm32mpu/wiki/How_to_load_and_start_STM32CubeMP13_applications_via_eMMC_storage

 

If you want to use OpenSTLinux, then you should build full custom board image (using Yocto) and use Cubeprogrammer with adequate Flashlayout for eMMC (see https://wiki.st.com/stm32mpu/wiki/TM32CubeProgrammer_flashlayout#e-E2-80-A2MMC).
Note that u-boot SPL is not supported as FSBL. you must use TF-A
https://wiki.st.com/stm32mpu/wiki/Boot_chain_overview#STM32MP13_boot_chain


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.
NEW ! Sidekick STM32 AI agent, see here

@cbcooper wrote:

The chat button in the lower-right corner isn't happy:


Sometimes, logging-out from the forum and then logging back in can help...

The "Sidekick" button looks like this:

AndrewNeil_0-1765206290501.png

How to use STM32 Sidekick

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Regarding dfu-util, you first need to load TF-A into the internal RAM, then this binary will initialize the DDR.
Then you could load uBoot (FIP).

It is not usually foreseen for Flashloading (but uBoot can do flashloading, cube programmer is using uBoot to flash).

https://wiki.st.com/stm32mpu/wiki/How_to_load_U-Boot_with_dfu-util#On_STM32MP1-lines


Similar could be done with Cubeprogrammer.
https://wiki.st.com/stm32mpu/wiki/How_to_load_U-Boot_with_STM32CubeProgrammer


As it is a new board, with a newly customized FW, I encourage you to look in parallel at UART console for any messages (proving correct execution or giving errors).


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.
NEW ! Sidekick STM32 AI agent, see here
cbcooper
Senior

I learned that one of our EEs modified the board so it's now jumpered to serial boot mode (which is good).

But when I try to follow "How to load and start STM32CubeMP13 applications via eMMC storage" I run into a couple of problems.

 

First of all, that document says to "Select Binaries path with the Browse button: Firmware\Projects\STM32MP13XX_CUSTOM_HW\External_Loader\MMC_Ext_Loader" but if I do that and click Download, it gives the error "File does not exist: STM32Cube_FW_MP13_V1.2.0\Projects\STM32MP13XX_CUSTOM_HW\External_Loader\EMMC_Ext_Loader

\External_Mem_Loader_A7.stm32".

The correct path (I believe) is STM32Cube_FW_MP13_V1.2.0\Projects

\STM32MP13XX_CUSTOM_HW\External_Loader\Prebuild_Binaries\EMMC_Ext_Loader

 

But when I fix the path and click Download, it chugs for a while and then freezes:

cbcooper_0-1765212724170.png

 

cbcooper
Senior

The command line version also failed, but at least gave an error:

cbcooper_0-1765214675172.png