Notifications
Clear all

Help please. I'm a newbie and already need help getting started.

32 Posts
4 Users
0 Likes
1,316 Views
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

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/esptool/en/latest/troubleshooting.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.

 

Mark

 


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone The reason 'Hello World' is there is they ship the boards that way so it is very possible you didn't upload that one. Strange you didn't need to install a driver. That debugging link is exactly what I would do. You didn't mention holding down the BOOT button.

Read slowly and believe what the error messages say. You are looking for help but have you verified the permisions are correct?

This HERE looks relevant. Just google the error message, use copy/paste, do not try to type it in.

Good luck.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

I saw one other thing.  When using verbose upload I saw this:

"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 correct?  I know what it is supposed to be on ESP32 boards...but that is coming from a stock python script.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone It might be but why question it, that is on a command line generated out of the IDE and you can't influence it much. Your first debugging step is to copy the sample Hello World sketch and change the wording then upload it and see if it works. If it works, then your bug is due to the failed script overwriting memory. Those kinds of bugs are extremely hard to find. Without special tools all you can do is to start chopping out chunks of code that still allow a successful compile maybe substituting dummy functions until you find one that causes the problem. Then divide and conquer that function until you find it.

Also, make sure your IDE is setup correctly. I don't know Python but maybe as newbies do you changed something you shouldn't have and are causing the problem, or you didn't change something you should have.

Good luck!!!

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone 460800 is a little slow to be sure, it's normally 921600.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi @fishbone,

  I do not know about the specific board you are using, but one thing you need to check is whether Windows has a driver that 'matches' the USB input on the development board. Missing driver is not the only problem that could cause the symptoms you are seeing, but I think it is a possibility.

Go to Control Panel -> Device Manager, and look for the USB device.

If it has yellow triangle with an exclaimation mark like this clip (apologies for the poor quality image), then a driver needs to be installed

image

Alternately, if it looks more like:

image

which shows USB_Serial, with the expected COM number, and often the USB chip on the dev board type (CH340 in this picture), then the correct driver is probably installed.

Best wishes, Dave

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@davee Not sure if you noticed Dave, but he is NOT using the Arduino IDE, and he said he did NOT install any driver. I don't know if either of those two items are important, but they are different. I thought he would need to install the driver that matches the chip on his board, I understand there are a couple different chips.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

@zander @DaveE Like I said, when I first plugged the board in, Windows 10 identified it as an AdaFruit board and said it successfully installed the driver...BUT now when I go to device manager, it shows up as "USB Serial Device (COM5)"  no yellow triangle.  I would have thought if Windows recognized it and installed the proper drivers, then in Device Manager it would say something Like "AdaFruit Serial Device".  I like the Visual Studio environment - but think I will install the Arduino IDE and see if that works.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone I have been away from windows now for about 6 years so have forgotten a lot of the fine details but I do remember that venturing into the Device Manager was the equivalent of HELL. My concern is that there are at least 2 different chop sets so 2 different drivers. I don't know how windows determines what to install but I would check the Arduino docs to see what they say.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone I don't know if the arduino IDE supports python, you may need thonny.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

@zander 

o.k. so with a fresh Arduino v.2.0.3 This is what I get when trying to upload:

Sketch uses 284613 bytes (13%) of program storage space. Maximum is 2097152 bytes.
Global variables use 26844 bytes (8%) of dynamic memory, leaving 300836 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port COM5
Connecting...Traceback (most recent call last):
File "esptool.py", line 34, in <module>
File "esptool\__init__.py", line 1004, in _main
File "esptool\__init__.py", line 646, in main
File "esptool\__init__.py", line 895, in get_default_connected_device
File "esptool\loader.py", line 631, in connect
File "esptool\loader.py", line 572, in _connect_attempt
File "esptool\loader.py", line 435, in sync
File "esptool\loader.py", line 351, in command
File "serial\serialutil.py", line 372, in timeout
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)
[11216] F
ailed to execute script 'esptool' due to unhandled exception!
Failed uploading: uploading error: exit status 1

I noticed Arduino uses "esptool.py v4.2.1" where PlatformIO uses 4.4

o.k.  I'm thinking now it may be drivers and I'll try another usb cable

  


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone Are you pressing the BOOT button?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

@zander Yes.  There is a BOOT and RESET on my board.  I have tried pressing BOOT.  I have tried pressing RESET.  I have tried holding them down as well as single press.  When I go to upload, the port is shut down the terminal window shows

Looking for upload port...
Using manually specified: COM5
Forcing reset using 1200bps open/close on port COM5
Waiting for the new upload port...

so when it says "Forcing reset..." I can hear the COM port disconnect (makes a sound in Windows).  If I then do nothing or press boot it says

"Error: Couldn't find a board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload."

If I hit the reset as it instructs, I get the message I posted at the beginning of this thread.  


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone See if the driver is on your HD, look in the Arduino install folder for a drivers folder. If it's there, go into CP and rt click on the USB com port to do a manual update. Navigate to the drivers folder and go.

OR go to https://ftdichip.com and download the correct driver.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@fishbone ONLY the BOOT button immediately after the Connecting message or just before it, once you see writing x% let go or not, it doesn't matter at that point..

ALSO make SURE the serial monitor is NOT open, that blocks uploads.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 3