Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rpaciorek opened this issue Mar 19, 2023 · 1 comment
Labels
bug Something isn't working hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub platform: essentialhub Issues related to the LEGO SPIKE Essential hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)

Comments

@rpaciorek
Copy link

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.

@rpaciorek rpaciorek added the triage Issues that have not been triaged yet label Mar 19, 2023
@laurensvalk laurensvalk added bug Something isn't working hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub platform: essentialhub Issues related to the LEGO SPIKE Essential hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) and removed triage Issues that have not been triaged yet labels Mar 19, 2023
@dlech
Copy link
Member

dlech commented Mar 22, 2023

Thanks for the detailed report. This should be fixed now in https://nightly.link/pybricks/pybricks-micropython/workflows/build/master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub platform: essentialhub Issues related to the LEGO SPIKE Essential hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)
Projects
None yet
Development

No branches or pull requests

3 participants