Skip to main content
KWoll.2
Associate
March 3, 2023
Solved

Is QSPI-Flash program/read/erase possible via UART bootloader

  • March 3, 2023
  • 3 replies
  • 3000 views

Hi,

is it generally possible to program/read/erase an external connected Flash-Memory (e.g. Quad-SPI-Flash) with STM32CubeProgrammer via USART bootloader?

 

  • I'm using the STM32L496-DISCO board for test.
  • External loader MX25R6435F_STM32L496-DISCO selected
  • BOOT0 connected to Vdd
  • COM1-RX/TX/GND (3.3 V level) connected to MCU USART3 bootloader pins PC10/PC11/GND

 

With upper configuration MCU-Flash program/read/erase is possible, but no access to Quad-SPI-Flash (address = 0x90000000), see picture.

 

With selected ST-LINK probe access to Quad-SPI-Flash is possible.

 

Thanks in advance,

Karsten

 

Best answer by InsignificantBit

Currently, CubeProgrammer does not support programming via external loaders when connected via Bootloaders (eg. UART or USB-DFU). The External Loaders are only supported by CubeProgrammer when connected via ST-Link. This functionality is being considered, but at this time, it isn't certain.

Outside of using the CubeProgrammer, this is definitely possible. Actually, a solution for programming external flash memory via UART bootloader (X-CUBE-EXTBOOT) already exists and is described in AN4852 - "Programming an external Flash memory using the UART bootloader built-in STM32 microcontrollers", but it uses the STM32 Flash loader demonstrator which is no longer maintained.

Nevertheless, this package and application note should provide enough resources for you to be able to develop custom solution if needed.

3 replies

InsignificantBit
InsignificantBitBest answer
ST Employee
March 3, 2023

Currently, CubeProgrammer does not support programming via external loaders when connected via Bootloaders (eg. UART or USB-DFU). The External Loaders are only supported by CubeProgrammer when connected via ST-Link. This functionality is being considered, but at this time, it isn't certain.

Outside of using the CubeProgrammer, this is definitely possible. Actually, a solution for programming external flash memory via UART bootloader (X-CUBE-EXTBOOT) already exists and is described in AN4852 - "Programming an external Flash memory using the UART bootloader built-in STM32 microcontrollers", but it uses the STM32 Flash loader demonstrator which is no longer maintained.

Nevertheless, this package and application note should provide enough resources for you to be able to develop custom solution if needed.

KWoll.2
KWoll.2Author
Associate
March 7, 2023

Thank you for your quick support.

Regards,

Karsten

Visitor II
November 26, 2024

Hi Karsten,
did you accomplish a working solution to this issue?
I just ran into the same use case that I need to use some kind of external Loader via the UART-Bootloader and still looking for the best way to tackle this issue.
Thanks and best regards
Alex

Tesla DeLorean
Guru
March 7, 2023

If you code your own mini loader you could certainly write external memories using X-MODEM from a suitable Terminal application.

The STM32 System Loader could likely facilitate a staged-loader, where you push a more complex and board specific loader into RAM, and transfer control to that

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..