I have uploaded a main.py to my pi pico that works with UART and writes on a file at the same time. As a result the pi pico hangs and can not continue. (I have added a periodic flashing code as well to determine the health of the program).
Now I just want to get rid of main.py but every time I plug it into the USB whether I hold BOOTSEL or not it starts running and hanging !!!
Is there a way to tell pi pico to start without running the main.py ?
I tried to connect pin 11 (RUN(RESET)) to the Ground but it cause the board to stop being a usb storage as well !
so I am really out of options to prevent that code to run.
When I hold the BOOTSEL button and connect the USB I see this error message when I try to connect using rshell :
Code: Select all
Microsoft Windows [Version 10.0.19042.1110]
(c) Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>rshell
Connecting to COM7 (buffer-size 128)...
Trying to connect to REPL connected
Retrieving sysname ... b'OK\r\nMPY: soft r'
Traceback (most recent call last):
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\Scripts\rshell-script.py", line 33, in <module>
sys.exit(load_entry_point('rshell==0.0.29', 'console_scripts', 'rshell')())
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\command_line.py", line 4, in main
rshell.main.main()
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 3084, in main
real_main()
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 3050, in real_main
autoscan()
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 332, in autoscan
connect_serial(port[0])
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 1413, in connect_serial
dev = DeviceSerial(port, baud, wait)
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 1744, in __init__
Device.__init__(self, pyb)
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 1497, in __init__
self.sysname = self.remote_eval(sysname)
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 1632, in remote_eval
return eval(self.remote(func, *args, **kwargs))
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\main.py", line 1610, in remote
self.pyb.enter_raw_repl()
File "C:\Users\Unknown\AppData\Local\Programs\Python\Python39\lib\site-packages\rshell\pyboard.py", line 203, in enter_raw_repl
raise PyboardError('could not enter raw repl')
rshell.pyboard.PyboardError: could not enter raw repl
C:\WINDOWS\system32>
I am sure all of these goes back to that problematic main.py.
I should get rid of it or factory reset the board.
Please introduce me more options to delete or prevent main.py from running ....