Proposal: Enhanced MicroPython REPL with Spawn Capability and Security Features #16653
itaysaadia
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Have you seen the official aiorepl? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Maybe I'm missing something here but wouldn't it be possible to use the existing repl code (see pyexec.c) for this instead, by exposing it as a Python function? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal: Enhanced MicroPython REPL with Spawn Capability and Security Features
Dear MicroPython Community,
I’d like to propose a new feature for MicroPython: the ability to spawn a REPL instance programmatically at runtime. This feature would function similarly to
IPython.embed()
, allowing users to drop into an interactive REPL environment at any point in their code without resetting the device.This mode is important especially for production devices that are in secure boot without the dev mode. For these cases we’ll want to enable the REPL if and only if the fuse burnt password is correct.
Key Features and Benefits
1. Dynamic Debugging
2. Security Integration
3. Portability
4. Custom REPL Enhancements
Implementation Details
I have developed a prototype implementation comprising two parts:
repl.py
: A fully functional REPL implementation that supports custom input handling and advanced editing capabilities. (Pure MicroPython, tested on ESP32-S3 but should work anywhere)read_fuses.py
: A utility to read eFuse memory blocks on the ESP32-S3, which can be used for secure password storage. (Specific for ESP32-S3)Code Snippets
Custom REPL (
repl.py
)A robust REPL implementation supporting:
Ctrl+E
)Secure Password Reading from eFuses (
read_fuses.py
)This utility demonstrates how to securely read hardware-level eFuse memory to protect sensitive data.
Usage Example
Next Steps
I believe this feature could significantly enhance MicroPython’s debugging capabilities, particularly for applications running on embedded devices. While my implementation is a prototype, I see it as a solid foundation for further development.
I’m sharing this with the community to gather feedback and assess interest in integrating such functionality into the main MicroPython project.
Feel free to review the code, test it, and suggest improvements.
Best regards,
Itay Saadia
Beta Was this translation helpful? Give feedback.
All reactions