From 0dc361ec70a154f842a6fc6a9ab5ba912554fead Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Wed, 20 Dec 2023 10:55:43 +0100 Subject: [PATCH] Add run script for compiling --- lib/obp60task/.gitpod.yml | 1 - lib/obp60task/run | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 lib/obp60task/run diff --git a/lib/obp60task/.gitpod.yml b/lib/obp60task/.gitpod.yml index 62823b5..1944771 100644 --- a/lib/obp60task/.gitpod.yml +++ b/lib/obp60task/.gitpod.yml @@ -1,5 +1,4 @@ tasks: -# - command: pip3 install -U platformio && platformio run -e heltec_wifi_lora_32_V2 - command: pip3 install -U platformio && platformio run image: diff --git a/lib/obp60task/run b/lib/obp60task/run new file mode 100644 index 0000000..4121e53 --- /dev/null +++ b/lib/obp60task/run @@ -0,0 +1,32 @@ +#!/bin/bash + +# This script compile the software and loads the bin files into the web flash tool +# in the Gitpod Docker container. +# The web flashtool can be started from the Github website with: +# http://YourGitHubName.github.io/LoRa-Boat-Monitor/flash_tool/esp_flash_tool.html + +# Attention! Start this cript only in the Gitpod Docker container. +# Start the script with: bash run + +# Path definitions +projectpath="./.pio/build/nodemcu-32s" +toolpath="./docs/flash_tool" + +# Install tools +echo "Installing tools" +pip3 install -U esptool +pip3 install -platformio + +# Compile the firmware +echo "Compiling Firmware" +platformio run + +# Copy all bin files in docs folder for online flash tool +echo "Copy bin files" +cp $projectpath/bootloader.bin $toolpath/bootloader.bin +cp $projectpath/partitions.bin $toolpath/partitions.bin +cp $projectpath/firmware.bin $toolpath/firmware.bin + +# Merge all bin files to one merge file +echo "Merge all bin files" +esptool.py --chip ESP32 merge_bin -o $toolpath/merged-firmware.bin --flash_mode dio --flash_size 4MB 0x1000 $toolpath/bootloader.bin 0x8000 $toolpath/partitions.bin 0x10000 $toolpath/firmware.bin