Skip to main content
Associate III
April 25, 2025
Solved

stm32 flashing tool on ARM Linux via i2c

  • April 25, 2025
  • 3 replies
  • 902 views

Hi,
I'm looking for an STM32 flashing tool that runs on ARM Linux for use on an embedded board. In our setup, I have a processor and an STM32G491RET microcontroller connected via I2C.

Now I need a command-line tool that can run on the processor to flash the MCU over I2C.

Is there any tool available that supports this use case?

 

Best answer by Tesla DeLorean

Perhaps check on stm32flash, that used to support early I2C

https://github.com/ARMinARM/stm32flash

https://github.com/stm32duino/stm32flash?tab=readme-ov-file

If you're a software engineer, perhaps review AN4221 and code a solution

AN3155 is for the UART protocol, examples for that can be found on GitHub, for example the Arduino MKR WAN 1300 board.

3 replies

mƎALLEm
Technical Moderator
April 25, 2025

Hello,

The only flashing tool available from ST is the STM32CubeProgrammer and unfortunately it's not supported by ARM architecture host according to this thread: Support for arm linux?

 

"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."
Andrew Neil
Super User
April 25, 2025

Is there any intention to support it on ARM-based Linux?

Any update/progress on the internal ticket 176491 mentioned by @Maryem  here?

 

As I said there, it could be quite useful - and the request does keep coming up ...

 

@abhijith_raj - meanwhile, the I2C bootloader protocol is described in Application Note AN4221I2C protocol used in the STM32 bootloader.

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.
mƎALLEm
Technical Moderator
April 25, 2025

@Andrew Neil wrote:

Is there any intention to support it on ARM-based Linux?

Any update/progress on the internal ticket 176491 mentioned by @Maryem  here?


Checking the internal progress on that ticket: no news. 

Escalated this request too.

"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."
Pavel A.
Super User
April 26, 2025

CubeProgrammer does not support I2C interface, even on x64. So find or make a custom tool. Here you can find help for creating a custom tool.

 

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
April 27, 2025

Perhaps check on stm32flash, that used to support early I2C

https://github.com/ARMinARM/stm32flash

https://github.com/stm32duino/stm32flash?tab=readme-ov-file

If you're a software engineer, perhaps review AN4221 and code a solution

AN3155 is for the UART protocol, examples for that can be found on GitHub, for example the Arduino MKR WAN 1300 board.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User
April 28, 2025

@Tesla DeLorean wrote:

AN3155 is for the UART protocol, examples for that can be found on GitHub, for example the Arduino MKR WAN 1300 board.


Would that also be in STM32Duino: https://github.com/stm32duino/Arduino_Core_STM32 ?

 

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.
Tesla DeLorean
Guru
April 28, 2025

It might, but it's all getting a big old, I couldn't surface anything that recent and I2C, and stm32flash was definitely iterated for the USART protocol originally.

The MKR WAN variant was designed more for integration into an MCU project than a Linux or Win32 application. It targeted a STM32L072/L082 

The I2C connectivity also tends to point to an MCU project. So basic familiarity with I2C protocols should give a foundation just to implement the mechanics expressed in AN4221

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