56
56
# Some may argue that this is only used by a script, BUT as soon someone accidentally or on purpose starts Arduino IDE
57
57
# it will use the default Arduino IDE folders and so can corrupt the build environment.
58
58
#
59
- # Version: 2.0.2-Build_69
59
+ # Version: 2.0.2-Build_80
60
60
# Change log:
61
61
# 12 Jan 2019, 3d-gussner, Fixed "compiler.c.elf.flags=-w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections" in 'platform.txt'
62
62
# 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is unknown
177
177
# Fix DEV_STATUS to set correctly on RC/BETA/ALPHA/DEVEL
178
178
# Fix atmegaMK404 Board mem and flash modifications
179
179
# Limit atmegaMK404 boards mem to 8,16,32
180
- # 20 Jun 2022, 3d-gussner, Change to Ardunio_boards v 1.0.5-1
181
-
180
+ # 20 Jun 2022, 3d-gussner, Change to Ardunio_boards v1.0.5-1
181
+ # 20 Jun 2022, wavexx , New PO-based language translation support
182
+ # 20 Jun 2022, 3d-gussner, fix Mk2.5/S zip after change PO-based language translation support
183
+ # 06 Jul 2022, 3d-gussner, Change to v1.0.8 and Ardunio_boards v1.0.5-2
184
+ # 06 Jul 2022, 3d-gussner, Fix branch check
185
+ # 12 Jul 2022, 3d-gussner, Check if FW_FLAVAVOR and FW_FLAVERSION are correct
182
186
183
187
SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " ; pwd -P ) "
184
188
export SRCDIR=$SCRIPT_PATH
@@ -202,6 +206,7 @@ case "$1" in
202
206
22) echo " $( tput setaf 1) PF-build.sh has been interrupted/failed. $( tput setaf 6) Restoring 'config.h'$( tput sgr0) " ; if [ $OUTPUT == " 1" ] ; then sleep 5 ; fi ;;
203
207
24) echo " $( tput setaf 1) PF-build.sh stopped due to compiling errors! Try to restore modified files.$( tput sgr0) " ; check_script_failed_nr1 ; check_script_failed_nr2 ; cleanup_firmware ; exit 24 ;;
204
208
25) echo " $( tput setaf 1) Failed to execute $( tput sgr0) " ; exit 25 ;;
209
+ 26) echo " $( tput setaf 1) FW_FLAVAVOR or FW_FLAVERSION commented out in 'Firmware/Configuration.h'$( tput sgr0) " ; check_script_failed_nr1 ; check_script_failed_nr2 ; cleanup_firmware ; exit 26 ;;
205
210
esac
206
211
}
207
212
# ### End: Failures
@@ -235,7 +240,7 @@ while getopts b:c:d:g:h:i:j:l:m:n:o:p:v:x:y:?h flag
235
240
# '?' 'h' argument usage and help
236
241
if [ " $help_flag " == " 1" ] ; then
237
242
echo " ***************************************"
238
- echo " * PF-build.sh Version: 2.0.2-Build_69 *"
243
+ echo " * PF-build.sh Version: 2.0.2-Build_80 *"
239
244
echo " ***************************************"
240
245
echo " Arguments:"
241
246
echo " $( tput setaf 2) -b$( tput sgr0) Build/commit number"
@@ -261,7 +266,7 @@ echo " -b : '$(tput setaf 2)Auto$(tput sgr0)' needs git or a number"
261
266
echo " -c : '$( tput setaf 2) 0$( tput sgr0) ' clean up, '$( tput setaf 2) 1$( tput sgr0) ' keep"
262
267
echo " -d : '$( tput setaf 2) GOLD$( tput sgr0) ', '$( tput setaf 2) RC$( tput sgr0) ', '$( tput setaf 2) BETA$( tput sgr0) ', '$( tput setaf 2) ALPHA$( tput sgr0) ', '$( tput setaf 2) DEBUG$( tput sgr0) ', '$( tput setaf 2) DEVEL$( tput sgr0) ' and '$( tput setaf 2) UNKNOWN$( tput sgr0) '"
263
268
echo " -g : '$( tput setaf 2) 0$( tput sgr0) ' no '$( tput setaf 2) 1$( tput sgr0) ' lite '$( tput setaf 2) 2$( tput sgr0) ' fancy '$( tput setaf 2) 3$( tput sgr0) ' lite with Quad_HR '$( tput setaf 2) 4$( tput sgr0) ' fancy with Quad_HR"
264
- echo " -i : '$( tput setaf 2) 1.8.5$( tput sgr0) ', '$( tput setaf 2) 1.8.13 $( tput sgr0 ) ', ' $( tput setaf 2 ) 1.8. 19$( tput sgr0) '"
269
+ echo " -i : '$( tput setaf 2) 1.8.5$( tput sgr0) ', '$( tput setaf 2) 1.8.19$( tput sgr0) '"
265
270
echo " -j : '$( tput setaf 2) 0$( tput sgr0) ' no, '$( tput setaf 2) 1$( tput sgr0) ' yes"
266
271
echo " -l : '$( tput setaf 2) ALL$( tput sgr0) ' for multi language or '$( tput setaf 2) EN_ONLY$( tput sgr0) ' for English only"
267
272
echo " -m : '$( tput setaf 2) 0$( tput sgr0) ' no, '$( tput setaf 2) 1$( tput sgr0) ' yes '$( tput setaf 2) 2$( tput sgr0) ' with MMU2"
353
358
354
359
# Start: Check if Arduino IDE version is correct
355
360
if [ ! -z " $IDE_flag " ]; then
356
- if [[ " $IDE_flag " == " 1.8.5" || " $IDE_flag " == " 1.8.13 " || " $IDE_flag " == " 1.8. 19" ]]; then
361
+ if [[ " $IDE_flag " == " 1.8.5" || " $IDE_flag " == " 1.8.19" ]]; then
357
362
ARDUINO_ENV=" ${IDE_flag} "
358
363
else
359
364
ARDUINO_ENV=" 1.8.19"
542
547
# ### Start: Set build environment
543
548
set_build_env_variables ()
544
549
{
545
- BUILD_ENV=" 1.0.7 "
550
+ BUILD_ENV=" 1.0.8 "
546
551
BOARD=" prusa_einsy_rambo"
547
552
BOARD_PACKAGE_NAME=" PrusaResearch"
548
553
if [ " $ARDUINO_ENV " == " 1.8.19" ]; then
549
- BOARD_VERSION=" 1.0.5-1 "
554
+ BOARD_VERSION=" 1.0.5-2 "
550
555
else
551
556
BOARD_VERSION=" 1.0.4"
552
557
fi
925
930
# Check if Build is selected via argument '-b'
926
931
if [ ! -z " $build_flag " ] ; then
927
932
if [[ " $build_flag " == " Auto" && " $git_available " == " 1" ]] ; then
928
- echo " Build changed to $build_flag "
929
933
BUILD=$( git rev-list --count HEAD)
930
934
elif [[ $build_flag =~ ^[0-9]+$ ]] ; then
931
935
BUILD=$build_flag
@@ -934,27 +938,26 @@ if [ ! -z "$build_flag" ] ; then
934
938
echo " Only $( tput setaf 2) 'Auto' (git needed) or numbers $( tput sgr0) are allowed as build '-b' argument!$( tput sgr0) "
935
939
failures 5
936
940
fi
937
- echo " New Build number is: $BUILD "
938
941
fi
939
942
940
943
# Check git branch has changed
941
944
if [ ! -z " git_available" ]; then
942
- BRANCH=" "
943
- CLEAN_PF_FW_BUILD=0
944
- else
945
945
BRANCH=$( git branch --show-current)
946
946
echo " Current branch is:" $BRANCH
947
947
if [ ! -f " $SCRIPT_PATH /../PF-build.branch" ]; then
948
- echo " $BRANCH " > | $SCRIPT_PATH /../PF-build.branch
948
+ # echo "$BRANCH" >| $SCRIPT_PATH/../PF-build.branch
949
949
echo " created PF-build.branch file"
950
950
else
951
951
PRE_BRANCH=$( cat " $SCRIPT_PATH /../PF-build.branch" )
952
- echo " Previous branch was:" $PRE_BRANCH
952
+ # echo "Previous branch was:" $PRE_BRANCH
953
953
if [ ! " $BRANCH " == " $PRE_BRANCH " ] ; then
954
954
CLEAN_PF_FW_BUILD=1
955
955
echo " $BRANCH " > | $SCRIPT_PATH /../PF-build.branch
956
956
fi
957
957
fi
958
+ else
959
+ BRANCH=" "
960
+ CLEAN_PF_FW_BUILD=0
958
961
fi
959
962
}
960
963
# ### End: Getting arguments for command line compiling
@@ -1018,20 +1021,27 @@ prepare_code_for_compiling()
1018
1021
MOTHERBOARD=$( grep --max-count=1 " \bMOTHERBOARD\b" $SCRIPT_PATH /Firmware/variants/$VARIANT .h | sed -e' s/ */ /g' | cut -d ' ' -f3)
1019
1022
# Check development status
1020
1023
FW_FLAV=$( grep --max-count=1 " //#define FW_FLAVOR\b" $SCRIPT_PATH /Firmware/Configuration.h| cut -d ' ' -f1)
1024
+ FW_FLAVREV=$( grep --max-count=1 " //#define FW_FLAVERSION\b" $SCRIPT_PATH /Firmware/Configuration.h| cut -d ' ' -f1)
1025
+ if [[ " $FW_FLAV " == " //#define" && -z $FW_FLAVREV ]]; then
1026
+ failures 26
1027
+ fi
1021
1028
# echo "FLAV:$FW_FLAV"
1022
1029
if [[ " $FW_FLAV " != " //#define" ]] ; then
1023
1030
FW_FLAVOR=$( grep --max-count=1 " \bFW_FLAVOR\b" $SCRIPT_PATH /Firmware/Configuration.h| sed -e' s/ */ /g' | cut -d ' ' -f3)
1024
1031
# echo "FLAVOR:$FW_FLAVOR"
1025
- FW_FLAVERSION= $( grep --max-count=1 " \bFW_FLAVERSION\b " $SCRIPT_PATH /Firmware/Configuration.h | sed -e ' s/ */ /g ' | cut -d ' ' -f3 )
1026
- if [[ " $FW_FLAVOR " != " //#define FW_FLAVOR " ]] ; then
1032
+ if [[ " $FW_FLAVREV " != " //#define " ]] ; then
1033
+ FW_FLAVERSION= $( grep --max-count=1 " \bFW_FLAVERSION\b " $SCRIPT_PATH /Firmware/Configuration.h | sed -e ' s/ */ /g ' | cut -d ' ' -f3 )
1027
1034
FW=" $FW -$FW_FLAVOR "
1028
1035
DEV_CHECK=" $FW_FLAVOR "
1029
- # echo "DEV:$DEV_CHECK"
1036
+ echo " DEV:$DEV_CHECK "
1030
1037
if [ ! -z " $FW_FLAVERSION " ] ; then
1031
1038
FW=" $FW$FW_FLAVERSION "
1032
1039
fi
1040
+ else
1041
+ failures 26
1033
1042
fi
1034
1043
fi
1044
+ # DEV_CHECK=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g'|cut -d '-' -f2)
1035
1045
if [ -z " $DEV_STATUS_SELECTED " ] ; then
1036
1046
if [[ " $DEV_CHECK " == * " RC" * ]] ; then
1037
1047
DEV_STATUS=" RC"
@@ -1155,7 +1165,7 @@ prepare_variant_for_compiling()
1155
1165
fi
1156
1166
1157
1167
# Prepare Configuration.h to use the correct FW_DEV_VERSION to prevent LCD messages when connecting with OctoPrint
1158
- sed -i -- " s/#define FW_DEV_VERSION FW_VERSION_UNKNOWN /#define FW_DEV_VERSION FW_VERSION_$DEV_STATUS /g" $SCRIPT_PATH /Firmware/Configuration.h
1168
+ sed -i -- " s/#define FW_DEV_VERSION FW_VERSION_.* /#define FW_DEV_VERSION FW_VERSION_$DEV_STATUS /g" $SCRIPT_PATH /Firmware/Configuration.h
1159
1169
1160
1170
# set FW_REPOSITORY
1161
1171
sed -i -- ' s/#define FW_REPOSITORY "Unknown"/#define FW_REPOSITORY "Prusa3d"/g' $SCRIPT_PATH /Firmware/Configuration.h
@@ -1345,23 +1355,18 @@ create_multi_firmware()
1345
1355
cp -f $BUILD_PATH /Firmware.ino.elf $SCRIPT_PATH /../$OUTPUT_FOLDER /$OUTPUT_FILENAME .elf
1346
1356
else
1347
1357
# Search for created firmware languages
1348
- langs=$( find firmware_ * .hex | cut -d " _" -f2 | cut -d " ." -f1)
1358
+ langs=$( find Firmware-intl-en_ * .hex | cut -d " _" -f2 | cut -d " ." -f1)
1349
1359
# Copy found firmware_*.hex files
1350
1360
for la in $langs ; do
1351
- cp -f firmware_ $la .hex $SCRIPT_PATH /../$OUTPUT_FOLDER /$OUTPUT_FILENAME -$la .hex
1361
+ cp -f Firmware-intl-en_ $la .hex $SCRIPT_PATH /../$OUTPUT_FOLDER /$OUTPUT_FILENAME -$la .hex
1352
1362
done
1353
1363
cp -f $BUILD_PATH /Firmware.ino.elf $SCRIPT_PATH /../$OUTPUT_FOLDER /$OUTPUT_FILENAME .elf
1354
1364
echo " $( tput setaf 2) Zip multi language firmware for MK2.5/miniRAMbo board to PF-build-hex folder$( tput sgr 0) "
1355
1365
if [ $TARGET_OS == " windows" ]; then
1356
1366
zip a $SCRIPT_PATH /../$OUTPUT_FOLDER /$OUTPUT_FILENAME .zip $SCRIPT_PATH /../$OUTPUT_FOLDER /$OUTPUT_FILENAME -?? .hex
1357
1367
# rm $SCRIPT_PATH/../$OUTPUT_FOLDER/$OUTPUT_FILENAME-??.hex
1358
1368
elif [ $TARGET_OS == " linux" ]; then
1359
- # Make a copy for MK404 sim of MK2, MK2.5, MK2.5S firmware
1360
- if [ ! -z " $mk404_flag " ]; then
1361
- cp -f firmware_de.hex $SCRIPT_PATH /../$OUTPUT_FOLDER /$OUTPUT_FILENAME .hex
1362
- fi
1363
- # End of MK2, MK2.5, MK2.5S firmware copy
1364
- zip -j ../../$OUTPUT_FOLDER /$OUTPUT_FILENAME .zip ../../$OUTPUT_FOLDER /$OUTPUT_FILENAME -?? .hex
1369
+ zip -j ../../$OUTPUT_FOLDER /$OUTPUT_FILENAME .zip ../../$OUTPUT_FOLDER /$OUTPUT_FILENAME -?? .hex
1365
1370
fi
1366
1371
fi
1367
1372
@@ -1390,7 +1395,9 @@ save_en_firmware()
1390
1395
cleanup_firmware ()
1391
1396
{
1392
1397
if [[ -z " $prusa_flag " || " $prusa_flag " == " 0" ]]; then
1393
- rm $SCRIPT_PATH /Firmware/Configuration_prusa.h || failures 13
1398
+ if [ -e " $SCRIPT_PATH /Firmware/Configuration_prusa.h" ]; then
1399
+ rm $SCRIPT_PATH /Firmware/Configuration_prusa.h || failures 13
1400
+ fi
1394
1401
fi
1395
1402
# Delete dupblicates
1396
1403
if find $SCRIPT_PATH /lang/ -name ' *RAMBo10a*.txt' -printf 1 -quit | grep -q 1
@@ -1417,8 +1424,8 @@ cleanup_firmware()
1417
1424
fi
1418
1425
1419
1426
# Restore files to previous state
1420
- sed -i -- " s/^#define FW_DEV_VERSION FW_VERSION_$DEV_STATUS /#define FW_DEV_VERSION FW_VERSION_UNKNOWN/g" $SCRIPT_PATH /Firmware/Configuration.h
1421
- sed -i -- ' s/^#define FW_REPOSITORY "Prusa3d" /#define FW_REPOSITORY "Unknown"/g' $SCRIPT_PATH /Firmware/Configuration.h
1427
+ sed -i -- " s/^#define FW_DEV_VERSION FW_VERSION_.* /#define FW_DEV_VERSION FW_VERSION_UNKNOWN/g" $SCRIPT_PATH /Firmware/Configuration.h
1428
+ sed -i -- ' s/^#define FW_REPOSITORY.* /#define FW_REPOSITORY "Unknown"/g' $SCRIPT_PATH /Firmware/Configuration.h
1422
1429
if [ ! -z " $BUILD_ORG " ] ; then
1423
1430
sed -i -- " s/^#define FW_COMMIT_NR.*/#define FW_COMMIT_NR $BUILD_ORG /g" $SCRIPT_PATH /Firmware/Configuration.h
1424
1431
fi
@@ -1442,11 +1449,11 @@ cleanup_firmware()
1442
1449
fi
1443
1450
1444
1451
# Restore build env files to previous state
1445
- if [ $BOARD_MEM_MODIFIED == " 1" ]; then
1452
+ if [ " $BOARD_MEM_MODIFIED " == " 1" ]; then
1446
1453
sed -i -- " s/^#define FLASHEND .*$/#define FLASHEND 0x3FFFF/g" $BUILD_ENV_PATH /hardware/tools/avr/avr/include/avr/iom2560.h
1447
1454
echo " $( tput setaf 2) Restored Board Mem$( tput sgr 0) "
1448
1455
fi
1449
- if [ $BOARD_FLASH_MODIFIED == " 1" ]; then
1456
+ if [ " $BOARD_FLASH_MODIFIED " == " 1" ]; then
1450
1457
sed -i -- " s/^prusa_einsy_rambo.upload.maximum_size.*/prusa_einsy_rambo.upload.maximum_size=253952/g" $BUILD_ENV_PATH /portable/packages/$BOARD_PACKAGE_NAME /hardware/avr/$BOARD_VERSION /boards.txt
1451
1458
sed -i -- " s/^#define RAMEND.*/#define RAMEND 0x21FF/g" $BUILD_ENV_PATH /hardware/tools/avr/avr/include/avr/iom2560.h
1452
1459
echo " $( tput setaf 2) Restored Board Flash$( tput sgr 0) "
0 commit comments