Skip to main content
Graduate II
April 29, 2024
Question

Manual for flashing the eMMC with OpenSTLinux?

  • April 29, 2024
  • 2 replies
  • 4043 views

Hi!

I have made a simple computer with STM32MP151AAC3 processor.

I have modify so I can boot either from UART4 or eMMC. My question is:

When I want to flash OpenSTLinux onto the eMMC, can that be done via ST-Link and STM32CubeIDE? Just like regular STM32 programming via STM32CubeIDE?

If yes: Is there any manual how to flash the eMMC with OpenSTLinux via UART4 so my processor can boot from eMMC?

 

I have attached the schematic. Just tell me if I'm missing something. I have included:

  • LSE
  • HSE
  • Boot (Only BOOT1 can be set HIGH. BOOT0 and BOOT2 is default pull-down)
  • RESET
  • External ST-Link debug via 1.27 x 2 connector (I assuming that a Nucleo STM32 can be used as ST-Link programmer)
  • HDMI
  • DDR
  • eMMC
  • USBH 
  • USB OTG
  • Gigabit Ethernet
  • PMIC with 3.5 mm DC plug connector
    This topic has been closed for replies.

    2 replies

    Technical Moderator
    April 30, 2024

    HI @DMårt 

    You cannot flash STM32MPx using neither STLINK nor CubeIDE (used only for debug purposes).
    You should use CubeProgrammer on a PC connected to OTG high-speed port (at least USB_DP2/USB_DM2 + ground are needed).

    https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer#STM32CubeProgrammer_overview

    UART could be used with CubeProgrammer, but due to size of images, it is useful only as workaround for early trials if USB is failing or to load minimum image (e.g. TF-A + uBoot) which is then able to load the remaining image using USB stick, Ethernet or else. This need some adaptation or development on your side.

    If your platform has SD-Card slot, SD-Card could be populated on a PC and once the platform is started from it (need adequate BOOT pins), could be used to Flash internal memory such as eMMC.

     

    Btw, in your schematics, you might have issues around 24MHz oscillator as you need to have HSE_OUT =0 to allows BootROM autodetection of digital bypass while the oscillator usually need a logic 1 to start (i.e. PWR_ON).

    OTG_FS_DN/DP could be easily replaced by USB_DP2/DM2 to get high-speed and Flashload capabilities.

     

    Please refer to AN5031 or existing boards such as STM32MP157F-DK2

    Regards.

    DMårtAuthor
    Graduate II
    April 30, 2024

    Hi @PatrickF 




    >> You cannot flash STM32MPx using neither STLINK nor CubeIDE (used only for debug purposes).

     

    Ok! Good thing I included the debugging connector then.


    >> You should use CubeProgrammer on a PC connected to OTG high-speed port (at least USB_DP2/USB_DM2 + ground are needed).

     

    Ok! I assume that CubeProgrammer is the flashing-tool? Right? It will flash in the operative system onto eMMC?

    By the way! I'm using OTG_VBUS -> VBUS, OTG_FS_DM -> D-, OTG_FS_DP -> D+, OTG_ID -> ID to a Micro USB connector, instead of USB_DP2/USB_DM2. Is that prefered?

     

    Skärmbild 2024-04-30 100807.png

    >> UART could be used with CubeProgrammer, but due to size of images, it is useful only as workaround for early trials if USB is failing or to load minimum image (e.g. TF-A + uBoot) which is then able to load the remaining image using USB stick, Ethernet or else. This need some adaptation or development on your side.

     

    Ok! I understand. USB is much faster.

     

    >> If your platform has SD-Card slot, SD-Card could be populated on a PC and once the platform is started from it (need adequate BOOT pins), could be used to Flash internal memory such as eMMC.

    In my case, I only have eMMC and BOOT1 can be high or low. BOOT0 and BOOT2 is pull-down internally. 

     

    >> Btw, in your schematics, you might have issues around 24MHz oscillator as you need to have HSE_OUT =0 to allows BootROM autodetection of digital bypass while the oscillator usually need a logic 1 to start (i.e. PWR_ON).

     

    I have followed the schematic from AN5031.

    Skärmbild 2024-04-30 102000.pngSkärmbild 2024-04-30 102035.png

    Also I have made a cut for the LSE crystal.

    Skärmbild 2024-04-30 103004.png

     

    >> OTG_FS_DN/DP could be easily replaced by USB_DP2/DM2 to get high-speed and Flashload capabilities.

     

    But is not OTG_FS important if I want to flash the eMMC with the operative system(Linux) via CubeProgrammer?

    I have not found any OTG_HS_DN and OTG_HS_DP.

    Skärmbild 2024-04-30 104449.png

     

    Edit:

    I found that DM2_DP is pin AB16 and DM2_DN is AC16!

    I will change OTG_FS_DP/DM to OTG_HS_DP/DM. Thank you for noticing that!

    Skärmbild 2024-04-30 105014.png

    Technical Moderator
    April 30, 2024

    Hi,

    It seems the HSE oscillator is not wired as expected from AN5031 (PWR_ON and OSC_OUT are never linked, either R2 or R3 is open)

    PatrickF_0-1714471170913.png

    Regards

     

     

    DMårtAuthor
    Graduate II
    May 7, 2024

    Hi @PatrickF 

    Can you explain why my PWR_ON won't have any actions in my schematic?

     

    This is from my board.

    Skärmbild 2024-05-07 203348.pngSkärmbild 2024-05-07 203233.pngSkärmbild 2024-05-07 203200.png

     

    This is from the dev-kit. I assume that the zero-ohm resistor should be removed and replaced with a track only. But the capacitors should not be replaced with a track.

    Skärmbild 2024-05-07 203521.pngSkärmbild 2024-05-07 203505.pngSkärmbild 2024-05-07 203448.png