Skip to content

Add buspirate_ctrl.py for BusPirate 5#15

Open
JohnAZoidberg wants to merge 4 commits intomainfrom
pr-buspirate
Open

Add buspirate_ctrl.py for BusPirate 5#15
JohnAZoidberg wants to merge 4 commits intomainfrom
pr-buspirate

Conversation

@JohnAZoidberg
Copy link
Member

@JohnAZoidberg JohnAZoidberg commented Mar 14, 2026

Wiring:
  BP5 IO4 (TX) --> EC CR_SIN1           (UART RX)
  BP5 IO5 (RX) <-- EC CR_SOUT1         (UART TX)
  BP5 IO6      --[4.7-10K R]--> EC CR_SOUT1/FLPRG1  (flash mode strap)
  BP5 IO7      --> EC VCC1_RST          (reset, active low)
  BP5 GND      --- EC GND

Usage:
  ./buspirate_ctrl.py --reset                          # Toggle EC reset
  ./buspirate_ctrl.py --reset-hold                     # Hold EC in reset
  ./buspirate_ctrl.py --log                            # Print EC UART output (Ctrl+C to stop)
  ./buspirate_ctrl.py --log --reset                    # Reset EC, print boot log
  ./buspirate_ctrl.py --pty-bridge                     # PTY bridge (Ctrl+C to stop)
  ./buspirate_ctrl.py --pty-bridge --reset             # Bridge, then reset (captures boot log)
  ./buspirate_ctrl.py --pty-bridge --enter-flash-mode  # Bridge + enter flash mode
  ./buspirate_ctrl.py --flash ./result/                # Full flash workflow
  ./buspirate_ctrl.py --flash ./result/ --no-reset     # Flash without reboot
  ./buspirate_ctrl.py --flash ./result/ --log          # Flash, reset, print boot log

So that we can aeasily use the BPIO2 binary API using python

Signed-off-by: Daniel Schaefer <dhs@frame.work>
`nix-shell` to get a shell to get them

Signed-off-by: Daniel Schaefer <dhs@frame.work>
Wiring:
  BP5 IO4 (TX) --> EC CR_SIN1           (UART RX)
  BP5 IO5 (RX) <-- EC CR_SOUT1         (UART TX)
  BP5 IO6      --[4.7-10K R]--> EC CR_SOUT1/FLPRG1  (flash mode strap)
  BP5 IO7      --> EC VCC1_RST          (reset, active low)
  BP5 GND      --- EC GND

Usage:
  ./buspirate_ctrl.py --reset                          # Toggle EC reset
  ./buspirate_ctrl.py --reset-hold                     # Hold EC in reset
  ./buspirate_ctrl.py --log                            # Print EC UART output (Ctrl+C to stop)
  ./buspirate_ctrl.py --log --reset                    # Reset EC, print boot log
  ./buspirate_ctrl.py --pty-bridge                     # PTY bridge (Ctrl+C to stop)
  ./buspirate_ctrl.py --pty-bridge --reset             # Bridge, then reset (captures boot log)
  ./buspirate_ctrl.py --pty-bridge --enter-flash-mode  # Bridge + enter flash mode
  ./buspirate_ctrl.py --flash ./result/                # Full flash workflow
  ./buspirate_ctrl.py --flash ./result/ --no-reset     # Flash without reboot
  ./buspirate_ctrl.py --flash ./result/ --log          # Flash, reset, print boot log

Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
@JohnAZoidberg
Copy link
Member Author

image

This is a great setup for flashing and debugging EC firmware!
No custom buspirate firmware, only a very simple adapter with one resistor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant