Skip to content

Flashing a new main.py script via serial does not invalidate the data logging storage  #95

@microbit-carlos

Description

@microbit-carlos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions