Board selected in IDE: Arduino Nano
Port is COM7
Driver for CH340G is installed
I have tried all the options which I could find in older posts. Even I deleted Arduino15 folder in AppData, I downloaded and re-installed the latest IDE, but none worked for me.
The board is working fine with sketch I uploaded last night but is not accepting the new sketch.
I tried to upload my modified sketch to genuine Arduino UNO, it finished within 5 seconds and worked as programmed. Then I modified my sketch again and tried to upload again in UNO but failed and got exactly same error as that with NANO.
I have two separate USB leads for NANO and UNO.
As far as the baud rate is concerned, I don't know how to check it in IDE for Arduino but in Windows the COM port is set at 9600. Besides, if the IDE has uploaded the sketch first time without any problem then that means the baud rate and COM ports were correct. How can things change suddenly after the first upload?
I discovered that I can upload my modified sketches to my NANO when removed from the circuit. When sitting on its base in the circuit, it would give errors as stated earlier.