scripts: Support SDIO in flash-sdcard using split verification step

Signed-off-by: Donna Whisnant <dewhisna@dewtronics.com>
This commit is contained in:
Donna Whisnant
2022-08-22 10:23:49 -05:00
committed by KevinOConnor
parent f4440267e6
commit a0457f79e4
2 changed files with 48 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ KLIPPER_BIN_DEFAULT=$KLIPPER_BIN
KLIPPER_DICT_DEFAULT="${SRCDIR}/out/klipper.dict"
SPI_FLASH="${SRCDIR}/scripts/spi_flash/spi_flash.py"
BAUD_ARG=""
CHECK_ARG=""
# Force script to exit if an error occurs
set -e
@@ -17,7 +18,7 @@ print_help_message()
{
echo "SD Card upload utility for Klipper"
echo
echo "usage: flash_sdcard.sh [-h] [-l] [-b <baud>] [-f <firmware>] [-d <dictionary>]"
echo "usage: flash_sdcard.sh [-h] [-l] [-c] [-b <baud>] [-f <firmware>] [-d <dictionary>]"
echo " <device> <board>"
echo
echo "positional arguments:"
@@ -27,13 +28,14 @@ print_help_message()
echo "optional arguments:"
echo " -h show this message"
echo " -l list available boards"
echo " -c run flash check/verify only (skip upload)"
echo " -b <baud> serial baud rate (default is 250000)"
echo " -f <firmware> path to klipper.bin"
echo " -d <dictionary> path to klipper.dict for firmware validation"
}
# Parse command line "optional args"
while getopts "hlb:f:d:" arg; do
while getopts "hlcb:f:d:" arg; do
case $arg in
h)
print_help_message
@@ -43,6 +45,7 @@ while getopts "hlb:f:d:" arg; do
${KLIPPY_ENV} ${SPI_FLASH} -l
exit 0
;;
c) CHECK_ARG="-c";;
b) BAUD_ARG="-b ${OPTARG}";;
f) KLIPPER_BIN=$OPTARG;;
d) KLIPPER_DICT=$OPTARG;;
@@ -82,4 +85,4 @@ fi
# Run Script
echo "Flashing ${KLIPPER_BIN} to ${DEVICE}"
${KLIPPY_ENV} ${SPI_FLASH} ${BAUD_ARG} ${KLIPPER_DICT} ${DEVICE} ${BOARD} ${KLIPPER_BIN}
${KLIPPY_ENV} ${SPI_FLASH} ${CHECK_ARG} ${BAUD_ARG} ${KLIPPER_DICT} ${DEVICE} ${BOARD} ${KLIPPER_BIN}