Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

esptool.py doesn't correctly detect integrated USB bootloader on ESP32-S3 (ESPTOOL-484) #756

Closed
egnor opened this issue Jul 14, 2022 · 2 comments

Comments

@egnor
Copy link

egnor commented Jul 14, 2022

Operating System

(all known)

Esptool Version

v4.1-16-g762e381

Python Version

python 3.10.4

Chip Description

ESP32-S3

Device Description

Adafruit Feather ESP32-S3 TFT
(but I believe this will apply to all ESP32-S3 boards)

Hardware Configuration

No response

How is Esptool Run

from any environment

Full Esptool Command Line that Was Run

esptool.py -p /dev/ttyXXX read_mac # or anything

Esptool Output

Normal output is generally normal:


% esptool.py -p /dev/ttyACM0 read_mac
esptool.py v4.1
Serial port /dev/ttyACM0
Connecting....
Detecting chip type... ESP32-S3
Chip is ESP32-S3
Features: WiFi, BLE
Crystal is 40MHz
MAC: f4:12:fa:59:69:84
Uploading stub...
Running stub...
Stub running...
MAC: f4:12:fa:59:69:84
Hard resetting via RTS pin...

However, in esptool.py, self.uses_usb() is returning false in this mode. The implementation of uses_usb() checks a magic value in the ROM's data segment (UARTDEV_BUF_NO = 0x3FCEF14C) to see if it indicates USB loading (UARTDEV_BUF_NO_USB = 3). However in my experiments this value is 4, not 3. This is for example why _check_if_can_reset() (checking for GPIO0 forced-bootloader mode that prevents resetting, I think?) isn't working as expected on the ESP32-S3.



### More Information

_No response_

### Other Steps to Reproduce

_No response_

### I Have Read the Troubleshooting Guide

- [X] I confirm I have read the troubleshooting guide.
@github-actions github-actions bot changed the title esptool.py doesn't correctly detect integrated USB bootloader on ESP32-S3 esptool.py doesn't correctly detect integrated USB bootloader on ESP32-S3 (ESPTOOL-484) Jul 14, 2022
@radimkarnis
Copy link
Collaborator

Hello @egnor,

as I explained in the PR, uses_usb() is meant to check for the USB-OTG mode and has nothing to do with the USB-Serial/JTAG mode. _check_if_can_reset() is supposed to run only in USB-OTG mode.

@egnor
Copy link
Author

egnor commented Jul 18, 2022

Thanks for clarifying the code!! I was gonna send a PR for that but you beat me to it lol!

radimkarnis added a commit to radimkarnis/esptool that referenced this issue Aug 4, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants