Skip to content

Allow "delayed start" in watch to diagnose hard resets #2

@gprossliner

Description

@gprossliner

When you are running a qpyt watch command, and the device resets e.g. after an AppFota or Watchdog, we manually need to rerun the command. This has several issues:

  • When (re)running watch the device will perform a soft reset, so loosing it's hard reset state, this can be mitigated by running attach, not watch.
  • As soon as the device firmware has booted the entry point will run, so we always will miss some logs printed to repl.

Solution:

Implement a --delayed-start flag to watch that has the following implications:

  • If there is no /usr/main.py it has no effect, as there is no automatic start script
  • deploy /usr/main.py as /usr/_main.py to the board. This causes QuecPython not to run it automatically
  • If we loose serial connection, try to restablish it until success or user canceled
  • If we have the serial connection reestablished:
  • Manually run /usr/_main.py with import example;example.run("/usr/main.py") The example package is also used in QPYcom to execute .py files manually

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions