0

Uninstall CircuitPython Troubleshoot for RP2040
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Tue Aug 03, 2021 9:45 pm

I'm having the most difficult time trying to go back to Arduino IDE... Both my two Ada Feather RP2040s and my QT Py RP2040 won't get seen by Arduino IDE for uploading anything (tried many versions for the Current 1.8.4 to 1.85, and many Beta 2.0's and Nightly builds). I've tried many times trying to use the Uninstall CircuitPython Guide to no avail. I never get a blinking green upon (multiple double-clicking) upon plugging in. It will show the Boot loader drive though. I'll be at a point where Arduino IDE sees a COM port with the RP2040, but calls it the Raspberry Pico RP2040 (which I have several of and I have used those in Arduino IDE mode), OR it will call it just the COM with the number by itself, or just not see a COM port for it at all. Then attempt to upload any sketch will get me the error of not finding the Port in all cases (using Windows 10 Pro) and failing the upload. I'll then Reset the rp2040 or turn it off/on (to try uploading again) only to get the Circuit Py drive once again. Arggh.
Any help would be Awesome!!

(Another discussion but the reason why -> Ideally I'd been trying to get CircuitPython to work with these massively cheap Chinese display screens (80x160 st7735S that are both inversed and BRG but no ability to change the adafruit circuit python code (because I'm too much of a CircuitPython newbie at this point) to get CircuitPython to see them properly) and a 240x240 ST7789 screen (with no CS) (again no supporting Ada CircuitPython code for those particularities either unfortunately but there is in Arduino IDE, hence the need to switch for these particular screen projects).

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by kattni on Thu Aug 05, 2021 3:32 pm

I don't have a lot of experience using the Arduino IDE, but I do know that when trying to load an Arduino sketch when an RP2040 board is currently running CircuitPython requires you to manually enter the bootloader before attempting to load the Arduino sketch.

So, try the following:
1. Ensure you do not have the CircuitPython serial console / REPL or the Arduino serial console connected anywhere (you can unplug the board first to be certain)
2. Hold the boot button and do not let go.
3. Press and release the reset button.
4. Continue to hold boot until the RPI-RP2 drive shows up.
5. Try to load the Arduino sketch.

All sketches loaded after the first one do not require you to manually enter the bootloader. They DO however require you to close the Arduino serial console if you have it open. It will fail with com port not found issues if any serial is connected.

If this does not work, I am unfortunately out of ideas as I'm not super experienced with Arduino.

Hope this helps.

kattni
 
Posts: 119
Joined: Fri Aug 18, 2017 6:33 pm

Re: Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Fri Aug 06, 2021 6:08 pm

@kattni, Thank you for tackling this,
When the QT Py RP2040 is loaded in bootloader mode (as per your instructions and no Serial monitor), then it does not have a COM port assigned to it for the Arduino IDE to see (nor does the Windows 10 Pro Device Manager see it in it's Ports section). The only time Arduino sees the COM port associated with the MCP board is when the MCP is booted regularly in it's CircuitPython mode. Without a COM associated to the board, Arduino IDE cannot upload to it so it just gives back that error of no COM port selected for the board.
I've tried having Arduino select the board and COM while the board is booted and visible in CircuitPython mode, then rebooting the board into bootloader and hitting the Arduino IDE upload, but again Arduino IDE (and Windows) loses the boards COM port to nonexistent, so upload fails. (same with the Ada Feather RP2040).

So the problem seems to be that Windows does not assign a COM/Port to the RP2040 boards when they are in bootloader mode... kind of a chicken and egg.. Is there a precompiled Arduino sketch that can be Manually drag and dropped onto the bootloader mode like you do the uf2 file for CircuitPython?? That's one idea.. but I have no idea if a file like that exists or how that works.

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Mon Aug 09, 2021 8:40 pm

Addition:
I was able to find a uf2 for the Arduino Connect with the standard Blink sketch.. and successfully drag and drop that to the Adafruit Feather RP2040 (directly form File Explorer and not using the Arduino IDE to upload).. then Arduino IDE was able to see the MCP connected to a port after it reset (and not in bootloader mode), so partial success. However, after I switched the Board selection from the Arduino Connect RP2040 (which it thought the MCP was due to the specific uf2 Blink file I used) to the Adafruit Feather RP2040 with the port selected, and then uploaded the basic Blink sketch...Once again, the Ada Feather reboots back into bootloader mode and the Arduino IDE loses it's ability to upload to it, Again... arghh.. I'm wondering now if maybe Adafruit's uf2 conversion tool or some parameter in there on the uf2 it makes is somehow bugged? Below is the typical upload error I always get, and it always then shows a missing file error in it at the bottom there.

If this helps -
Sample of Compile/Upload error:
--------------------------
Compilation complete.
Waiting for upload port...
No upload port found, using COM3 as fallback
"C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\tools\pqt-python3\1.0.1-base-3a57aed/python3" -I "C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py" --serial "COM3" --family RP2040 --deploy "C:\Users\nwasp\AppData\Local\Temp\arduino-sketch-FE0BD6E1C14DFF4EA6741FB208201A21/Blink.ino.uf2"
Resetting COM3
Converting to uf2, output size: 111104, start address: 0x2000
Traceback (most recent call last):
File "C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py", line 380, in <module>
main()
File "C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py", line 360, in main
drives = get_drives()
File "C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py", line 233, in get_drives
"FileSystem,", "DriveType"])
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 395, in check_output
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 472, in run
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 775, in __init__
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 1178, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
Upload error: Error: 2 UNKNOWN: uploading error: uploading error: exit status 1

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Mon Aug 09, 2021 9:00 pm

