Need Help Getting Started

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
xFishbonex
 
Posts: 11
Joined: Fri Jan 27, 2023 12:17 pm

Need Help Getting Started

Post by xFishbonex »

Hi all...need some help getting up and running. I am trying to upload my first sketch. I am using Visual Code and the PlatformIO Extension. I installed the latest version of python. I can compile my sketch but when I try to upload I get the following error:

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 8.2% (used 26844 bytes from 327680 bytes)
Flash: [== ] 21.7% (used 283901 bytes from 1310720 bytes)
Building .pio\build\adafruit_qtpy_esp32s3_nopsram\firmware.bin
esptool.py v4.4
Creating esp32s3 image...
Merged 2 ELF sections
Successfully created esp32s3 image.
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-builtin, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM5
Forcing reset using 1200bps open/close on port COM5
Waiting for the new upload port...
Uploading .pio\build\adafruit_qtpy_esp32s3_nopsram\firmware.bin
esptool.py v4.4
Serial port COM5
Connecting........

A serial exception error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: https://docs.espressif.com/projects/esp ... oting.html
*** [upload] Error 1



The weird thing is I did not install any kind of driver for my ESP32. I just plugged it into my USB port and Windows recognized it as an ADAFruit QT-PY ESP32 device. However, when I look at Windows Device Manager COM 5 is just a generic USB device, Also, the first time I uploaded the sketch, it worked (I think it did because "Hello World!" is still printing in the Serial monitor and my onboard LED is flashing).



Any help would be appreciated.

Edit:
I noticed this when I did verbose upload:
"C:\Users\Mark\.platformio\penv\Scripts\python.exe" "C:\Users\Mark\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32s3 --port "COM5" --baud 460800 --before default_reset
--after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 8MB 0x0000

is baud 460800 right? I know what it is supposed to be for ESP32...but this is a stock py script.

Mark

User avatar
xFishbonex
 
Posts: 11
Joined: Fri Jan 27, 2023 12:17 pm

Re: Need Help Getting Started

Post by xFishbonex »

O.K.  It is working, but kind of wonkey.  Let me explain what I did. 

On the Adafruit website for this board is a section that talks about A UF2 bootloader and how to factory reset.  I followed the steps and saw the bootloader connecting as a drive. 

Anyway while looking at this info I found this on this Website: 

Modern chips often have 'native' USB - that means that there is no separate chip for USB interface. It's all in one! Great for cost savings, simplicity of design, reduced size and more control. However, it means the chip must be self-aware enough to be able to put itself into bootload/upload mode on its own. That's fine 99% of the time but is very likely you will at some point get the board into an odd state that makes it too confused to bootload.

To enter the bootloader:

Press and hold the Boot button down. Don't let go of it yet!
Press and release the Reset button. You should still have the Boot button pressed while you do this.
Now you can release the Boot button.


When I did this, COM4 appeared and it loaded my sketch to via COM4.  However, to execute the sketch, I have to hit the RESET on the board and it immediately connects to the pc via the serial port to COM5.  If I try to then upload a new sketch, it wont work.  I have to reset the bootloader again using the process above and it goes back to COM4.  This is annoying, but not terrible.  Is there a reason it switches to COM5 when I reset the chip?

Mark

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

Return to “General Project help”