Problems while uploading sketech UNO/Nano and AT commands

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:

  1. 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".
  2. 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.
  3. 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.
  4. 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.
  5. Same problem occurs on multiple boards (Nano and UNO)

    • Tested on two Nano clones and one UNO board with the same results.
  6. Uploading simple blank sketches (e.g., blink.ino) fails

    • Even simple examples like blink are not uploaded correctly.

### What we have tried:

  1. Reinstalled CH340 and FTDI drivers as per the recommended procedures.
  2. Changed COM ports to different values – the same error persists.
  3. Changed programmer settings in Arduino IDE (Tools > Programmer) – no effect on functionality.
  4. Checked and switched bootloaders (Old Bootloader vs. New Bootloader) – no difference in behavior.
  5. Tried different USB cables and ports – same issue.
  6. Reinstalled Arduino IDE – problem persists.
  7. 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.

See if Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM serial port - #49 by ptillisch will solve that issue.

Under file/preferences in the IDE, enable Verify code after upload and upload again.

Which uploaded code? The blink example?

To which pins is the HC-05 connected? If the answer is 0 and 1, that will interfere with uploads.

SO I tried and rolled back the driver but.

When I use the Processor ATMEga328P I get this result:

Sketch uses 4582 bytes (14%) of program storage space. Maximum is 30720 bytes.
Global variables use 1577 bytes (77%) of dynamic memory, leaving 471 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" -b115200 -D "-Uflash:w:C:\Users\konec\AppData\Local\Temp\arduino\sketches\1B4171D3661992C82CE52DF3D3E979C1/AT_Bluetooth.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          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xeb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xeb

avrdude done.  Thank you.

I use D10 and D11 for the HC-05 now.

If that is for the Nano, it indicates that you did use the 328P option under tools/processor and you can try the "old bootloader" (and the 168 option).

From your opening post, the below indicates use of the "old bootloader" option.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.