Hi guys, I am facing the following issues while uploading sketech to Arduni UNO/Nano and using AT commands:
### Issue Description:
While working with different Arduino boards (Nano and UNO) on a Lenovo ThinkPad E14 with an AMD processor, I repeatedly encounter communication issues on the serial port. The Arduino IDE often shows "Done uploading", but the code either does not execute properly or does not upload correctly.
### Components and Setup:
- Laptop: Lenovo ThinkPad E14 with AMD processor.
- Arduino Boards: Arduino Nano clones (ATmega328P Old Bootloader) and Arduino UNO.
- Programmer: AVRISP mkII.
- Ports used: Various available ports (e.g., COM16, COM17).
- Arduino IDE Version: Latest stable version.
- Drivers: CH340 for Nano, FTDI for UNO.
- Operating System: Windows 11.
### Main Errors and Symptoms:
-
avrdude: ser_open(): can't set com-state for "\.\COM16"
- This error appears consistently during code uploads, regardless of the connected USB port. It usually shows even when the IDE displays "Done uploading".
-
Arduino IDE says "Done uploading", but the code does not function correctly
- Even though the Arduino IDE reports successful upload, the code often does not run, or behaves unexpectedly. Basic sketches like
blink.ino
sometimes only work when the Serial Monitor is active.
- Even though the Arduino IDE reports successful upload, the code often does not run, or behaves unexpectedly. Basic sketches like
-
Serial communication only works with the Serial Monitor open
- When the Serial Monitor is open, the board responds correctly and executes the uploaded code. Without it, the board does not respond and the code seems to not run.
-
Communication issues with AT commands on HC-05 modules
- AT commands are executed correctly when the communication is working, but after one to three commands, the module stops responding to AT commands and communication fails.
-
Same problem occurs on multiple boards (Nano and UNO)
- Tested on two Nano clones and one UNO board with the same results.
-
Uploading simple blank sketches (e.g.,
blink.ino
) fails- Even simple examples like
blink
are not uploaded correctly.
- Even simple examples like
### What we have tried:
- Reinstalled CH340 and FTDI drivers as per the recommended procedures.
- Changed COM ports to different values – the same error persists.
- Changed programmer settings in Arduino IDE (Tools > Programmer) – no effect on functionality.
- Checked and switched bootloaders (Old Bootloader vs. New Bootloader) – no difference in behavior.
- Tried different USB cables and ports – same issue.
- Reinstalled Arduino IDE – problem persists.
- Tried a different Windows machine – no issues encountered, indicating a problem specific to the Lenovo ThinkPad E14.
### Looking for:
We would like to know if anyone has experience with similar issues on AMD-powered devices or Lenovo laptops. Could this be caused by incorrect port settings, USB-to-Serial communication problems, or hardware incompatibility? What other steps would you recommend for troubleshooting?
Actually trying just this simple code:
void setup() {
pinMode(13, OUTPUT); // Nastaví pin 13 jako výstupní (vestavěná LED)
}
void loop() {
digitalWrite(13, HIGH); // Zapne LED
delay(500); // LED svítí 500 ms
digitalWrite(13, LOW); // Vypne LED
delay(500); // LED vypnuta 500 ms
}
Thi is the result I get when Seriola monitor is off:
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\konec\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\konec\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM14" -b57600 -D "-Uflash:w:C:\Users\konec\AppData\Local\Temp\arduino\sketches\14FDD00462286370CE67F9B9F0AB3C9A/sketch_oct6a.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\konec\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM14
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: ser_open(): can't set com-state for "\\.\COM14"
avrdude done. Thank you.
This is what I get when Serial Monitor is on:
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\konec\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\konec\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM14" -b57600 -D "-Uflash:w:C:\Users\konec\AppData\Local\Temp\arduino\sketches\14FDD00462286370CE67F9B9F0AB3C9A/sketch_oct6a.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\konec\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM14
Using Programmer : arduino
Overriding Baud Rate : 57600
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\konec\AppData\Local\Temp\arduino\sketches\14FDD00462286370CE67F9B9F0AB3C9A/sketch_oct6a.ino.hex"
avrdude: writing flash (924 bytes):
Writing | ################################################## | 100% 0.31s
avrdude: 924 bytes of flash written
avrdude done. Thank you.