Will typically be caused by something bad in your program but a way to force it to complete so you can troubleshoot what is happening is to press the Arduino reset button as soon as you see “Compiling sketch” change to “Uploading…” as you program the Arduino.
Possible causes we’ve come across
wdt if used, disabling it solved issue implying there was some level of fighting between it and programming completing?
You are using the UART pins and driving the RX pin (your circuits use of UART pins will override the USB serial interface to the Arduino IDE).
