Skip to content

[Bug] [Prime Hub] Locked writes or reads from user program flash after write long code #996

@rpaciorek

Description

@rpaciorek

Describe the bug

Short code (e.g. 4813 bytes after complied) are correctly stored on hub. But writing long code (e.g. 168002 bytes after complied) to Prime Hub (run code and switch off hub) in some way locks flash access - after power on hub can't run saved program and can't save (or maybe can't read) any other program or user data (via system.storage) to flash.

Hub still can running programs. Flashing by old original Lego firmware, make update from Lego Spike App and flash by pybricks unlocks flash again.

To reproduce
Steps to reproduce the behavior:

  1. write long program (see attachment)
  2. run it on Prime Hub with pybricksdev run ble hello-big.py
  3. power off hub
  4. power on hub
  5. program is missing
  6. run some simple (short) program with pybricksdev run ble hello-small.py
  7. power off hub
  8. power on hub
  9. this program is missing too

Expected behavior
Do not lock writes (or reads?) to "user" flash by write long piece of code.

This can be some hardware issue (i don't have second hub to check), but even in this case should be option to force erase "user" flash to restore writing short programs (and user data) without multistep firmware reflashing.

Attachment
hello.py.txt - sample program, without changes is 4813 binary size and works OK, after add more random text causes flash access problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    hub: primehub/inventorhubIssues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hubplatform: essentialhubIssues related to the LEGO SPIKE Essential hubsoftware: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions