I wrote a simple script that connects to the Bus Pirate.
The usage is BusPirate [-n] [terminal] [baud]
Currently it uses screen to connect but you can change it to putty or tio or whatever. (I use tio)
It does the following:
It remounts the BP file system as read-only - to prevent problems. You might have to tweak this. On my system it’s /dev/sda1
It looks for either /media/$USER/BUS_PIRATE5 or /media/$USER/RPI-RP2. If the second, it reminds you to reconnect your BP. If it doesn’t see the BP file system, it won’t connect. You can override this behavior with the -n option.
You can specify a difference serial port (and baud) as an option. BusPirate.txt (1.6 KB)
Here’s my updated script to connect to the BusPirate.
It has several changes.
If the BusPirate is in boot mode, it will check if it can find the proper *.uf2 file to install. (It detects if this is a BP5 or BP6, and selects the proper file). It looks in the current directory, or if the BPFW environment variable is set, use that instead.
If the file exists, it will ask if you want it installed.
If not, it will remind you that you can’t connect to the BP while it is in boot mode.
I also made it easier to customize the script, selecting the terminal emulator of choice. There’s also tweaks when you can use BP5XL or BP5 rev 8 firmware.
In Summary - you execute the command and either connect to the BP, or install the software to the BP. Or it reminds you to plug in the BP - We’ve all been there.
May I make a suggestion. You should consider having the script setup a folder structure and have a tool for first time users can also utilize to get up and running in no time.
I’m not sure what you mean. The only real “setup” is selecting which terminal program you prefer - tio, minicom, screen, or ???
Are you suggesting that the first time it’s run, I ask them to pick one of these?
Or are you suggesting something else, like step-by-step instructions for installing the firmware?
Or even more basic - like how to install and use a terminal program?
As a long-time Unix user - I always look at the first few lines of any script before I run it, where the tweaks are described. That’s why this is described in the front of the script.