Skip to main content
Associate II
April 22, 2024
Solved

Firmware upload without ST-Link

Hi Team,

Currently, I have a product developed with an STM32L476RE as its main processor. This equipment is battery-powered and is used by our customers to perform measurements in remote places. After performing the measurements, this equipment is connected to a computer, and our sofware developed in LabVIEW communicates with the STM32 MCU via serial connection to download the measurement data for reporting purposes. When the MCU's firmware requires an update, our customer must send the entire equipment back to us for the update. It would be very convenient if our software could update the firmware itself. For example, if we could simply send the .hex file generated by STMCubeIDE to our customer, and they could upload the new firmware themselves. Is this possible to achieve? Just to be clear, the goal is just update the firmare, not debbug it.

 

 

This topic has been closed for replies.
Uwe Bonnes
Uwe BonnesBest answer
Chief
April 22, 2024

Learn the multiple way to invoke a bootloader and what communication ways bootloaders can use. Check with your hardware, if there is some way to invoke the build-in bootloader. If there is, send instruction to the customer how to invoke and a new a file and instructions uou to download the new file to the device . If you do not find such a way, add a suitable bootloader the next time you have the hardware in hand.  If you can communicate with the device, you can also write a bootloader to reprogramm via the bootloader.

9 replies

Uwe Bonnes
Uwe BonnesBest answer
Chief
April 22, 2024

Learn the multiple way to invoke a bootloader and what communication ways bootloaders can use. Check with your hardware, if there is some way to invoke the build-in bootloader. If there is, send instruction to the customer how to invoke and a new a file and instructions uou to download the new file to the device . If you do not find such a way, add a suitable bootloader the next time you have the hardware in hand.  If you can communicate with the device, you can also write a bootloader to reprogramm via the bootloader.

LucasRosaAuthor
Associate II
April 22, 2024

Hi, Uwe, thank you for the reply.

 

Is there an application note available for invoking a bootloader for the STM32L4 series? The hardware won't be an issue, even if a new version is required.

MM..1
Super User
April 22, 2024

AN2606 when your uart pins is right connected as in app note, or USB DFU for changed new hw. You dont explain your PC connect.

LucasRosaAuthor
Associate II
April 22, 2024

I am using an UART to USB converter (FT232). Using USART2, to be specific.

MM..1
Super User
April 22, 2024

L476 have USB then you can use it for CDC... Or for updates only.

Chris21
Associate II
April 22, 2024

If you provide a means to set the BOOT0 pin high and reset the L476, the bootloader will run.

Then you could use the STM32CubeProgrammer application to program a new hex file.

You must also use the USART pins specified in AN2606, PA3 / PA2 for USART2.

.
Andrew Neil
Super User
April 22, 2024

See Application Note AN4657, STM32 in-application programming (IAP) using the USART,  for IAP without using the BOOTx pin(s):

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

 

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 22, 2024

If you implement your own method, you could perhaps initiate from a console and use a terminal app supporting X/Y-MODEM to push in an update.

This would be platform agnostic, and just require the tech to have a serial connection and suitable terminal application.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User
April 22, 2024

@Tesla DeLorean wrote:

 perhaps initiate from a console and use a terminal app supporting X/Y-MODEM to push in an update.


Indeed - this is what AN4657 does.

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.