Skip to main content
Jaboop
Associate II
December 14, 2021
Question

Flash ESP32 from STM32H7

Has anyone had luck with the esp-serial-flash library using an STM32 as a host?

I tried to integrate this project into a Cube Project and was receiving ESP_LOADER_ERROR_TIMEOUT upon trying to connect_to_target(). I am basing this off of the STM32 example.

I tried some of the suggestions from open issues on the github but haven't had any luck yet.

If it gives any clues this is the current communication I am seeing between the ESP32 and STM32.

0693W00000HocURQAZ.jpg

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
December 15, 2021

How is it that people with ALL the HW, and ALL the SW, can't debug it?

Instrument it, and understand why it fails?

Likely because you're using HAL to request blocks of data, and it fails to complete within the window.

In situations where the UART RX might lose or corrupt data you might need a more fine grain approach where you're tracking bytes, and resyncing. Understand the protocol, and the stack, and how to implement error recovery, or retries.

Typically the UART itself interrupts for each byte, gets a bit more complicated with a FIFO, but not much.

Decide if the HAL is a help or a hindrance in this implementation.

Watch for framing or noise errors.

Watch for baud rate issues.

Blind stuff like this is problematic

https://github.com/espressif/esp-serial-flasher/blob/master/port/stm32_port.c#L87

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

What's the timing expectation between initiating the ESP32 side loader, and it accepting first data?

What's the RX/TX on the trace? Which is the ESP32 output, and which the STM32 output?

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