Whoa! after rereading my last post.. I went to that temp folder where the Adafruit's compiled version of the uf2 was created...

C:\Users\nwasp\AppData\Local\Temp\arduino-sketch-FE0BD6E1C14DFF4EA6741FB208201A21/Blink.ino.uf2

and used THAT uf2 file to manually drag and drop onto the bootloader mounted Adafruit Feather RP2040... PRESTO!!!! I'm back in action as Arduino IDE!! - Sort of...
That uf2 with the Blink sketch was then Working and running the the Ada Feather. Well, at least this manual workaround works, as subsequent attemps to upload anything via Arduino IDE will get the upload error as defined in the previous post. Again, finding that uf2 that was created and manually drag and dropping, is the only way now to upload to the Adafruit Feather RP2040 when using Arduino IDE.

So somehow there is still a bug somewhere in where Arduino IDE itself does not recognize the Adafruit RP2040's, after they have been initialized to CircuitPython use and subsequently are rebooted into Bootloader mode... it;s like it pseudo bricked for Arduino IDE use after a CircuitPython setting.. Not bricked so much as just not conveniently able to upload anything using the Arduino IDE.

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by danhalbert on Tue Aug 10, 2021 8:07 am

Are you using the Philhower Arduino Core, as described here: https://learn.adafruit.com/rp2040-ardui ... hower-core, or are you using the Arduino-supplied core only?

danhalbert
 
Posts: 2497
Joined: Tue Aug 08, 2017 12:37 pm

Re: Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Tue Aug 10, 2021 5:04 pm

danhalbert wrote:Are you using the Philhower Arduino Core, as described here: https://learn.adafruit.com/rp2040-ardui ... hower-core, or are you using the Arduino-supplied core only?


I've only been using the Philhower. I have the latest version installed. Currently I'm using the Arduino IDE 2.0.0 beta (10) latest but the issue hasn't changed since, well, for the past 6 weeks since I installed the CircuitPython.

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by danhalbert on Tue Aug 10, 2021 11:47 pm

I tried this on Linux and Windows, with Arduino 1.8.15 and 2.0.0-beta.10. On both, I found that if I was in boot mode, with RPI-RP2 showing, I needed to select some serial port, like COM1, and then it would upload. The actual port is a red herring, because it doesn't correspond to the board, but you need to select one. Try that.

danhalbert
 
Posts: 2497
Joined: Tue Aug 08, 2017 12:37 pm

Re: Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Wed Aug 11, 2021 2:32 am

danhalbert wrote:I tried this on Linux and Windows, with Arduino 1.8.15 and 2.0.0-beta.10. On both, I found that if I was in boot mode, with RPI-RP2 showing, I needed to select some serial port, like COM1, and then it would upload. The actual port is a red herring, because it doesn't correspond to the board, but you need to select one. Try that.


