Now I can't upload a sketch

Until lastnight it was working like a charm.

The Nano is selected. In Tools-Serial two COM ports appear, 1 and 7. No matter which one I choose, it will not upload ("Problem uploading to board").

rva1945:
Until lastnight it was working like a charm.

The Nano is selected. In Tools-Serial two COM ports appear, 1 and 7. No matter which one I choose, it will not upload ("Problem uploading to board").

If it did work, and now it doesn't, What has changed?
Maybe a connection is loose now?
Does the Nano still run (run its last uploaded script).

Try another usb cable?
Does your script verify ok?

I think I found the problem. If I'm sending data from the board via Serial.print(), before uploading another sketch I must disconnect the power from the board, turning it off, then plug it again. Then I upload a New sketch, you now, that simple one that has the Setup() and void() definition with no code at all, so the board remains doing nothing until I upload the modified sketch with which I'm working. Uncomfortable, but found no other option so far.

Yes I've tried a couple of cables with the same result.

Another symptom of the problem that I forgot to mention is that sometimes, if I don't follow the mentioned steps, the USB mouse "hangs". So it's a USB related issue.

This behaviour began this week, and I've been using this PC and the Nano for months with no hardware change in the middle.

" before uploading another sketch I must disconnect the power from the board, turning it off, then plug it again. Then I upload a New sketch, you now, that simple one that has the Setup() and void() definition with no code at all, so the board "

Rather than all the power down, you may be able to just press the reset button (a second or two after you hit upload on your PC).

Sending data to the PC does not block uploading a sketch. (Thank god it does not, then no noob could use the Arduino..) That's because the IDE will reset the Arduino before an upload of the sketch.

So if you can only upload after unplugging it the is something wrong...

"So if you can only upload after unplugging it the is something wrong..."

It should have been apparent that "something wrong" when we read the first post from the OP.

The DTR signal is normally used (with a cap), to produce the reset.

I tried pressing the reset but if the running sketch starts sending data soon then pressing the reset button will not do.

rva1945:
I tried pressing the reset but if the running sketch starts sending data soon then pressing the reset button will not do.

So you are saying it will work if the timing is right?
Wait 2 seconds, may not work,
but if you wait for 5 seconds to press the reset button, it will work?

While I didn't try that, I can say that the behaviour is random. Last night the Arduino was always seen by the IDE, never got the message that there was a problem uploading to the board, but suddenly the USB wireless antenna stopped working. So it's a USB ports problem.