hackrf/firmware
Michael Ossmann 76dd5916a7
Merge pull request #1752 from martinling/move-cpld-load
Move `cpld_jtag_sram_load` into `cpld_jtag.c`
2026-05-18 11:52:49 -04:00
..
blinky firmware: rename hackrf_core.x to pins.x 2026-04-28 11:07:40 +02:00
common Merge pull request #1752 from martinling/move-cpld-load 2026-05-18 11:52:49 -04:00
cpld update README files for CPLD SRAM loading 2021-03-17 21:57:35 -06:00
fpga gateware: add configurable mixer to RX extended precision 2026-04-01 17:43:33 +02:00
hackrf_usb Move cpld_jtag_sram_load() into cpld_jtag.c. 2026-05-13 21:52:51 +01:00
libopencm3@a0bb997968 Update libopencm3 for recent compiler warning fixes. 2026-02-09 19:08:06 +00:00
tools CPLD: Add output for PortaPack C++ CPLD data. 2019-03-10 12:56:29 -07:00
.gitignore .gitignore additions: .dfu in /firmware, .pdf and .svg in /hardware 2013-03-07 14:56:32 -07:00
appveyor.sh Add Windows build art(e|i)facts (#561) 2018-12-05 18:45:26 -07:00
CMakeLists.txt firmware: bump CMake requirement to 3.12. 2026-05-07 14:38:39 +02:00
dfu-util.cmake Firmware: no longer require dfu-prefix 2018-03-22 12:29:27 -06:00
dfu.py Firmware: no longer require dfu-prefix 2018-03-22 12:29:27 -06:00
hackrf-common.cmake firmware: move platform preprocessor definitions to cmake 2026-05-07 14:38:38 +02:00
include-what-you-use.cmake Fix IWYU --keep syntax for compatibility with 0.22 2026-05-07 18:56:53 -04:00
libopencm3.imp repo: add include-what-you-use mapping file for libopencm3 2026-04-02 14:16:24 +02:00
platform-detect.cmake firmware: move platform preprocessor definitions to cmake 2026-05-07 14:38:38 +02:00
README Add HackRF Pro to firmware/README 2025-12-30 20:13:04 -05:00
toolchain-arm-cortex-m.cmake Add Windows build art(e|i)facts (#561) 2018-12-05 18:45:26 -07:00

The primary firmware source code for USB HackRF devices is hackrf_usb.  Most of
the other directories contain firmware source code for test and development.
The common directory contains source code shared by multiple HackRF firmware
projects.  The cpld directory contains HDL source for the CPLD.


The firmware is set up for compilation with the GCC toolchain available here:

https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

Required dependency:

https://github.com/mossmann/libopencm3

If you are using git, the preferred way to install libopencm3 is to use the
submodule:

$ cd ..
$ git submodule init
$ git submodule update

To build and install a standard firmware image for HackRF One:

$ cd hackrf_usb
$ mkdir build
$ cd build
$ cmake ..
$ make
$ hackrf_spiflash -w hackrf_usb.bin

If you have a HackRF Pro, add -DBOARD=PRALINE to the cmake command.
If you have a Jawbreaker, add -DBOARD=JAWBREAKER to the cmake command.
If you have a rad1o, use -DBOARD=RAD1O instead.

If you get the "`arm-none-eabi-gcc` is not a full path and was not found in the PATH"
error during `cmake ..`, install the
[ARM GNU toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain).
This toolchain is pre-packaged on many platforms and distributions, e.g. on Debian/Ubuntu
you can run `sudo apt-get install gcc-arm-none-eabi` to install it.

If you get the "ModuleNotFoundError: No module named 'yaml'" error during `make`,
run `pip install pyyaml` to install the Python yaml pip package.

It is possible to use a USB Device Firmware Upgrade (DFU) method to load
firmware into RAM.  This is normally only required to recover a device that has
had faulty firmware loaded, but it can also be useful for firmware developers.

For loading firmware into RAM with DFU you will need:

http://dfu-util.sourceforge.net/

To start up HackRF One or HackRF Pro in DFU mode, hold down the DFU button
while powering it on or while pressing and releasing the RESET button.  Release
the DFU button after the 3V3 LED illuminates.

A .dfu file is built by default when building firmware.  Alternatively you can
use a known good .dfu file from a release package.  Load the firmware into RAM
with:

$ dfu-util --device 1fc9:000c --alt 0 --download hackrf_usb.dfu