Nopers... The only COM I had avail was one designated to my Prusa MK2 (3d printer), but it's not even turned on. I've tried selecting that COM too to no avail.
Arduino site will say that a COM isn't needed to select at all in the bootloader mode (when you upload the first sketch), and it's supposed to find it to upload, and then after that it's supposed to have a COM associated with it. But that doesn't work. All my other MCP's do fine when I start them as Arduino first. Just not those two Adafruit RP2040 models. I'm afraid to put CircuitPython on anything else less I disable any MCP use in Arduino mode again like these 3 MCPs (two are Ada Feather RP2040s and a Ada QTPy RP2040).
When I started dropping on the bootloader the uf2 that is compiled after any attempt, then I will get a COM port after the MCP reboots. At that point, I have a COM to select.. but it doesn't matter because it still will not upload. The uf2-compiled-and-dropped sketch will run, just not be able to be uploaded directly with the Arduino IDE. Once it finishes compiling and starts the upload process, it snags as soon as the IDE reboots the MCP in bootloader, and then fails to upload to it.

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by danhalbert on Wed Aug 11, 2021 11:35 am

You mentioned an Arduino Nano RP2040 connect. Do you also have a Pi Pico? Does this work with the Pi Pico?

What I see is that the PhilHower core will upload by copying the UF2 to the RPI-RP2 drive. It does not do that copy if no COM port is chosen. I guess my Windows box has a default COM port (COM1) available for some reason.

You might try using 1.8.15, but removing all traces of the arduino installation beforehand, and then reinstalling the philhower package. https://support.arduino.cc/hc/en-us/art ... 15-folder- describes where the folder containing the board packages is. Uninstall Arduino, make sure that folder is gone, and then try again.

If you have a non-Windows box (e.g. Mac or Linux, even RPi), have you tried that?

danhalbert
 
Posts: 2497
Joined: Tue Aug 08, 2017 12:37 pm

Re: Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Wed Aug 11, 2021 7:37 pm

danhalbert wrote:You mentioned an Arduino Nano RP2040 connect. Do you also have a Pi Pico? Does this work with the Pi Pico?

What I see is that the PhilHower core will upload by copying the UF2 to the RPI-RP2 drive. It does not do that copy if no COM port is chosen. I guess my Windows box has a default COM port (COM1) available for some reason.

You might try using 1.8.15, but removing all traces of the arduino installation beforehand, and then reinstalling the philhower package. https://support.arduino.cc/hc/en-us/art ... 15-folder- describes where the folder containing the board packages is. Uninstall Arduino, make sure that folder is gone, and then try again.

If you have a non-Windows box (e.g. Mac or Linux, even RPi), have you tried that?


Windows 10 Pro - Just tried that. I removed all the AppData from the 1.8.5 (and a couple earlier versions of Arduino IDE itself too,, and relocated the Arduino and Arduino Data folders (and deleted their original ones created in the Documents folder). I installed the CircuitPython 7 onto the Raspberry Pi Pico, got a basic sketch to run, then proceeded with the newly installed clean Arduino IDE 1.8.5. Nope again argggh...
-----------------------------------------------------------------------------------------------------------------------
Sketch uses 52532 bytes (2%) of program storage space. Maximum is 2093056 bytes.
Global variables use 7440 bytes (2%) of dynamic memory, leaving 254704 bytes for local variables. Maximum is 262144 bytes.
Resetting COM16
Traceback (most recent call last):
Converting to uf2, output size: 111104, start address: 0x2000
File "C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py", line 380, in <module>
main()
File "C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py", line 360, in main
drives = get_drives()
File "C:\Users\nwasp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py", line 233, in get_drives
"FileSystem,", "DriveType"])
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 395, in check_output
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 472, in run
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 775, in __init__
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 1178, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
FileNotFoundError: [WinError 2] The system cannot find the file specified
-----------------------------------------------------------------------------------------------------------------------

and leaves me with an opened bootloader drive RPI-RPI2, just like the Ada RP2040's. ...Now I have 4 MCPs that will no longer upload directly with Arduino IDE, lol ;/
I have a bunch of various MCP's, just don't want to afford "pseudo-bricking" any more dohh!! My two Adafruit ESP32 Feathers, a couple of TinyPicos, and various other MCPs work great under Arduino IDE, just no way in he!! am I going to try CircuitPython on any of those hah! At least until this major bug gets worked out. I have no idea what the CirctuiPython uf2 is doing to disable Arduino IDE from making upload contact.. Not sure what the "FileNotFoundError" is in the Output report from above... I'll try and reinstall the main Python on my Windows 10 Pro maybe? I don't know if CircuitPython is perhaps utilizing a Windows 10 install of Python and coughing chunks? Or if CircuitPython installs it's own Python, and maybe conflicting with calls to the separately installed Python? Something is creating that FileNotFoundError...

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by danhalbert on Wed Aug 11, 2021 8:19 pm

