Skip to main content
Explorer II
September 26, 2024
Solved

Load external flash from command line

  • September 26, 2024
  • 1 reply
  • 1726 views

I have an STM32H7B31-EVAL board setup with TouchGFX.  I am able to compile and load a project using STM32CubeIDE.  I would like to be able to do the same from the command line.  I found this document that gives a very basic outline of the STM32_Programmer_CLI program.  I am able to load the MCU portion of the program this way, but I can't find any documentation on how to use it to load the external flash.  In CubeIDE, I have an external loader selected (MX25LM51245G_STM32H7B3I-EVAL-REVB.stldr).  I'm not sure how to use this setup from the command line.  Links to documentation or existing solutions would be appreciated. 

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    Takes the form of the following to read the content out, --download variant to program, will  find an example

     

    STM32_Programmer_CLI -c port=swd --vb 3 --log test_5m6.log --extload C:\STM32Cube\STM32CubeProgrammer_v2.10.0\bin\ExternalLoader\CLIVEONE-W25Q512_STM32L4XX-PB10-PA2-PE12-PB0-PE14-PE15.stldr --upload 0x90000000 0x559298 test_5m6.bin

    See attached command line help screen

    1 reply

    Graduate II
    September 26, 2024

    Takes the form of the following to read the content out, --download variant to program, will  find an example

     

    STM32_Programmer_CLI -c port=swd --vb 3 --log test_5m6.log --extload C:\STM32Cube\STM32CubeProgrammer_v2.10.0\bin\ExternalLoader\CLIVEONE-W25Q512_STM32L4XX-PB10-PA2-PE12-PB0-PE14-PE15.stldr --upload 0x90000000 0x559298 test_5m6.bin

    See attached command line help screen

    AQueAuthor
    Explorer II
    October 2, 2024

    For my specific setup, I did the following: 

    ./STM32_Programmer_CLI -c port=SWD freq=8000 reset=HWrst \
    --extload ./ExternalLoader/MX25LM51245G_STM32H7B3I-EVAL-REVB.stldr \
    -w /path/to/file.hex

    Note that the STM32_Programmer_CLI program needs to be run from the its directory (at least in Linux).  For example, I have the utility in /opt/stm32/bin.  Not being in this directory will result in error messages like "Unable to list supported devices". 

     

    Thanks for the assistance.