Skip to main content
Visitor II
August 11, 2025
Question

Regarding IAP (In-Application Programming) online upgrade function of STM32F103C8T6

  • August 11, 2025
  • 1 reply
  • 366 views

Is there an available routine? The file I need to burn is in HEX format, but I haven't been able to find any relevant sample code on the internet. Most of the materials only provide implementation schemes for burning BIN files.

1 reply

Andrew Neil
Super User
August 12, 2025

See Application note AN4657STM32 in-application programming (IAP) using the USART:

https://www.st.com/resource/en/application_note/an4657-stm32-inapplication-programming-iap-using-the-usart-stmicroelectronics.pdf

 


@RainNu wrote:

The file I need to burn is in HEX format, but I haven't been able to find any relevant sample code on the internet. Most of the materials only provide implementation schemes for burning BIN files.


There's a good reason for that: fully handling all the possible variations & options of the Intel HEX format is very much a non-trivial exercise - forums are littered with incomplete or simplistic implementations which fall over with any deviation from their own very limited interpretation of the format.

Also, Intel Hex format is quite inefficient.

So, often, a BIN is a better choice.

 

Having said that, Intel Hex is long-established, well-documented and widely-used - you should certainly be able to find something to interpret it.

Or work from scratch: 

https://en.wikipedia.org/wiki/Intel_HEX 

https://developer.arm.com/documentation/ka003292/latest/

 

The Intel Hex interpretation is entirely separate from the STM32 IAP stuff ...

 

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
August 12, 2025

.HEX has a 40 year history, parsing ASCII as a software engineer should be something doable with a secondary school level grasp of file processing.

People tend to favour .BIN as it's more efficient, especially with 8-bit file storage system and memories, about 2.5x smaller than equivalent binary, rather than 7-bit paper tape or serial interfaces..

STMicro has Ethernet, Serial and USB-MSC examples for IAP

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