parent
98b19db1cb
commit
df395d3e07
@ -1,19 +1,64 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#BSL_TO_USE="nucleo_f042k6"
|
|
||||||
BSL_TO_USE=$1
|
BSL_TO_USE=$1
|
||||||
|
BSL_LIST=$(ls -d -- ./bsl)
|
||||||
FILE=build/
|
FILE=build/
|
||||||
|
|
||||||
if [ -d "$FILE" ];then
|
|
||||||
rm -r build
|
if [ -z "$BSL_TO_USE" ];then
|
||||||
#echo Cmake build directory exists
|
echo "Please enter a BSL"
|
||||||
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
|
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
|
else
|
||||||
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd $FILE
|
if [ -d "$FILE" ];then
|
||||||
make -j4
|
rm -r build
|
||||||
st-flash write refOvenTest.bin 0x08000000
|
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
|
||||||
cd ..
|
else
|
||||||
|
cmake -S . -B build/ -DBSL_USED=$BSL_TO_USE
|
||||||
|
fi
|
||||||
|
|
||||||
|
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…
Reference in new issue