Skip to main content
HMoe.1
Visitor II
May 24, 2023
Question

Hello, I want to "over-the-air" update an M7 and H7 via an ESP32 but are getting sync failures and Serial timeouts. It's working with M4.

  • May 24, 2023
  • 1 reply
  • 2161 views

Hello, sorry if this question is in the wrong topic, first post on the STM community.

So i'm working with a solution for updating the firmware on a STM32 M7 microcontroller (NUCLEO-F756ZG). I found a project on Github (ESP32-Musings/OTA_update_STM32_using_ESP32) that flashes the STM32 with an ESP32 over UART. Sorry new users cant link websites.

I tried it with an STM32 M4 (NUCLEO-L476RG) and got good results. The firmware flashes and everything works.

However when trying to do the same with an M7/H7 it fails. Looking at the AN2606 datasheet it says to use PA10(RX), PA9(TX) RESET and GND. My wiring looks like this:

ESP32 STM32

GPIO4(TX) PA10(RX) on CN12

GPIO5(RX) PA9(TX) on CN12

GPIO19 nreset on CN8

GND GND

GPIO21 BOOT on CN11

The datasheet specifies to use pattern 8 to activate the bootloader. I went in cubeprogrammer and changed BOOT_ADD0(optionbyte) to 0x0040.


_legacyfs_online_stmicro_images_0693W00000bkm5sQAA.png 

I've tried manually pulling BOOT pin to low/high but it doesn't seem to work.


_legacyfs_online_stmicro_images_0693W00000bkm0eQAA.pngHope i provided sufficient information.

Thanks in advance for any help.

Edit: I see now that the image from CubeProgrammer it says both option bytes are set to 0x0040, but i tried with BOOT_ADD0 to 0x0040, BOOT_ADD1 default and the other way around

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
November 21, 2023

The ROM based system loader isn't particularly tolerant to delays and retries. This probably isn't helped tunnelling over a radio link.

The STM32 UART Protocol should be covered by AN3155. Needs 8-bit Odd Parity. If you can't stage the whole image on the ESP32 side, you might want to do this in a staged fashion. ie where you write a small loader into RAM or FLASH, that supports a more capable / tolerant protocol, where several KB can be moved in a self-pacing protocol with it's own flow control. X-MODEM being one of the simplest examples.

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