#!/bin/bash

firmware=$1
filesize=$2
uartUltimo=$3

#before firmware update, this command parameters the xmodem message
printf "xmodem ${filesize} uarta 115200 1 1\r\n" > "$uartUltimo" 

#send the firmware in appropriate uart to chip
sx "$firmware" < "$uartUltimo" > "$uartUltimo"

