Error: ser_open(): can't set com-state for "\\.\COM6"

Hi,
i am trying to get a Nano to beeing able to upload/flash the software.
I´ve already tried a lot of suggestions from similar Threads but nothing seems to work.

I also already installed the CH341 driver and burned the bootloader using a Uno, wich works on the same PC and same USB port. The cable isn´t the issue, it works with another arduino.

Any other suggestions?

Do you mean that you burned a bootloader to the Nano using the Uno?

Could you upload to the Nano before you burned the bootloader?

What type of Nano?

No i couldn´t upload to the Nano before, thats why I did this: Burn the bootloader on UNO, Mega, and classic Nano using another Arduino – Arduino Help Center using an UNO as the programmer.

I´ve just tried something else and it works temporarily but I don´t know why:
If I open the Serial Monitor, type something in, press Enter and close the Monitor again before uploading the Code to the Nano it actually works for that one time. Trying again without doing the steps with the monitor gives back the error code again.

And its a Nano classic ig?

What error did you get then? Why didn't you ask the forum at that time instead of doing something that could potentially brick the Nano?

That's weird. It should not make any difference.

If you simply open and close the serial monitor, without typing anything, can you upload after that?

See if Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM serial port - #49 by ptillisch solves the "Can't set com-state" problem.

It's a known issue, probably due to reject / fake CH340 chips used on boards from China.

I got the same error before, thats the reason why I tested this method that is suggested by Arduino support for issues like that. How could that possibly "brick" the Nano? How I understand it thats just basically a reset, or am I wrong?

Yes it actually works without typing something in. Although sometimes it gives back these error messages:

Ah ok. Im on a PC from my Firm tho, so I need to ask IT for permission to update the driver first :sob:

Burning a bootloader overwrites any previous bootloader, and also sets "fuses" which control the Nano chip's hardware configuration, so it's much more than a simple reset. If it goes wrong during the operation, or the wrong bootloader is uploaded, it could leave the Nano in an unusable state.

Interesting.

When you open serial monitor, it sends a reset signal to the Nano. But a reset signal is also sent prior to uploading code, or should be. It seems sending that extra reset signal is making some difference. This isn't how Nano is supposed to behave.

I can't read them, maybe because I am using my smartphone in bright sunlight. There isn't much contrast to read the text.

Please don't post screen shots of serial monitor. Copy and paste the messages into your post between code tags.

I read on other threads with a similar issue, that an unknown "invisible" Serial Monitor was the problem for them, thats why I tried that.

Here are the error codes again:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avr_read(): error reading address 0x0000
    read operation not supported for memory "flash"
avrdude: failed to read all of flash memory, rc=-2
avrdude: stk500_recv(): programmer is not responding
Der ausgewählte serielle Port avrdude: stk500_recv(): programmer is not responding
 ist nicht vorhanden oder das Board ist nicht angeschlossen

@luzbuz Please pay closer attention.

wdym?

Read the forum guide in the sticky post at the top of the forum section.

Then it will probably be better to ask them to provide you with a board of acceptable quality for you to use for your work. This "can't set com-state for ..." error only occurs when using the absolute worst quality derivative boards from sketchy sources. It is understandable for a hobbyist to end up with one of those boards, but it doesn't make any sense for someone doing professional work for a firm to use one.

Yes you´re right we already ordered a new one, but in the meantime I wanted to see if I could maybe fix this one. The board has already been used by some colleagues before, so i don´t exactly know what they did with it.

It means when you post code or output from the IDE, press the code button then paste the text. You can also afterwards mark the text and click code.

Makes it much more readable.

Ah ok thank you. Im not too much into this stuff so sorry if I don´t understand certain things.

Don't you worry, nobody showed you out the door :slight_smile:

On the positive side, you posted in the right category! :+1:

True, at least I did something right!

So the new one just arrived. The problem is due to the IT-Restrictions from my Firm, the Driver doen´t install automatically. I´ve tried with a PC that is off the grid and there it was just plug and play. Could i install the driver manually and which one would i need to install?

image

I advise you to talk to your IT dept since it's a company computer.

It makes sense. The instructions linked from post #5 have solved this problem for many users, so I'm confident that this would fix it for you if you are able to "roll back" the CH340 driver per the instructions. But I understand that this might not be so easy to do with a managed machine.

A couple of alternative solutions:

  • Use different OS: The bug is specific to Windows, so if you have access to a Linux or macOS machine, I think the board will work fine on those machines.
  • Replace chip: If you desolder the USB chip on the board and replace it with a WCH CH340 chip obtained from a reliable source, then the board should work fine.
  • Use external USB adapter: If you have a standalone USB to serial adapter module or cable (AKA "FTDI"), you can connect that to pins 0 and 1 on the board and use that adapter for communication with the board, bypassing the problematic "CH340" chip.

When was that? The problematic CH340 driver version was released a year ago, so if they were using it before the driver update then it is expected that they would not have encountered this problem.

I don't know about your specific situation with the managed machine, but at least for someone with unrestricted administrative privileges on a machine the answer is "yes".

You can get it from the official website of the manufacturer of the USB chip on the new board: