https://github.com/wokwi/rp2040js-circuitpython
CircuitPython Simulator using RP2040js
https://github.com/wokwi/rp2040js-circuitpython
Last synced: 2 months ago
JSON representation
CircuitPython Simulator using RP2040js
- Host: GitHub
- URL: https://github.com/wokwi/rp2040js-circuitpython
- Owner: wokwi
- License: mit
- Created: 2021-09-07T20:41:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T06:29:56.000Z (12 months ago)
- Last Synced: 2025-03-27T22:01:40.430Z (3 months ago)
- Language: JavaScript
- Size: 507 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CircuitPython Command-line Simulator
A simple CircuitPython on Raspberry Pi Pico simulator, built on top of the [rp2040js](https://github.com/wokwi/rp2040js) library.
You can use this simulator to run the release firmware of CircuitPython on your computer, even if you
don't have access to the physical hardware. You can use it for automated testing (e.g. in a CI environment), as well as for educational purposes.If you are looking for a full-blown, user friendly CircuitPython simulator, please check out [Wokwi](https://wokwi.com): Start a [new CircuitPython project on Wokwi](https://wokwi.com/arduino/new?template=circuitpython-pi-pico).
## Usage
You'll need [Node.js](https://nodejs.org/en/download/) and npm (which comes bundled with Node.js). Clone this repo, and then:
```
npm install
npm start
```To run the simulator. You should see output similar to this:
```
Starting CircuitPython simulator. Press Ctrl+X to exit.
Auto-reload is off.
Running in safe mode! Not running saved code.You are in safe mode because:
You pressed the reset button during boot. Press again to exit safe mode.Press any key to enter the REPL. Use CTRL-D to reload.
```Then type any key (e.g. enter) to get into the REPL. Use "Ctrl+X" to exit from the simulator, Ctrl+E to go into paste mode, and Ctrl+D to soft-restart CircuitPython.
## GDB Server
The simulator listens for GDB connections on port 3333. Use the following command to connect the GDB debugger to the simulator:
```
target remote localhost:3333
```You can change the port number by setting the `GDB_PORT` environment variable.
## License
Copyright (C) 2021 Uri Shaked. Released under the MIT license.