I have an app that uses the Beitian GPS module and software that requires it to be connected to the Rx & Tx pins (on a Uno). On compile/upload, the GPS has to be unplugged from the Rx pin for the upload to proceed. No prob but, if I forget to do that, the loader gives error messages and freezes.
The issue is, there seems to be no way of recovering other than to use Task Manager to close the IDE. Clicking on File/Close or Quit or, the Windows "X" at top right of screen do nothing. Similarly for replugging the USB cable or resetting the Uno. The IDE Upload icon stays lit and clicking on it has no effect.
Is there any other way of recovering w/o resorting to Task Manager?
Please post the full and exact text of the error messages in a reply here. They might provide some context that will be useful to the forum helpers.
I'll share instructions below for the usual procedure for doing this. However, I'm not sure whether step (1) will work due to the IDE being in a non-functional state at that point. If that doesn't work, you should be able to select the text with the mouse and then press the Ctrl+C keyboard shortcut to copy it to the clipboard.
You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
Open a forum reply here by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the error output from the upload into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
I just tried to reproduce the fault and was able to close the IDE window without any difficulty. It is fairly common for users to experience this type of upload failure for a variety of reasons and I provide support to many of them, yet I don't remember seeing previous reports of it hanging the IDE application. Of course none of that is of any consolation to you, but the knowledge that it seems to be specific to the environment produced by your system rather than a universal defect is perhaps relevant to the troubleshooting effort.
I'm going to ask you to post some additional information that might help us to identify the problem.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Close all Arduino IDE windows if the IDE is already running.
Open the Arduino IDE installation folder. ⓘ The default installation location is at one of the following paths:
C:\Program Files\Arduino IDE
C:\Users\<username>\AppData\Local\Programs\Arduino IDE
(where <username> is your Windows username)
If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
In the folder listing of the Arduino IDE installation folder, hold the Shift key while clicking the right hand button on the mouse.
From the context menu, click "Open PowerShell window here".
Windows PowerShell will now open with the current directory set to the Arduino IDE installation folder.
Type the following command:
& ".\Arduino IDE"
Press the Enter key.
Debug output should now be printed to the PowerShell window as Arduino IDE starts.
Perform an upload to the Uno board while the GPS module is connected to the RX and TX pins.
Wait until the IDE goes into the frozen state.
Switch back to the PowerShell window if the Arduino IDE window took the focus.
Press the Ctrl+Shift+A keyboard shortcut.
This will select all the text in the PowerShell window.
Press the Ctrl+C keyboard shortcut.
This will copy the contents of the PowerShell window to the clipboard.
Open a forum reply here by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut.
This will paste the output into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
Click the "Reply" button to post the output.
Please let me know if you have any questions or problems while following those instructions.
Hi and thank you for the prompt reply. Wouldn't you know it but I cannot now reproduce the issue even after several attempts. The program upload pauses for about 30 seconds and a series of error messages is printed (as before). But, the upload process then stops and the IDE returns a normal state (at least as far as I can tell). The Upload icon colour returns to blue from orange and (it stayed orange before when the freeze problem occurred).
In any case, here are the error messages (which I'm guessing are to be expected given the circumstances).
Sketch uses 22924 bytes (71%) of program storage space. Maximum is 32256 bytes.
Global variables use 646 bytes (31%) of dynamic memory, leaving 1402 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x99
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x99
Failed uploading: uploading error: exit status 1
I will try the rest of your procedure and report back if the problem reoccurs. In the meantime, thanks much for all the work you folks do.
Thanks for the update. I'm glad it is working now. Even though it is not as satisfying as finding an explanation for the problem, I guess we can be happy enough that the problem is no longer occurring.
That is correct.
The problem of the AVRDUDE uploader tool's behavior of repeatedly retrying the operation even though we know it has no chance of succeeding under these conditions, and of the lack of a convenient mechanism for the user to terminate the hopeless upload, are universal. But it is at least expected that the IDE application will remain in a usable state when this occurs.