#!/bin/bash

WORK_PATH=$(dirname "$0")
CURR_PATH=$(pwd)
cd "$WORK_PATH"

echo ""
echo "      Uart Download"
echo ""
read -p "please input the serial port (e.g. /dev/ttyUSB0): " input
echo "$input"

sftool -p "$input" -c SF32LB56 -m nor write_flash "lcpu\lcpu.hex\ER_IROM2.hex" "bootloader\bootloader.bin@0x1C020000" "main.bin@0x14000000" "ftab\ftab.bin@0x1C000000"

