2021-12-14 02:05 PM
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.
2021-12-14 04:08 PM
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
2021-12-14 04:19 PM
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?