QT Py ESP32-S3 won't boot back to Arduino

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Cuptapus
 
Posts: 9
Joined: Sun Aug 07, 2022 12:23 am

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by Cuptapus »

IMG_0794_cropped.JPG
IMG_0794_cropped.JPG (769.45 KiB) Viewed 791 times

User avatar
hathach
 
Posts: 1270
Joined: Tue Apr 23, 2013 1:02 am

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by hathach »

I have just tried upload a simple blink with neopixel on my qtpy s3 and it works just fine. Though I use github version of arduino-esp32 which is even later than 2.0.4. We (adafruit) make some changes to board definition (boards.txt) since 2.0.4 and current github version. Maybe you could try to see if that would work, here is the manual installation instruction https://docs.espressif.com/projects/ard ... stallation

here is my menu configure for reference,USB Mode = OTG, CDC on Boot = Enabled and Upload mode = USB-OTG etc ..
qtpy_s3.png
qtpy_s3.png (117.01 KiB) Viewed 784 times

User avatar
Cuptapus
 
Posts: 9
Joined: Sun Aug 07, 2022 12:23 am

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by Cuptapus »

Okay, small update. I figured out how I'm able to bypass the UF2 Bootloader and load Arduino programs again. If I perform a BOOT pin reset, I can force the QT Py to bypass the UF2 bootloader and show up as an "ESP32S3 Dev Module" which allows me to flash it in Arduino again.

I'm now somewhat back to where I was when the issues first started popping up though. I can usually load programs, though sometimes it'll error out (see the error message at the bottom of this post), and every now and then I'll have to perform a BOOT pin reset to allow an Arduino build to flash. Simple programs usually work, but if I try to load the BLE Server code that I was working on, it won't run more than a few lines and the issues will start popping up again.

I'm starting to wonder if there are a few bad blocks in Flash, and as long as a program doesn't touch those, it works fine, but if it does, everything starts to fall apart.


Sketch uses 894117 bytes (68%) of program storage space. Maximum is 1310720 bytes.
Global variables use 45904 bytes (14%) of dynamic memory, leaving 281776 bytes for local variables. Maximum is 327680 bytes.
Traceback (most recent call last):
File "esptool.py", line 5387, in <module>
esptool.py v3.3
File "esptool.py", line 5380, in _main
File "esptool.py", line 4687, in main
Serial port COM7
File "esptool.py", line 114, in get_default_connected_device
File "esptool.py", line 320, in __init__
File "serial\__init__.py", line 90, in serial_for_url
File "serial\serialwin32.py", line 80, in open
File "serial\serialwin32.py", line 222, in _reconfigure_port
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
[14716] Failed to execute script 'esptool' due to unhandled exception!
the selected serial port [14716] Failed to execute script 'esptool' due to unhandled exception!
does not exist or your board is not connected

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by adafruit2 »

i strongly suspect that the code you are uploading is crashing the chip or otherwise making the USB stack not run, which means the auto-reset stops working. this is a tradeoff with native USB. original ESP32 used a separate chip so even if the ESP32 crashed or hangs, serial port still works. thats not true of S3 when using native serial!

User avatar
Cuptapus
 
Posts: 9
Joined: Sun Aug 07, 2022 12:23 am

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by Cuptapus »

Hmm... I guess I'm usually developing code over a more robust programming port, so I guess that does make sense why this might be breaking in the way it is given how it's designed. I'll have to take a closer look at my code and work out why it might be causing the chaos it is. Things to think about.

User avatar
Andy_H
 
Posts: 4
Joined: Fri Aug 19, 2022 3:59 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by Andy_H »

'Exactly' the same issues with three boards bought at the same time.
With the third, the first thing I tried was to reflash it to factory config and it ended up the same way, not running the rainbow swirl and having to press Boot & Reset to get out of Boot Loader mode.

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by adafruit2 »

make sure you're uploading the right factory reset! theres many S3 boards :)

User avatar
Andy_H
 
Posts: 4
Joined: Fri Aug 19, 2022 3:59 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by Andy_H »

Here's what I used...

https://nabucasa.github.io/esp-web-flasher/
Offset: 0x0
Factory reset and bootloader bin file: https://github.com/adafruit/Adafruit-QT ... loader.bin
QTPy ESP32-S3.jpg
QTPy ESP32-S3.jpg (119.41 KiB) Viewed 730 times

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by adafruit2 »

does upload succeed?

User avatar
Andy_H
 
Posts: 4
Joined: Fri Aug 19, 2022 3:59 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by Andy_H »

Same issues as previous posts.
Needs Boot + Reset to get a COM port.
Reset gets you into firmware mode.
Once a sketch is uploaded, the only way to get into firmware mode is to reinstall the bootloader.
I could send you a whole sequence of events and results if you want it by email?

User avatar
Andy_H
 
Posts: 4
Joined: Fri Aug 19, 2022 3:59 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by Andy_H »

https://nabucasa.github.io/esp-web-flasher/

