There are two toolchains, depending on what you are developing:
bfin-elf-xxx which uses the newlib and libgloss libraries.The Blackfin toolchain is split up into a few different packages. You must select the proper components for a properly working toolchain. Older versions may not have include as many choices.
A typical install requires only two files.
Exactly which two files is an excerise left for the reader, as it depends on:
| Filename prefix | Optional or Required | Description |
|---|---|---|
blackfin-toolchain | required | GCC-4.1 of bfin-uclinux-xxx and bfin-linux-uclibc-xxx |
blackfin-toolchain-gcc-3.4-addon | optional | GCC-3.4 of bfin-uclinux-xxx and bfin-linux-uclibc-xxx |
blackfin-toolchain-elf-gcc-4.1 | optional | GCC-4.1 of bfin-elf-xxx |
blackfin-toolchain-elf-gcc-3.4-addon | optional | GCC-3.4 of bfin-elf-xxx |
Although which exact package you install depends on the functionality you require (default or extended functionality), you must only install just one per version (default or full, but not both) of GCC that installed.
| GCC version | Package name prefix | Description |
|---|---|---|
| GCC-4.1 | blackfin-toolchain-uclibc-default | default set of configuration options |
| GCC-4.1 | blackfin-toolchain-uclibc-full | extended set of configuration options (wchar/etc…) |
| GCC-3.4 | blackfin-toolchain-uclibc-default-gcc-3.4-addon | default set of configuration options |
| GCC-3.4 | blackfin-toolchain-uclibc-full-gcc-3.4-addon | extended set of configuration options (wchar/etc…) |
jtag tools (for developing with an In Circuit Emulator).
The Blackfin toolchain can be obtained from the Blackfin Linux website in the toolchain file release page. You just need to determine your architecture (what host you have), and what files you need.
Before installing the latest toolchain (you can find the latest release by the release date), be sure to read the toolchain release notes.
Depending on the version of the toolchain there may be a variety of file types available. These file types are summarized below:
tar xjf filename.tar.bz2)tar xzf filename.tar.gz)Files that include .src. are the source packages that include all of the source code used to build the binary packages. Files that include .i386. or .x86_64. or similar architecture names are prebuilt binary packages for that specific architecture.
You may need some additional packages in order for everything to run smoothly. Please see the section about configuring Linux for more information.
There may also be a number of addons available (for other toolchain tuples like ''bfin-elf'' or for other gcc versions). You normally do not need to install these; they are merely provided in case you have some code which needs an older version of gcc to build. The bfin-elf toolchain is only needed if you wish to compile code that will be running on bare-metal -- that is, no operating system at all like Linux.
The default install path for all of our toolchains is /opt/uClinux/. This is not a requirement, just the default, so you can unpack the install files elsewhere if you like. Note however that the RPMs do not have the ability to change install paths, so those must be installed into /opt/uClinux/ first before being moved.
There may be more detailed installation instructions in the Toolchain Release Notes.
/opt must be writable. Normally if /opt is on a local machine, just become root, if /opt is network mounted, you will need to call your local IT support person. If this is not possible - you should install from the tarball.
If you're running a newer RPM distro, the following repositories can be used to automate the install procedure:
For an RPM file, as root enter the following command:
# rpm -Uvh <filename> (e.g. rpm -Uvh blackfin-toolchain-07r1.1-3.i386.rpm)
Do not do it. Use the provided pre-compiled tarballs (tar.gz or .tar.bz2). On the off chance that one does not exist …
Many distributions do not utilize RPM's so it may be a pain to try and install one. We often times include binary tarballs which are equivalent to the binary RPM's, but if one is not available, we'll show you how to convert the RPM yourself.
First install the package rpm2targz. If your distribution does not include it, you can find it here.
Converting it is pretty easy:
$ rpm2targz <rpm> (e.g. rpm2targz blackfin-toolchain-07r1.1-3.i386.rpm)
This should leave you with a tarball in the same directory named the same as the rpm, but with a '.tar.gz' instead of '.rpm' extension. Then just unpack the tarball and move the files wherever you like.
You can try using the update repository to install things, in three simple steps. (coLinux users, who are using the coLinux install from this site can skip steps one and two, since this is installed by default):
/etc/apt/sources.list.d/blackfin.sources.list by: $ sudo su - # mkdir -p /etc/apt/sources.list.d # echo deb http://download.analog.com/27516/distros/debian stable main > /etc/apt/sources.list.d/blackfin.sources.list
$ sudo apt-get update
$ sudo apt-get install blackfin-toolchain-uclinux blackfin-toolchain-linux-uclibc
There are a few reasons not to use the prebuilt binary toolchain:
Normally these should not happen -- we attempt to ensure that there are no bugs, attempt to ensure the widest settings of uClibc (we normally provide two versions of uClibc), and build binaries for many architectures/OSes. If possible -- use the prebuilt binary toolchain. However, if the releases do not satisfy your needs, then you have no choice - either:
Detailed instructions on how to download and build the latest SVN toolchain can be found in the Toolchain Build Script section of the documentation. Or you can view the page on how to build the src rpm.
After installing the Blackfin toolchain the environment variable PATH must be modified to include the directory where the Blackfin toolchain is installed. This can be done by entering the following command before using the Blackfin toolchain (assuming the path where the Blackfin toolchain binaries are installed in the default location - /opt/uClinux/bfin-uclinux/bin and /opt/uClinux/bfin-linux-uclibc/bin. If you installed these somewhere else, you will need to modify these examples).
$ export PATH=$PATH:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-linux-uclibc/bin
Alternately, to have PATH set automatically edit the file ~/.bashrc to include the following lines:
export PATH=$PATH:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-linux-uclibc/bin
Now when a new bash shell is started, PATH will automatically be set to include the path to the Blackfin toolchain.
The Blackfin toolchain should now be installed allowing you to compile programs such as U‑Boot or the uClinux distribution. The default compiler is available under the name bfin-uclinux-gcc (or bfin-uclinux-g++ for the C++ compiler). If you wish to execute a specific version, simply append it like bfin-uclinux-gcc-3.4.6.
Once you have edited your path, you should check it with:
$ which -a bfin-linux-uclibc-gcc /home/rgetz/blackfin/trunk/gcc4-linux-uclibc/bin/bfin-linux-uclibc-gcc /home/rgetz/blackfin/release/gcc4-linux-uclibc/bin/bfin-linux-uclibc-gcc
Above, there are two toolchains in the path (which is normally bad), to determine which one will be used:
$ which bfin-linux-uclibc-gcc /home/rgetz/blackfin/trunk/gcc4-linux-uclibc/bin/bfin-linux-uclibc-gcc
If this is not the toolchain you want to use, you can edit your PATH variable.
$ echo $PATH :/home/rgetz/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin: /usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin:/usr/sbin:/usr/sbin:/home/rg etz/blackfin/trunk/gcc4-linux-uclibc/bin:/home/rgetz/blackfin/trunk/gcc4-uclinux/bin:/home/rgetz/blac kfin/trunk/gcc4-elf/bin:/home/rgetz/blackfin/release/gcc4-linux-uclibc/bin:/home/rgetz/blackfin/trunk /gcc4-uclinux/bin:/home/rgetz/blackfin/release/gcc4-elf/bin: $ export PATH=:/home/rgetz/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:\ /usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin:/usr/sbin:/usr/sbin:/home/rgetz/blackfin/trunk/gcc4-linux-uclibc/bin:\ /home/rgetz/blackfin/trunk/gcc4-uclinux/bin:/home/rgetz/blackfin/trunk/gcc4-elf/bin:
To remove a toolchain you don't want - depends on how you installed it.
rpm based package managers - look for rpm erase.apt based package managers - look for apt-get remove or apt-get purgetar-ball - if you installed something from source, or by from a binary tar ball, just rm the directory in question.The Blackfin toolchain can be obtained from the Blackfin Linux website in the toolchain file release page.
Before installing the latest toolchain (you can find the latest release by the release date), be sure to read the toolchain release notes.
There is only one Windows toolchain package (installer) available:
Files that include .src. are the source packages that include all of the source code used to build the binary packages. The Windows GNU/Blackfin toolchain includes a complete toolchain for building bare metal applications (bfin-elf-) and a complete toolchain for building Linux fdpic applications. If you are not sure what the difference is, have a look at the supported targets page.
The Windows installer will add the directory that you installed things into to your default PATH, so you can call the toolchain from any directory. All that is installed is command line callable toolchain - it does not include an IDE (integrated development environment, or graphical editor). It is up to you to either install one (have a peek at eclipse), or use your existing favorite if it allows third party compilers to be called.