Firmware Build Documentation for Ubuntu #494
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Building LoRaSerial Firmware
The open source LoRaSerial firmware builds under Windows and Linux. Use the following procedures to setup the environment and perform the build:
Virtual Machine
Execute the following commands in the VirualBox application to create a virtual machine:
An operating system is needed for the virtual machine to enable it to run applications. Download one of the following operating system images (.iso files):
Click on Activities
Type terminal into the search box
In the terminal window
a. sudo apt install -y net-tools openssh-server
b. ifconfig
Write down the IP address
On the PC (Linux) in a terminal window
a. ssh-keygen -t rsa -f ~/.ssh/SparkFun_LoRaSerial_22.04.1
b. ssh-copy-id -o IdentitiesOnly=yes -i ~/.ssh/SparkFun_LoRaSerial_22.04.1 <username>@<IP address>
c. ssh -Y <username>@<IP address>
Ubuntu Build Environment
The following setup and build instructions were tested on Ubuntu 22.04.1. The build can run on a physical or virtual CPU. The following section describes how to setup the a virtual machine. Further sections describe the build environment and how to perform the build.
Execute the following commands to create the build environment for the SparkFun LoRaSerial Firmware:
Reboot to ensure that the dialout privilege is available to the user
Insert the following text into the file:
Get the SparkFun LoRaSerial Firmware sources
Install the Arduino IDE
Setup the Arduino Build Environment
Install the ARM Cortex-M0+ tools. See SAMD21 MiniDev Hookup Guide for more documentation.
Install the SparkFun Board Packages
Install the required libraries
The following procedure installs the libraries needed to successfully build the LoRaSerial firmware.
Click on Tools in the menu bar
Click on Manage Libraries...
For each library:
a. Enter the library name into the search box
b. Scroll down the list if necessary to locate the specified libray
c. Click on the library
d. Select the specified version
e. Click on the install button
Install the following libraries:
a. Crypto, v0.4.0
a. FlashStorage_SAMD, v1.3.2
a. JC_Button, v2.1.2
a. RadioLib, v5.1.2
a. SAMD_TimerInterrupt, v1.9.0
Click on File in the menu bar
Click on Quit
External Libraries
The WDT library is not registered with the Arduino IDE. It must be added outside of the Arduino IDE environment. Install the external libraries adding them to the Sketchbook location noted above.
Build the LoRaSerial Firmware
Use the following procedure to get the project ready to build
Connect the LoRaSerial Device
Compile
Upload the Firmware
Arduino CLI
The firmware can be compiled using Arduino CLI. This makes compilation fairly platform independent and flexible. All release candidates and firmware releases are compiled using Arduino CLI using a github action. You can see the source of the action here, and use it as a starting point for Arduino CLI compilation.