-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun
32 lines (25 loc) · 1.12 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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/heltec_wifi_lora_32_V2"
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