This is an upgrade to the latest FX3 SDK (1.3.5) and to the ARM gcc in version 15.3.rel1 for the build of the B2xx firmware and bootloader. All required steps are explained in the updated readme file. Additionally, some bounds checks were added both in the firmware and the bootloader, as well as some more validations and checks to prevent over- and underflows. Newly introduced checks were documented in the code.
3.3 KiB
INSTRUCTIONS
Building the B2xx FX3 Firmware
The USRP B200 and B210 each use the Cypress FX3 USB3 PHY for USB3 connectivity. This device has an ARM core on it, which is programmed in C. This README will show you how to build our firmware and bootloader source.
A brief "Theory of Operations": The host sends commands to the FX3, our USB3 PHY, which has an on-board ARM which runs the FX3 firmware code (hex file). That code is responsible for managing the transport from the host to the FPGA by configuring IO and DMA.
Setting up the Cypress SDK
In order to compile the USRP B200 and B210 bootloader and firmware, you will need the FX3 SDK distributed by Cypress Semiconductor. You can download the FX3 SDK from here. Version 1.3.5 is known to be working.
From the SDK, extract the ARM cross-compile toolchain tarball ARM-GCC.tar.gz
and the FX3 firmware tarball fx3_firmware_linux.tar.gz.
Get the latest version of the GNU Toolchains for ARM from arm.com
and extract it. Version 15.3.rel1 is known to be working.
Set up the appropriate environment variables for the build:
$ export ARMGCC_INSTALL_PATH=<ARM toolchain dir>
$ export ARMGCC_VERSION=<ARM toolchain version>
$ export FX3FWROOT=<FX3 firmware dir>
These should look something like this:
$ export ARMGCC_INSTALL_PATH=/path/to/my/files/arm-gnu-toolchain-15.3.rel1-x86_64-arm-none-eabi
$ export ARMGCC_VERSION=15.3.1
$ export FX3FWROOT=/path/to/my/files/cyfx3sdk
The SDK makefiles invoke arm-none-eabi-gcc unqualified and only use
ARMGCC_INSTALL_PATH to locate the libraries, so the toolchain must also be on
your PATH:
$ export PATH=$ARMGCC_INSTALL_PATH/bin:$PATH
Without this, the build either fails with arm-none-eabi-gcc: No such file or directory or, if a different ARM toolchain happens to be installed, silently
compiles with that compiler while linking against the libraries of the toolchain
above. Verify the expected compiler is picked up:
$ arm-none-eabi-gcc --version
Applying the Patch to the Toolchain
Now, you'll need to apply a patch to some files in the Cypress SDK. Before doing so, ensure all files in the SDK have Unix line endings and are writable for the user:
$ cd $FX3FWROOT
$ find . -type f -exec dos2unix {} \; -exec chmod u+w {} \;
Apply the patch b200/fx3_mem_map.patch as follows:
$ cd uhd.git/firmware/fx3
$ patch -p1 -d $FX3FWROOT < b200/fx3_mem_map.patch
If you don't see any errors print on the screen, then the patch was successful.
Building the Firmware
Now, you should be able to head into the b200/firmware directory and simply
build the firmware:
$ cd uhd.git/firmware/fx3/b200/firmware
$ make
It will generate a usrp_b200_fw.hex file, which you can then give to UHD to
program your USRP B200 or USRP B210.
Building the Bootloader
The bootloader is built in the b200/bootloader directory:
$ cd uhd.git/firmware/fx3/b200/bootloader
$ make
It will generate a usrp_b200_bl.img file, which you can supply as an argument
to b2xx_fx3_utils to load it onto the device.