Skip to content

Commit d2967a6

Browse files
authored
Update compile_slave.sh
1 parent 5a9c0d2 commit d2967a6

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

tools/compile_slave.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ echo "* Installing/Updating ESP-IDF and all components..."
1111
source ./tools/install-esp-idf.sh
1212
if [ $? -ne 0 ]; then exit 1; fi
1313

14+
# use fork until upstream bugs are fixed
1415
git clone https://github.com/Jason2866/esp-hosted-mcu.git
1516
cd esp-hosted-mcu/slave
17+
mkdir wifi_copro_fw
1618

1719
slave_targets=(
1820
"esp32"
@@ -23,11 +25,6 @@ slave_targets=(
2325
"esp32c6"
2426
)
2527

26-
# idf.py create-project-from-example "espressif/esp_hosted:slave"
27-
mkdir wifi_copro_fw
28-
# cd ./slave
29-
echo "Found firmware version: $(<./main/coprocessor_fw_version.txt)"
30-
3128
for target in "${slave_targets[@]}"; do
3229
echo "Building for target: $target"
3330
idf.py set-target "$target"
@@ -37,30 +34,28 @@ for target in "${slave_targets[@]}"; do
3734
echo "Build completed for target: $target"
3835
done
3936

37+
echo "Extracting firmware version from header…"
38+
4039
INPUT_FILE="./main/coprocessor_fw_version.h"
4140
OUTPUT_FILE="./wifi_copro_fw/coprocessor_fw_version.txt"
4241

43-
# Prüfen ob Eingabedatei existiert
4442
if [ ! -f "$INPUT_FILE" ]; then
45-
echo "Fehler: Datei $INPUT_FILE nicht gefunden!"
43+
echo "Error: File $INPUT_FILE not found!"
4644
exit 1
4745
fi
4846

49-
# Versionsnummern extrahieren
5047
MAJOR=$(grep "PROJECT_VERSION_MAJOR_1" "$INPUT_FILE" | sed 's/.*PROJECT_VERSION_MAJOR_1 \([0-9]*\).*/\1/')
5148
MINOR=$(grep "PROJECT_VERSION_MINOR_1" "$INPUT_FILE" | sed 's/.*PROJECT_VERSION_MINOR_1 \([0-9]*\).*/\1/')
5249
PATCH=$(grep "PROJECT_VERSION_PATCH_1" "$INPUT_FILE" | sed 's/.*PROJECT_VERSION_PATCH_1 \([0-9]*\).*/\1/')
5350

54-
# Prüfen ob alle Werte gefunden wurden
5551
if [ -z "$MAJOR" ] || [ -z "$MINOR" ] || [ -z "$PATCH" ]; then
56-
echo "Fehler: Konnte nicht alle Versionsnummern extrahieren!"
52+
echo "Error: Could not extract all version infos!"
5753
echo "MAJOR: '$MAJOR', MINOR: '$MINOR', PATCH: '$PATCH'"
5854
exit 1
5955
fi
6056

61-
# Version zusammensetzen und in Datei schreiben
6257
VERSION="$MAJOR.$MINOR.$PATCH"
6358
echo "$VERSION" > "$OUTPUT_FILE"
6459

65-
echo "Version $VERSION wurde in $OUTPUT_FILE geschrieben."
60+
echo "Version $VERSION has been written in $OUTPUT_FILE."
6661

0 commit comments

Comments
 (0)