Skip to content

Building from source

Mycroft edited this page Dec 9, 2017 · 17 revisions

Required:


For Ubuntu: There's a [PPA available]((https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa) that contains up to the latest GCC-ARM**

To add and update:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update

Once you've updated your index, you can now install the package:

sudo apt-get install gcc-arm-embedded

It is necessary to use the latest version of GCC-ARM (6.3.1 20170620 works). The default Ubuntu package is outdated and will produce errors during compilation.

To install the arm.com version, unpack the files in /usr/local/gcc-arm-none-eabi-6-2017-q2-update/ for example, and edit the /firmware/toolchain-arm-cortex-m.cmake file.

Replace "arm-none-eabi-gcc" in the CMAKE_FORCE_C_COMPILER and CMAKE_C_COMPILER lines by the full path to the up-to-date version of gcc. Do the same for "arm-none-eabi-g++" in the CMAKE_FORCE_CXX_COMPILER and CMAKE_CXX_COMPILER lines.

The beginning of the file should look like this:

if(CMAKE_VERSION VERSION_LESS 3.6)
  include(CMakeForceCompiler)
  CMAKE_FORCE_C_COMPILER(/usr/local/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc GNU)
  CMAKE_FORCE_CXX_COMPILER(/usr/local/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-g++ GNU)
else()
  set(CMAKE_C_COMPILER /usr/local/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc)
  set(CMAKE_CXX_COMPILER /usr/local/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-g++)
  set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
endif()

Then, install the other requirements if needed:

sudo apt-get install dfu-util
sudo apt-get install cmake
sudo apt-get install git

Clone the repository and let gcc do the work:

git clone https://github.com/furrtek/portapack-havoc.git
cd portapack-havoc
mkdir build
cd build
cmake ..
make firmware

Give it some time and you should end up with a fresh /firmware/portapack-h1-havoc.bin file. You can now flash it.