-
Notifications
You must be signed in to change notification settings - Fork 31
Description
If I remember correctly, the way CODAL determines if a new programme has been flashed to the micro:bit is something like this:
- It checks a location in flash
- If data is 0xFF:
- it determines a new programme was flashed
- Invalidates the DAPLink storage (a "fast erase")
- Writes a flag in this location
This works well for the MakeCode and Python online editors because the users either download a hex file that does a full flash erase (clearing the flag) and then flashes the hex content, or via WebUSB which also clears the flag if it does a full flash or partial flashing (as it compares the flash contents with the hex contents, and any flash page not included in the hex is erased).
However, for programmes like Mu, the user code is flashed via the REPL by sending a main.py file via serial and writing it via the filesystem API.
Could we figure out a way in which flashing a user programme via serial could invalidate the DAPLink storage as well?
@finneyj @JohnVidler This could end up needing an update to CODAL, but opening the issue here first as this is a use-case specific for MicroPython.