Replies: 3 comments 1 reply
-
These kinds of issues can be very frustrating. The standard advice is to try transferring files onto the device with |
Beta Was this translation helpful? Give feedback.
-
Are you issuing a reset ( |
Beta Was this translation helpful? Give feedback.
-
As mentioned in my post and in the original forum post, this issue is not limited to soft-resets. I can fully unplug the board, give it a couple minutes to discharge, and reconnect it and it'll still run the old code, hence why I think it's potentially an issue with something being cached to flash rather than just persisting in ram.
I haven't tried mpremote specifically yet, though I'll give it a shot next time I hit this issue. I'm skeptical since both of the other tools I've tried (rshell, micropico) do functionally the same thing by wrapping the serial REPL, but it's worth a shot. |
Beta Was this translation helpful? Give feedback.
-
There was a thread on this topic on the archived OG forum: https://forum.micropython.org/viewtopic.php?t=8144
I have been experiencing exactly the same problem described in the old thread: when using rshell (or MicroPico) I occasionally encounter an issue where Micropython persists a stale set of code in flash. I haven't yet figured out what exactly puts Micropython into this bad state, but it happens to me pretty frequently.
I've hit this issue on several micropython ports (Pico, ESP8266, Sparkfun Pro Micro, and even a port I manually created and compiled for the eelectronicparts "Pico Mini" board) so I am reasonably certain that this is not an issue specific to any one port.
Copying new files over to the board does not actually result in the code being run. The filesystem explorer shows the new code (implying a successful copy) but changes are not reflected at runtime. Likewise, I can actually fully delete the files in rshell or Micropico, and they'll still be run on a reboot. Hard reboot/soft reboot/power cycle does not appear to matter, the issue persists.
Interestingly, after deleting the files from the filesystem they still show up in the output of
os.listdir()
. This implies to me that Micropython is caching a copy of the filesystem image somewhere and it's this cache that's persisting across reboots, not the filesystem itself.Workarounds I have found:
import moin
os.remove()
andos.rmdir()
- this is the most consistent fixBeta Was this translation helpful? Give feedback.
All reactions