Automation under way and ./run.sh is imore intelligent

interrupts
key 4 years ago
parent 98b19db1cb
commit df395d3e07

@ -1,19 +1,64 @@
#!/bin/bash
#BSL_TO_USE="nucleo_f042k6"
BSL_TO_USE=$1
BSL_LIST=$(ls -d -- ./bsl)
FILE=build/
if [ -d "$FILE" ];then
rm -r build
#echo Cmake build directory exists
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
else
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
fi
if [ -z "$BSL_TO_USE" ];then
echo "Please enter a BSL"
cd bsl
echo Curretnly awailable BSL are :
for d in */ ; do #Cheking the directroy to print files
if [ "$d" != "csl/" ];then #Exept csl/
echo -e "\t|--> $d" | grep -oP '.*?(?=\/)' #And remove the finel "/"
fi
done
else
if [ -d "$FILE" ];then
rm -r build
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
else
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
fi
cd $FILE
make -j4
st-flash write refOvenTest.bin 0x08000000
cd ..
cd $FILE
make -j4
if [ "$BSL_TO_USE" == "raspberry" ];then
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tExecuting $BSL_TO_USE"
echo "+--------------------------------------+"
echo -e "\e[32m"
./$BSL_TO_USE
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tExecution Terminated"
echo "+--------------------------------------+"
echo -e "\e[32m"
fi
if [ "$BSL_TO_USE" == "nucleo_f042k6" ];then
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tFlashing $BSL_TO_USE"
echo "+--------------------------------------+"
echo -e "\e[32m"
st-flash write $BSL_TO_USE.bin 0x08000000
echo -e "\e[36m"
echo "+--------------------------------------+"
echo -e "\tFlashing has Finished"
echo "+--------------------------------------+"
echo -e "\e[32m"
fi
cd ..
fi

Loading…
Cancel
Save