From 6256ac706289e262a66b7a539318da934e367d30 Mon Sep 17 00:00:00 2001 From: "Bert, DD5XL" Date: Sat, 5 Sep 2020 17:23:27 +0200 Subject: [PATCH] Created Building the Arduino MMDVM in console (markdown) --- Building-the-Arduino-MMDVM-in-console.md | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Building-the-Arduino-MMDVM-in-console.md diff --git a/Building-the-Arduino-MMDVM-in-console.md b/Building-the-Arduino-MMDVM-in-console.md new file mode 100644 index 0000000..cf7af53 --- /dev/null +++ b/Building-the-Arduino-MMDVM-in-console.md @@ -0,0 +1,50 @@ +If you have a remote repeater with a headless controller (console only, e.g. RPi without GUI but SSH), you can not use the standard Arduino IDE to compile the Arduino Due MMDVM binary remotely. + +Usually you will compile MMDVM locally on a different machine with Arduino IDE installed, upload the binary to the headless controller and use `bossac` cmd line flash utility to flash the image into the Arduino board. + +Another option is to compile MMDVM remotely on the headless controller with a CLI tool: +There is a Arduino CLI compiler available at Github, [Arduino-CLI](https://github.com/arduino/arduino-cli) + +Install it according to the [instructions](https://arduino.github.io/arduino-cli/latest/installation/) from your remote home directory with + +`curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh` + +The arduino-cli will be installed to ~/bin which is included in $PATH on most distributions. + +To add the SAM Due core files to arduino-cli, do a + +`arduino-cli core install arduino:sam` + +This installs all compiler, linker and supplementary stuff to compile sources for the Arduino Due's SAM3X uC. +You can check if arduino-cli now knows about Arduino Due when: + +`bert@db0rof-dmr:~/Src/MMDVM$ arduino-cli core list` + +shows + +`arduino:sam 1.6.12 1.6.12 Arduino SAM Boards (32-bits ARM Cortex-M3)` + +Now clone the MMDVM repository to the headless machine and change into its directory: + +`git clone https://github.com/g4klx/MMDVM; cd MMDVM` + +Read the BUILD.txt and add the required lib references to platform.txt with your favorite editor, e.g. + +`nano ~/.arduino15/packages/arduino/hardware/sam/1.6.12/platform.txt` + +(Replace version string with you current one) + +Check the `Config.h` as usual for the required settings. +Now you are ready to compile the MMDVM on your headless: + +`arduino-cli compile --fqbn arduino:sam:arduino_due_x_dbg MMDVM` + +If everything went fine, you will find a new folder `build/arduino:sam:arduino_due_x_dbg` which holds the finished MMDVM binary. + +To flash it to the attached Arduino Due, stop any running MMDVMHost instance and upload the binary with + +`arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:sam:arduino_due_x_dbg MMDVM` + +(replace port value to match your scenario) + +Finally restart MMDVMHost and check the log output if the correct version and compile date of the Arduino firmware is shown. \ No newline at end of file