This is what my upload messages (set to Verbose in the Arduino preferences) look like on a successful upload to an Adafruit Feather RP2040:
Code: Select all | TOGGLE FULL SIZE
Sketch uses 52548 bytes (0%) of program storage space. Maximum is 8384512 bytes.
Global variables use 7440 bytes (2%) of dynamic memory, leaving 254704 bytes for local variables. Maximum is 262144 bytes.
C:\Users\halbe\OneDrive\Documents\ArduinoData\packages\rp2040\tools\pqt-python3\1.0.1-base-3a57aed/python3 -I C:\Users\halbe\OneDrive\Documents\ArduinoData\packages\rp2040\hardware\rp2040\1.9.3/tools/uf2conv.py --serial COM1 --family RP2040 --deploy C:\Users\halbe\AppData\Local\Temp\arduino_build_44993/Blink.ino.uf2
Resetting COM1
Converting to uf2, output size: 111104, start address: 0x2000
Flashing D: (RPI-RP2)
Wrote 111104 bytes to D:/NEW.UF2


Note that it is running a version of Python that is inside packages\rp2040. By comparison, yours shows that you're using another version of Python that is elsewhere:
Code: Select all | TOGGLE FULL SIZE
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 395, in check_output


I'm not sure why that is (something about your %PATH%, maybe), but it might be part of the problem.

You aren't really "bricking" anything: it's just that CircuitPython is not an Arduino program and therefore isn't responding to the bootloader speed-change request to go into bootloader mode.

You can compile blink, say, and find the .UF2 file, as you did already. Then, if you don't fix the issue above, you can just get the board into RPI-RP2 mode, drag the blink.UF2 to the board, and you will have wiped out CircuitPython and put the board back to be accessible by Arduino without having to put it in RPI-RP2 mode.

You might open an issue in the philhower repo about the issue you're having: https://github.com/earlephilhower/arduino-pico/issues

danhalbert
 
Posts: 2497
Joined: Tue Aug 08, 2017 12:37 pm

Re: Uninstall CircuitPython Troubleshoot for RP2040

by danhalbert on Wed Aug 11, 2021 8:22 pm

By the way, you mention Arduiono 1.8.5, instead of 1.8.15, which is the latest I got from the Windows store. Did you mean .15?

danhalbert
 
Posts: 2497
Joined: Tue Aug 08, 2017 12:37 pm

Re: Uninstall CircuitPython Troubleshoot for RP2040

by mordgarrad on Thu Aug 12, 2021 12:03 am

danhalbert wrote:By the way, you mention Arduiono 1.8.5, instead of 1.8.15, which is the latest I got from the Windows store. Did you mean .15?


Yeah meant to say 1.8.15 oopsie.. I got my Arduino IDE direct from Arduino.cc downloads.. they recommend against the Windows store version in general, or somehwere recommends against the Windows Store app version.. although I used to have that one installed too but I uninstalled that too in my uninstall all Arduino IDE's earlier today.
Also, I tried Uninstalling the separate Windows version of Python 3.9.6, then ran the Arduino upload (with the clean Arduino IDE 1.8.15 with latest PhilHower to the RP Pico). No go. Gets the same error of the FileNotFoundError above.
Then I re-installed Python 3.9.6 for Windows (included Paths checkbox to System paths). Same error.

Additionally, upon unplugging/pluggin the RP Pico back in, I got a Winows Alert "USB device not recognized"... so more to add to the mix. I randomly got that before too with the other MCP's, just never consistently.

mordgarrad
 
Posts: 9
Joined: Fri Jul 15, 2016 4:04 am

Re: Uninstall CircuitPython Troubleshoot for RP2040

by danhalbert on Thu Aug 12, 2021 8:38 am

Could you turn on verbose Upload logging in Preferences?
upload-prefs.png
upload-prefs.png (30.3 KiB) Viewed 27 times


To get rid of the USB Device not recognized, try cleaning up your USB devices. Use the "Device Cleanup Tool" from here: https://www.uwe-sieber.de/misc_tools_e.html

danhalbert
 
Posts: 2497
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.