Offset: 0x0
Factory reset and bootloader bin file: https://github.com/adafruit/Adafruit-QT ... loader.bin


SEQUENCE:

1. https://nabucasa.github.io/esp-web-flasher/:

1.1 CONNECT:

ESP Web Flasher loaded.
Connecting...
Connected successfully.
Try hard reset.
Chip type ESP32-S3
Connected to ESP32-S3
MAC Address: F4:12:FA:44:10:50
Uploading stub...
Running stub...
Stub is now running...
Detecting Flash Size
FlashId: 0x1740C8
Flash Manufacturer: c8
Flash Device: 4017
Auto-detected Flash size: 8MB

1.2 ERASE:

Erasing flash memory. Please wait...
Finished. Took 2268ms to erase.

1.3 CHOOSE FILE: (from: https://github.com/adafruit/Adafruit-QT ... loader.bin)

qt-py-esp32-s3-factory-reset-and-bootloader.bin

1.3 PROGRAMME:

Image header, Magic=0xE9, FlashMode=0x02, FlashSizeFreq=0x3F
Writing data with filesize: 4420672
Erase size 4420672, blocks 270, block size 0x4000, offset 0x0000, encrypted no
Took 42252ms to write 4420672 bytes
Erase size 0, blocks 0, block size 0x4000, offset 0x0000, encrypted no
To run the new firmware, please reset your device.

1.4 DISCONNECT

1.5 QT Py ESP32-S3 STATUS:

LED: Off
COM Port: COM4 (ESP32S3 Dev Module)

2. Press and release the RESET button:

Brief Red LED, then stable Green.

No Rainbow Swirl Programme running

No com port

QTPYS3ROOT Folder Contents:

AUTORUN.INF:
[Autorun]
Icon=FAVICON.ICO

CURRENT.UF2

FAVICON.ICO

INDEX.HTML:
<!doctype html>
<html><body><script>
location.replace("https://adafruit.com/product/5426");
</script></body></html>

INFO_UF2.TXT:
TinyUF2 Bootloader 0.10.2 - tinyusb (0.12.0-203-ga4cfd1c69)
Model: Adafruit QT Py ESP32-S3
Board-ID: ESP32S3-QTPy-A
Date: Jun 24 2022

3. Try adding 0.10.2 update to QTPYS3ROOT (from: https://github.com/adafruit/tinyuf2/rel ... 0.10.2.uf2)
update-tinyuf2-adafruit_qtpy_esp32s3-0.10.2.uf2

LED flickering activity whilst processing then same result as 2. above.

4. QT Py ESP32-S3 Hold BOOT button, press and release RESET button
Port: COM4 (ESP32S3 Dev Module)

5. QT Py ESP32-S3 Status:
Hold BOOT, press and release Reset:
Port = COM4 (ESP32S3 Dev Module)
Reset = BOOT LOADER

6. Factory Reset Firmware:
After factory reset and bootloader repair:
This instruction does not work: (https://learn.adafruit.com/adafruit-qt- ... tory-reset)
"Press the reset button once, wait till the RGB LED turns purple, then press the reset button again."

Hold BOOT, press and release Reset: COM4

7. Upload Sketch:
Sketch runs but no way to enter QTPYS3BOOT folder without resetting to factory default (that doesn't factory reset).

User avatar
ryandetzel
 
Posts: 12
Joined: Fri Dec 19, 2014 4:14 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by ryandetzel »

Is there a solution to this, I purchased two of these and I can't program them with C (arduino) code at all. I've done the factory reset and that works but I'm only able to load the circuitpython stuff but I want to upload via arduino.

User avatar
walchko
 
Posts: 5
Joined: Sat Jun 03, 2017 5:17 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by walchko »

Frustrating, this has been going on for over a month and I still have 2 boards that don't work with Arduino. I think one is completely bricked, since I can't even reflash it anymore (no serial port appears). I really wish Adafruit would have done adequate testing before selling these boards to people. Is there an ESP32 board Adafruit sells that avoids this problem or will they all suffer from this firmware(?)/hardware(?) issue? I like the wifi, dual core, and compact size idea ... I just do not like the execution on this model.

User avatar
walchko
 
Posts: 5
Joined: Sat Jun 03, 2017 5:17 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by walchko »

adafruit2 wrote: Wed Aug 10, 2022 12:24 pm i strongly suspect that the code you are uploading is crashing the chip or otherwise making the USB stack not run, which means the auto-reset stops working. this is a tradeoff with native USB. original ESP32 used a separate chip so even if the ESP32 crashed or hangs, serial port still works. thats not true of S3 when using native serial!
Wow ... here I thought native serial was a plus, but it turns out it isn't ... go figure.

So would the ESP32 Pico which uses a USB serial chip be a better choice for Arduino?

User avatar
ryandetzel
 
Posts: 12
Joined: Fri Dec 19, 2014 4:14 pm

Re: QT Py ESP32-S3 won't boot back to Arduino

Post by ryandetzel »

The seedstudio xiao works everytime with arduino automatically, so it's possible, something is just up with the adafruit design.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”