UART bridge to external program

Hi all,

I would like to use the BusPirate5 hardware for programming an external device over UART. Normally when I use a serial programmer, I would pass the serial port to be used to the program that will program it. Whether it’s arduino_cli, esptool or whatever program that expects a serial device, such as arduino-cli upload -p /dev/ttyUSB0 --fqbn arduino:avr:uno HelloWorld. I want to use the BusPirate mainly because of the built-in level shifters.
Is this something that can be achieved by putting the device in bridge mode? If so, should I kill the BusPIrate terminal after setting it to bridge mode and then pass /dev/ttyACM0 to arduino_cli? Or should we extend the BP firmware to create a new (virtual) serial device for other programs to use?

1 Like

Be sure to grab the latest firmware, we just fixed a bug impacting bridge a few minutes ago.

You have the right idea:

  • Configure UART mode for the speed and settings you need
  • Enable a power supply
  • Then run bridge, it disables the toolbar by default.
  • Close the terminal and then use the other software with the serial port.
  • When you’re done you can press the button to exit bridge, or just disconnect the Bus Pirate.

That is amazing, thank you so much for the fix and the quick reply!

1 Like

Let us know how it works out! :slight_smile:

It worked! Thanks!

Sorry to go off-topic, but while working with this I thought there would be a feature of doing a live logic analyzer view, to see what I am sending to the device? Is that possible while you’re doing bridge mode? Its seems /dev/ttyACM1 can’t be used by Sigrok (normal version) anymore when I set the /dev/ttyACM0 to UART bridge

1 Like

Interesting question. At the moment the live action logic analyzer is limited to commands in the terminal that execute in a defined period of time. For example bus commands to chips, or an address scanner. It is disabled for long running commands.

There are a couple reasons for this:

  • Long running commands will exceed the logic analyzer storage, which could be offset by allowing the user to do multiple captures or capture on trigger
  • Currently bridge runs in a tight loop until you press the button. It is not cooperative multitasking, so the sigrok/SUMP interface isn’t being serviced thus no connection.

There are a couple ways we could change this.

  • Service bridge and other long commands via a periodic service hook, so that the binary mode port is still being serviced in the main loop
  • Move the logic analyzer business side to core1, so that long running commands on core 0 can happily have full power.
1 Like