@@ -11,6 +11,11 @@ echo "* Installing/Updating ESP-IDF and all components..."
11
11
source ./tools/install-esp-idf.sh
12
12
if [ $? -ne 0 ]; then exit 1; fi
13
13
14
+ # use fork until upstream bugs are fixed
15
+ git clone --depth 1 https://github.com/Jason2866/esp-hosted-mcu.git || {
16
+ echo " Failed to clone esp-hosted-mcu" ; exit 1; }
17
+ cd esp-hosted-mcu/slave || exit 1
18
+ mkdir wifi_copro_fw
14
19
15
20
slave_targets=(
16
21
" esp32"
@@ -21,18 +26,37 @@ slave_targets=(
21
26
" esp32c6"
22
27
)
23
28
24
- idf.py create-project-from-example " espressif/esp_hosted:slave"
25
- mkdir wifi_copro_fw
26
- cd ./slave
27
- echo " Found firmware version: $( < ./main/coprocessor_fw_version.txt) "
28
-
29
29
for target in " ${slave_targets[@]} " ; do
30
30
echo " Building for target: $target "
31
31
idf.py set-target " $target "
32
32
idf.py clean
33
33
idf.py build
34
- cp ./build/network_adapter.bin .. /wifi_copro_fw/network_adapter_" $target " .bin
34
+ cp ./build/network_adapter.bin ./wifi_copro_fw/network_adapter_" $target " .bin
35
35
echo " Build completed for target: $target "
36
36
done
37
37
38
- cp ./main/coprocessor_fw_version.txt ../wifi_copro_fw/coprocessor_fw_version.txt
38
+ echo " Extracting firmware version from header…"
39
+
40
+ INPUT_FILE=" ./main/esp_hosted_coprocessor_fw_ver.h"
41
+ OUTPUT_FILE=" ./wifi_copro_fw/coprocessor_fw_version.txt"
42
+
43
+ if [ ! -f " $INPUT_FILE " ]; then
44
+ echo " Error: File $INPUT_FILE not found!"
45
+ exit 1
46
+ fi
47
+
48
+ MAJOR=$( grep " PROJECT_VERSION_MAJOR_1" " $INPUT_FILE " | sed ' s/.*PROJECT_VERSION_MAJOR_1 \([0-9]*\).*/\1/' )
49
+ MINOR=$( grep " PROJECT_VERSION_MINOR_1" " $INPUT_FILE " | sed ' s/.*PROJECT_VERSION_MINOR_1 \([0-9]*\).*/\1/' )
50
+ PATCH=$( grep " PROJECT_VERSION_PATCH_1" " $INPUT_FILE " | sed ' s/.*PROJECT_VERSION_PATCH_1 \([0-9]*\).*/\1/' )
51
+
52
+ if [ -z " $MAJOR " ] || [ -z " $MINOR " ] || [ -z " $PATCH " ]; then
53
+ echo " Error: Could not extract all version infos!"
54
+ echo " MAJOR: '$MAJOR ', MINOR: '$MINOR ', PATCH: '$PATCH '"
55
+ exit 1
56
+ fi
57
+
58
+ VERSION=" $MAJOR .$MINOR .$PATCH "
59
+ echo " $VERSION " > " $OUTPUT_FILE "
60
+
61
+ echo " Version $VERSION has been written in $OUTPUT_FILE ."
62
+
0 commit comments