Linux toolchain for building firmware

I wanted to experiment in some things related to rak4631 firmware and I just couldnt find any instructions on how to install and use the build toolchain using cli only.

In case anyone else is interested in this particular topic, I was delighted to find out how elegant and simple the build system is.

Some pre-requisite packages needed:
python3, python3-virtualenvwrapper

## setup new build env
$ mkvirtualenv meshtastic

## switch to build env
$ workon meshtastic

## install dev platform
$ pip install -U platformio

## init git repos
$ git clone https://github.com/meshtastic/firmware.git
$ cd firmware && git submodule update --init

## build rak4631 target
$ pio run -e rak4631
  => .pio/build/rak4631/firmware.zip (DFU OTA flashable package)

From nothing to running binary in less than 5 minutes with zero hassle, amazing.

Many thanks to anyone and everyone working on the toolchain.

3 Likes

Yes, similar to how i build on riscv64 linux-native

sudo apt -y install libgpiod-dev libyaml-cpp-dev libbluetooth-dev gpiod virtualenv git python3-full

mkdir mkfw
cd mkfw
virtualenv .
source bin/activate

git clone https://github.com/meshtastic/firmware
cd firmware; git submodule init; git submodule update;

pip install platformio;
#Next run to check for pkg updates
#platformio pkg update;
pio run -e native;
#this is the firmware output
ls -lah .pio/build/native/program (edited)