You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KED/run.sh

65 lines
1.4 KiB

#!/bin/bash
BSL_TO_USE=$1
BSL_LIST=$(ls -d -- ./bsl)
FILE=build/
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
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