bbl is a handy tool which incorporates the necessary knowledge about uploading software to the balloon. This lets you use one tool and simple options (like bbl --bootldr to upload a new bootloader) rather than following the intricacies of bflash, jflash, bootldr config options and so on.
It replaces the earlier incarnation FillBalloonScript
Version 0.3 support Balloon3 as well as Balloon2
Installing bbl
bbl is available here as a tarball: http://balloonboard.org/cgi-bin/viewcvs.cgi/balloon/trunk/bbl.tar.gz?view=tar
(I found this version did not compile without editing. Hosting fixed version here: http://nextinfinity.com/downloads/bbl/bbl.tar.gz - simon)
You can browse the subversion archive here: http://balloonboard.org/cgi-bin/viewcvs.cgi/balloon/trunk/bbl/
To install it, unpack the tarball, make, sudo make install. Which will build the various utilities (bflash, jflash, playxsvf, balloon-audio-off) and install them along with a config file.
Something like this:
wget http://balloonboard.org/cgi-bin/viewcvs.cgi/balloon/trunk/bbl.tar.gz?view=tar tar -xzvf bbl.tar.gz cd bbl make sudo make install
Other software packages you'll need:
- the sx xmodem utility (in the lrzsz package on Debian)
- chat (in the ppp package on Debian)
OpenOCD (the version from Debian Testing is recommended - see Balloon3OpenOCD )
Permissions:
rights to access the serial port (adduser username dialout on Debian)
- a udev rule configured so that your OpenOCD dongle is accessible to group plugdev
- permissions to access the parallel port using rawio if you're using bflash. bbl uses sudo to get raw parallel access so you need to add this fragment to /etc/sudoers/ to make it all work nicely:
Cmnd_Alias BCMD = /usr/local/bin/Jflash-balloon, /usr/local/bin/playxsvf, \
/usr/local/bin/balloon-audio-off, /usr/local/bin/bflash
ALL ALL= EXEC: NOPASSWD: BCMD
Usage and Config
bbl will prompt you when you need to connect up JTAG or serial connections or reset the board, but you'll need to remember to power the board.
bbl activity can be controlled entirely from the command line but it also uses a config file bblrc which is generally the best place to put all the filename info. A default file which matches the current distribution is installed in /etc/bblrc. You just need to set the directory in which your balloon files are found (if the default of $HOME/balloon-bin is not correct), and perhaps change the address for the parallel port and the device for the serial port to suit your machine. The defaults are /dev/ttyS0 and 0x378 respectively. bflash can detect the correct parallel port address to use by itself so this setting only matters for jflash or if auto-detection fails.
As well as the system defauls in /etc/bblrc, bbl will also look for a per-user config file in ~/.bblrc and a local file bblrc in the current directory. This last makes it easy to have a bblrc in the same directory as a set of files to upload, specifying the correct filenames. Only the system config file is installed by default.
To fill a balloon completely from empty the command is: for FPGA balloon3:
bbl --flash --bootldr --fpga --kernel --root
for CPLD balloon3:
bbl --cpld --flash --bootldr --kernel --root
Until bflash supports balloon2 properly you need to use --jflash instead of --flash for balloon2:
bbl --cpld --jflash --bootldr --kernel --root
or alternatively:
bbl --balloon2 --flash --cpld --bootldr --kernel --root
which will choose jflash and do the right thing.
(these commands assume that there is a bblrc present which specifies the filename to upload and the directory to find them in).
Some other examples are:
bbl --flash
Just upload the initial bootloader image over JTAG
bbl --fpga --logicfile newtestfpgaimage --logicdirectory /home/balloon/vhdl/
will upload the fpga image in the file /home/balloon/vhdl/newtestfpgaimage
bbl
will show you all the options
Note that the command order is not important but some functions depend on the earlier stages having been done (e.g. --kernel or --fpga require that a full bootloader has been uploaded). On a cpld board nothing will work until bbl --cpld has been run successfully.