[Answered]: Examining the UART signals during esptool flashing

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

[Answered]: Examining the UART signals during esptool flashing

Postby kolban » Thu Mar 22, 2018 11:39 pm

My goal is to attach a logic analyzer to the TX and RX signal lines during esptool flashing to examine the protocol flows in flight. There is some great documentation on what to expect found here. When I attached TX0 and RX0 to my logic analyzer, I see the output from my ESP32 on TX0. However, I am seeing no sign of any signals on RX0 (the signal into the ESP32 from the UART). Since the ESP32 is being flashed I have either set something up incorrectly on my breadboard or there is a deeper mystery. I tried a WROVER devKit and then a WROOM devKit ... and had the same result in both.

This has caused me to wonder if I am missing a fundamental notion. Both my boards have USB to UART and my assumption is that the USB UART IC is decoding the incoming USB signals, converting to UART protocol and then driving the ESP32 RX0 line. Since I am not seeing a signal on my monitor of RX0, that is causing me to question that core assumption.

Other than a gross mistake on my part, can anyone think of a reason why we wouldn't be seeing an incoming (to) ESP32 UART signal on RX0 during ESP32 flashing from esptool?
Last edited by kolban on Fri Mar 23, 2018 4:45 am, edited 1 time in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Examining the UART signals during esptool flashing

Postby WiFive » Thu Mar 22, 2018 11:48 pm

If you swap the analyzer channels for tx and rx what happens

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Examining the UART signals during esptool flashing

Postby ESP_Angus » Fri Mar 23, 2018 4:32 am

Hi kolban,

esptool.py definitely relies on bidirectional serial communication (UART TX and RX pins) to work, so maybe this is something to do with your Logic Analyzer connections? Are you sure you have the right two pins probed?

BTW, the output of the "--trace" option for esptool.py should entirely match what you get from the logic analyzer. May save you some time:
https://github.com/espressif/esptool/wi ... unications


Angus

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Examining the UART signals during esptool flashing

Postby kolban » Fri Mar 23, 2018 4:45 am

@WiFive,
My friend ... that's why they pay you the big bucks. I swapped around the analyzer cables and now I can see the transmissions from USB->UART into the ESP32 but not the TX from ESP32 outbound ... so as you suggested, I have a failure with my wirings/connections etc etc etc. Maybe a bad wire, maybe a broken analyzer or just simply a general failing on my part. Either way, your answer was perfect. Thank You!!!

@Angus,
Thank you sir. I have been reading about the esptool and had seen the --trace option. Your esptool is just chock-full of super features. While I have no reason not to trust the output of the esptool trace and no reason not to trust the Wiki documentation on the protocol ... I like belts and braces and wanted to see the raw protocol trace and validate that all was as theory said it should be. A project I am working on requires that we be able to flash an ESP32 using a tool that won't be esptool (Nothing against esptool, just the project already has a command line tool for flashing other boards and when ESP32 is added to the mix, they want to "augment" the existing CLI tool). My plan is to create a generic lib (C/C++) for flashing ESP32 (assuming one doesn't already exist) and make that open source on Github while at the same time leveraging it in my project.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: Google [Bot] and 118 guests