Commit f9296af7 authored by David Mondou's avatar David Mondou

Initial commit

parents
https://community.nxp.com/thread/441563
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libsgutils2-dev
#!/bin/bash
# p1.- imx_loader and utp_com path
# p2.- Flashing script with the UTP commands
RED='\e[1;37;41m'
GREEN='\e[1;37;42m'
YELLOW='\e[1;33m'
NC='\e[0m'
WORKING_DIR=`pwd`
IMX_USB_LOADER_NAME=imx_usb
UTP_COM_NAME=utp_com
# Search for the paths where imx USB loader and UTP com apps are located
IMX_USB_PATH=bin
UTP_COM_PATH=bin
#boardtype image
if [ $# -ne 2 ]; then
echo usage
exit 1
else
BOARD_TYPE=$1
IMAGE=$2
fi
case $BOARD_TYPE in
100)
echo 100
MFG_DTB=vesta-100-mfg
;;
200)
echo 200
MFG_DTB=vesta-200-mfg
;;
300)
echo 300
MFG_DTB=vesta-300-mfg
;;
*)
echo error
esac
case $IMAGE in
developer)
IMAGE_FILE=vesta-image-developer-vesta-${BOARD_TYPE}
;;
minimal)
IMAGE_FILE=vesta-image-minimal-vesta-${BOARD_TYPE}
;;
test)
IMAGE_FILE=vesta-image-test-vesta-${BOARD_TYPE}
;;
*)
echo Invalid image
esac
# Establish the location of the files that will be flashed to the board
FLASH_IMAGE_DIR=$WORKING_DIR/files
if [ ! -x $IMX_USB_PATH/$IMX_USB_LOADER_NAME ]
then
echo -e "${RED}-imx_usb_loader- application not found!${NC}"
echo -e "${YELLOW}Make sure that the <imx_usb_loader/imx_usb> app exists in the specified path${NC}"
exit 1 # fail
fi
if [ ! -x $UTP_COM_PATH/$UTP_COM_NAME ]
then
echo -e "${RED}-utp_com- application not found!${NC}"
echo -e "${YELLOW}Make sure that the <utp_com/utp_com> app exists in the specified path${NC}"
exit 1 # fail
fi
APP_FLASHING_SCRIPT=scripts/vesta-${BOARD_TYPE}-flash-commands.sh
#sed usb_work here
sed -i '/load 0x83000000/c../firmware/'$MFG_DTB'.dtb: load 0x83000000' conf/vesta_usb_work.conf
# Go to the imx_usb_loader folder
cd $IMX_USB_PATH
# Here we get a copy of the /dev folder looking for "sg" devices (SCSI devices)
ls /dev/sg* | grep "sg" > dev-temp1.txt
if `echo "$IMX_USB_PRINT" | grep -q "Could not open device"`; then
echo -e "${RED}imx_usb returned error: Could not open device${NC}"
echo -e "${YELLOW}Try disconnecting and reconnecting the device and run this script again${NC}"
exit 1
fi
if `echo "$IMX_USB_PRINT" | grep -q "no matching USB device found"`; then
echo -e "${RED}imx_usb returned error: No matching USB device found${NC}"
echo -e "${YELLOW}Please make sure the board is connected to the USB port and the jumper is set to 'serial downloader mode'${NC}"
exit 1
fi
if `echo "$IMX_USB_PRINT" | grep -q "err=-"`; then
echo -e "${RED}imx_usb returned error:${NC}"
echo $IMX_USB_PRINT
exit 1
fi
# Execute imx_usb_loader to load into the board RAM the flashing OS
./imx_usb -c ../conf
echo "Getting the SG devices to obtain the SG device name of the board in UTP mode"
sleep 16
ls /dev/sg* | grep "sg" > dev-temp2.txt
# Get the SG device corresponding to the board by comparing the contents of /dev before
# and after our board is enumerated as a SCSI device.
DEVICE=`diff dev-temp1.txt dev-temp2.txt | grep '/dev/sg' | cut -c 3-`
# Delete the temporary files used
rm dev-temp1.txt dev-temp2.txt
# Return to the project folder and call the script with the UTP commands
cd $WORKING_DIR
#pass in image type ad flashing script
./$APP_FLASHING_SCRIPT $UTP_COM_PATH $DEVICE $WORKING_DIR $FLASH_IMAGE_DIR $IMAGE_FILE
#vid:pid, config_file
0x15a2:0x007d, vesta_usb_work.conf
imx6-sabresd
#hid/bulk,[old_header,]max packet size, {ram start, ram size}(repeat valid ram areas)
hid,1024,0x910000,0x10000000,1G,0x00900000,0x40000
# Note; only dcd as first step (setup ram)
../firmware/u-boot-vesta-mfg-v2.imx:dcd
# Then load a kernel with initramfs (self contained linux) at known address
../firmware/zImage:load 0x80800000
../firmware/fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot: load 0x83800000
../firmware/vesta-100-mfg.dtb: load 0x83000000
# Now, we load a u-boot that expects preloaded software at known adress
# Note, to make this boot, the clear_dcd field seems necessary
../firmware/u-boot-vesta-mfg-v2.imx:clear_dcd,load,plug,jump header
0 /*dqs_loopback=0 or 1*/
0 /*hold_delay=0 to 3*/
0 /*hsphs=0 (Half Speed Phase sampling at non-inverted clock) or 1 (sampling at inverted clock)*/
0 /*hsdly=0 (Half Speed Delay one clk delay) or 1 (two clk cycle delay)*/
0 /*device_quad_mode_en=1 to enable sending command to SPI device*/
0 /*device_cmd=command to device for enableing Quad I/O mode*/
3000002 /*write_cmd_ipcr=hex value to be written to IPCR register for write cmd of device*/
2000000 /*write_enable_ipcr=hex value to be written to IPCR register for write enable of device*/
3 /*cs_hold_time=0 to 0xF*/
3 /*cs_setup_time=0 to 0xF*/
8000000 /*sflash_A1_size=size in byte(hex)*/
0 /*sflash_A2_size=size in byte(hex)*/
8000000 /*sflash_B1_size=size in byte(hex)*/
0 /*sflash_B2_size=size in byte(hex)*/
1 /*sclk_freq=0 to 6*/
0 /*busy_bit_offset=bit position of device BUSY in device status register*/
1 /*sflash_type=1 (Single), 2 (Dual), 4 (Quad mode of operation)*/
0 /*sflash_port=0 or 1 (Port B used)*/
0 /*ddr_mode_enable=0 or 1*/
0 /*dqs_enable=0 or 1*/
0 /*parallel_mode_enable=0 or 1*/
0 /*portA_cs1=0 or 1*/
0 /*portB_cs1=0 or 1*/
0 /*fsphs=0 (Full Speed Phase sampling at non-inverted clock) or 1 (sampling at inverted clock)*/
0 /*fsdly=0 (Full Speed Delay One clk delay) or 1 (two clk cycle delay)*/
0 /*ddrsmp=0 to 7 (sampling point for incoming data in DDR mode)*/
0818040B /*lut[0] command sequence*/
1C040C08 /*lut[1] command sequence*/
00002400 /*lut[2] command sequence*/
0 /*lut[3] command sequence*/
1c010405 /*lut[4] command sequence*/
2400 /*lut[5] command sequence*/
0 /*lut[6] command sequence*/
0 /*lut[7] command sequence*/
24000406 /*lut[8] command sequence*/
0 /*lut[9] command sequence*/
0 /*lut[10] command sequence*/
0 /*lut[11] command sequence*/
20010401 /*lut[12] command sequence*/
2400 /*lut[13] command sequence*/
0 /*lut[14] command sequence*/
0 /*lut[15] command sequence*/
0 /*lut[16] command sequence*/
0 /*lut[17] command sequence*/
0 /*lut[18] command sequence*/
0 /*lut[19] command sequence*/
0 /*lut[20] command sequence*/
0 /*lut[21] command sequence*/
0 /*lut[22] command sequence*/
0 /*lut[23] command sequence*/
0 /*lut[24] command sequence*/
0 /*lut[25] command sequence*/
0 /*lut[26] command sequence*/
0 /*lut[27] command sequence*/
0 /*lut[28] command sequence*/
0 /*lut[29] command sequence*/
0 /*lut[30] command sequence*/
0 /*lut[31] command sequence*/
0 /*lut[32] command sequence*/
0 /*lut[33] command sequence*/
0 /*lut[34] command sequence*/
0 /*lut[35] command sequence*/
0 /*lut[36] command sequence*/
0 /*lut[37] command sequence*/
0 /*lut[38] command sequence*/
0 /*lut[39] command sequence*/
0 /*lut[40] command sequence*/
0 /*lut[41] command sequence*/
0 /*lut[42] command sequence*/
0 /*lut[43] command sequence*/
0 /*lut[44] command sequence*/
0 /*lut[45] command sequence*/
0 /*lut[46] command sequence*/
0 /*lut[47] command sequence*/
0 /*lut[48] command sequence*/
0 /*lut[49] command sequence*/
0 /*lut[50] command sequence*/
0 /*lut[51] command sequence*/
0 /*lut[52] command sequence*/
0 /*lut[53] command sequence*/
0 /*lut[54] command sequence*/
0 /*lut[55] command sequence*/
0 /*lut[56] command sequence*/
0 /*lut[57] command sequence*/
0 /*lut[58] command sequence*/
0 /*lut[59] command sequence*/
0 /*lut[60] command sequence*/
0 /*lut[61] command sequence*/
0 /*lut[62] command sequence*/
0 /*lut[63] command sequence*/
1000001 /*read_status_ipcr=hex value to be written to IPCR register for reading status reg of device*/
0 /*enable_dqs_phase=0 or 1*/
0 /*config_cmds_en, enable config command*/
0 /*config_cmds[0]*/
0 /*config_cmds[1]*/
0 /*config_cmds[2]*/
0 /*config_cmds[3]*/
0 /*config_cmds_args[0]*/
0 /*config_cmds_args[1]*/
0 /*config_cmds_args[2]*/
0 /*config_cmds_args[3]*/
0 /*io_pad_override_setting QSPI pins override setting*/
0 /*reserve[0], 25 byte reserved area*/
0 /*reserve[1], 25 byte reserved area*/
0 /*reserve[2], 25 byte reserved area*/
0 /*reserve[3], 25 byte reserved area*/
0 /*reserve[4], 25 byte reserved area*/
0 /*reserve[5], 25 byte reserved area*/
0 /*reserve[6], 25 byte reserved area*/
0 /*reserve[7], 25 byte reserved area*/
0 /*reserve[8], 25 byte reserved area*/
0 /*reserve[9], 25 byte reserved area*/
0 /*reserve[10], 25 byte reserved area*/
0 /*reserve[11], 25 byte reserved area*/
0 /*reserve[12], 25 byte reserved area*/
0 /*reserve[13], 25 byte reserved area*/
0 /*reserve[14], 25 byte reserved area*/
0 /*reserve[15], 25 byte reserved area*/
0 /*reserve[16], 25 byte reserved area*/
0 /*reserve[17], 25 byte reserved area*/
0 /*reserve[18], 25 byte reserved area*/
0 /*reserve[19], 25 byte reserved area*/
0 /*reserve[20], 25 byte reserved area*/
0 /*reserve[21], 25 byte reserved area*/
0 /*reserve[22], 25 byte reserved area*/
0 /*reserve[23], 25 byte reserved area*/
0 /*reserve[24], 25 byte reserved area*/
c0ffee01 /*tag, QSPI configuration tag, should be 0xc0ffee01*/
File added
#!/bin/bash
RED='\e[1;37;41m'
GREEN='\e[1;37;42m'
YELLOW='\e[1;33m'
NC='\e[0m'
UTP_COM_PATH=$1
DEVICE=$2
WORKING_DIR=$3
IMAGE_FILE=$5
do_command () {
echo -e "${YELLOW}-> $2${NC}"
./utp_com -d $DEVICE -c "$1"
if [ "$?" -ne "0" ]; then
error "${2}"
fi
}
do_send_command () {
echo -e "${YELLOW}-> $2${NC}"
./utp_com -d $DEVICE -c $1
if [ "$?" -ne "0" ]; then
error "${2}"
fi
}
do_command2 () {
echo -e "${YELLOW}-> $3${NC}"
./utp_com -d $DEVICE -c "$1" $2
if [ "$?" -ne "0" ]; then
error "${3}"
fi
}
error () {
echo " "
echo -e "${RED}ERROR -> $1 <- ${NC}"
echo " "
exit 1
}
# Use the UTP_COM utility to flash the application images
cd $UTP_COM_PATH
# Create Partitions
do_send_command "send -f ${WORKING_DIR}/firmware/mksdcard.sh.tar" "Sending partitioning shell script"
do_command "$ tar xf \$FILE" "Decompresing script..."
do_command "$ sh mksdcard.sh /dev/mmcblk1" "Partitioning eMMC"
#Install U-boot
do_command "$ echo 0 > /sys/block/mmcblk1boot0/force_ro" "Disable ro mmc"
do_send_command "send -f ${WORKING_DIR}/files/u-boot-vesta-100.imx" "Sending U-boot"
do_command "$ dd if=\$FILE of=/dev/mmcblk1boot0 bs=512 seek=2" "Write U-boot"
do_command "$ dd if=/dev/zero of=/dev/mmcblk1boot0 bs=1k seek=384 conv=fsync count=129" "Clear U-boot args"
do_command "$ dd if=/dev/zero of=/dev/mmcblk1boot0 seek=2046 conv=fsync count=2" "Clear boot flags"
do_command "$ echo 1 > /sys/block/mmcblk1boot0/force_ro" "Enable ro mmc"
do_command "$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo \"waiting...\"; done " "Wait for mmcblkp1"
#Format emmc partitions
do_command "$ mkfs.ext2 /dev/mmcblk1p1" "Formatting mmcblk1p1"
do_command "$ mkfs.vfat /dev/mmcblk1p2" "Formatting mmcblk1p2"
do_command "$ mkfs.vfat /dev/mmcblk1p3" "Formatting mmcblk1p3"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p5" "Formatting mmcblk1p5"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p6" "Formatting mmcblk1p6"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p7" "Formatting mmcblk1p7"
#Install Kernel and dtb
do_command "$ mkdir -p /mnt/mmcblk1p2" "Create directory"
do_command "$ mount -t vfat /dev/mmcblk1p2 /mnt/mmcblk1p2" "Mount mmcblk1p2"
do_send_command "send -f ${WORKING_DIR}/files/zImage" "Sending zImage"
do_command "$ cp \$FILE /mnt/mmcblk1p2/zImage" "Writing zImage"
do_send_command "send -f ${WORKING_DIR}/files/zImage-vesta-100.dtb" "Sending dtb"
do_command "$ cp \$FILE /mnt/mmcblk1p2/zImage-vesta-100.dtb" "Writing dtb"
do_command "$ umount /mnt/mmcblk1p2" "unmount mmcblk1p2"
#Install rootfs
do_command "$ mkdir -p /mnt/mmcblk1p5" "Create directory"
do_command "$ mount -t ext3 /dev/mmcblk1p5 /mnt/mmcblk1p5" "Mount mmcblk1p5"
do_command2 "pipe tar -jxv -C /mnt/mmcblk1p5" "-f ${WORKING_DIR}/files/${IMAGE_FILE}.tar.bz2" "Installing ${IMAGE_FILE}"
do_command "frf" "Writing rootfs"
do_command "$ umount /mnt/mmcblk1p5" "unmount mmcblk1p5"
# Done
echo " "
echo -e "${GREEN} ${NC}"
echo -e "${GREEN} -> Board Setup Complete <- ${NC}"
echo -e "${GREEN} ${NC}"
echo " "
#!/bin/bash
RED='\e[1;37;41m'
GREEN='\e[1;37;42m'
YELLOW='\e[1;33m'
NC='\e[0m'
UTP_COM_PATH=$1
DEVICE=$2
WORKING_DIR=$3
IMAGE_FILE=$5
do_command () {
echo -e "${YELLOW}-> $2${NC}"
./utp_com -d $DEVICE -c "$1"
if [ "$?" -ne "0" ]; then
error "${2}"
fi
}
do_send_command () {
echo -e "${YELLOW}-> $2${NC}"
./utp_com -d $DEVICE -c $1
if [ "$?" -ne "0" ]; then
error "${2}"
fi
}
do_command2 () {
echo -e "${YELLOW}-> $3${NC}"
./utp_com -d $DEVICE -c "$1" $2
if [ "$?" -ne "0" ]; then
error "${3}"
fi
}
error () {
echo " "
echo -e "${RED}ERROR -> $1 <- ${NC}"
echo " "
exit 1
}
# Use the UTP_COM utility to flash the application images
cd $UTP_COM_PATH
# Create Partitions
do_send_command "send -f ${WORKING_DIR}/firmware/mksdcard.sh.tar" "Sending partitioning shell script"
do_command "$ tar xf \$FILE" "Decompresing script..."
do_command "$ sh mksdcard.sh /dev/mmcblk1" "Partitioning eMMC"
#Install U-boot
do_command "$ echo 0 > /sys/block/mmcblk1boot0/force_ro" "Disable ro mmc"
do_send_command "send -f ${WORKING_DIR}/files/u-boot-vesta-200.imx" "Sending U-boot"
do_command "$ dd if=\$FILE of=/dev/mmcblk1boot0 bs=512 seek=2" "Write U-boot"
do_command "$ dd if=/dev/zero of=/dev/mmcblk1boot0 bs=1k seek=384 conv=fsync count=129" "Clear U-boot args"
do_command "$ dd if=/dev/zero of=/dev/mmcblk1boot0 seek=2046 conv=fsync count=2" "Clear boot flags"
do_command "$ echo 1 > /sys/block/mmcblk1boot0/force_ro" "Enable ro mmc"
do_command "$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo \"waiting...\"; done " "Wait for mmcblkp1"
#Format emmc partitions
do_command "$ mkfs.ext2 /dev/mmcblk1p1" "Formatting mmcblk1p1"
do_command "$ mkfs.vfat /dev/mmcblk1p2" "Formatting mmcblk1p2"
do_command "$ mkfs.vfat /dev/mmcblk1p3" "Formatting mmcblk1p3"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p5" "Formatting mmcblk1p5"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p6" "Formatting mmcblk1p6"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p7" "Formatting mmcblk1p7"
#Install Kernel and dtb
do_command "$ mkdir -p /mnt/mmcblk1p2" "Create directory"
do_command "$ mount -t vfat /dev/mmcblk1p2 /mnt/mmcblk1p2" "Mount mmcblk1p2"
do_send_command "send -f ${WORKING_DIR}/files/zImage" "Sending zImage"
do_command "$ cp \$FILE /mnt/mmcblk1p2/zImage" "Writing zImage"
do_send_command "send -f ${WORKING_DIR}/files/zImage-vesta-200.dtb" "Sending dtb"
do_command "$ cp \$FILE /mnt/mmcblk1p2/zImage-vesta-200.dtb" "Writing dtb"
do_command "$ umount /mnt/mmcblk1p2" "unmount mmcblk1p2"
#Install rootfs
do_command "$ mkdir -p /mnt/mmcblk1p5" "Create directory"
do_command "$ mount -t ext3 /dev/mmcblk1p5 /mnt/mmcblk1p5" "Mount mmcblk1p5"
do_command2 "pipe tar -jxv -C /mnt/mmcblk1p5" "-f ${WORKING_DIR}/files/${IMAGE_FILE}.tar.bz2" "Installing ${IMAGE_FILE}"
do_command "frf" "Writing rootfs"
do_command "$ umount /mnt/mmcblk1p5" "unmount mmcblk1p5"
# Done
echo " "
echo -e "${GREEN} ${NC}"
echo -e "${GREEN} -> Board Setup Complete <- ${NC}"
echo -e "${GREEN} ${NC}"
echo " "
#!/bin/bash
RED='\e[1;37;41m'
GREEN='\e[1;37;42m'
YELLOW='\e[1;33m'
NC='\e[0m'
UTP_COM_PATH=$1
DEVICE=$2
WORKING_DIR=$3
IMAGE_FILE=$5
do_command () {
echo -e "${YELLOW}-> $2${NC}"
./utp_com -d $DEVICE -c "$1"
if [ "$?" -ne "0" ]; then
error "${2}"
fi
}
do_send_command () {
echo -e "${YELLOW}-> $2${NC}"
./utp_com -d $DEVICE -c $1
if [ "$?" -ne "0" ]; then
error "${2}"
fi
}
do_command2 () {
echo -e "${YELLOW}-> $3${NC}"
./utp_com -d $DEVICE -c "$1" $2
if [ "$?" -ne "0" ]; then
error "${3}"
fi
}
error () {
echo " "
echo -e "${RED}ERROR -> $1 <- ${NC}"
echo " "
exit 1
}
# Use the UTP_COM utility to flash the application images
cd $UTP_COM_PATH
# Create Partitions
do_send_command "send -f ${WORKING_DIR}/firmware/mksdcard.sh.tar" "Sending partitioning shell script"
do_command "$ tar xf \$FILE" "Decompresing script..."
do_command "$ sh mksdcard.sh /dev/mmcblk1" "Partitioning eMMC"
#Install U-boot
do_command "$ flash_erase /dev/mtd0 0 0" "Erasing NOR flash mtd0"
do_send_command "send -f ${WORKING_DIR}/files/u-boot-vesta-300.imx" "Sending U-boot"
do_command "$ dd if=\$FILE of=/dev/mtd0 bs=1k seek=4" "Writing U-boot"
#Setup emmc
do_command "$ echo 0 > /sys/block/mmcblk1boot0/force_ro" "Disable ro mmc"
do_command "$ dd if=/dev/zero of=/dev/mmcblk1boot0 seek=2046 conv=fsync count=2" "Zero out mmc boot0"
do_command "$ echo 1 > /sys/block/mmcblk1boot0/force_ro" "Enable ro mmc"
do_command "$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo \"waiting...\"; done " "Wait for mmcblkp1"
#Format emmc partitions
do_command "$ mkfs.ext2 /dev/mmcblk1p1" "Formatting mmcblk1p1"
do_command "$ mkfs.vfat /dev/mmcblk1p2" "Formatting mmcblk1p2"
do_command "$ mkfs.vfat /dev/mmcblk1p3" "Formatting mmcblk1p3"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p5" "Formatting mmcblk1p5"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p6" "Formatting mmcblk1p6"
do_command "$ mkfs.ext3 -E nodiscard /dev/mmcblk1p7" "Formatting mmcblk1p7"
#Install Kernel and dtb
do_command "$ mkdir -p /mnt/mmcblk1p2" "Create directory"
do_command "$ mount -t vfat /dev/mmcblk1p2 /mnt/mmcblk1p2" "Mount mmcblk1p2"
do_send_command "send -f ${WORKING_DIR}/files/zImage" "Sending zImage"
do_command "$ cp \$FILE /mnt/mmcblk1p2/zImage" "Writing zImage"
do_send_command "send -f ${WORKING_DIR}/files/zImage-vesta-300.dtb" "Sending dtb"
do_command "$ cp \$FILE /mnt/mmcblk1p2/zImage-vesta-300.dtb" "Writing dtb"
do_command "$ umount /mnt/mmcblk1p2" "unmount mmcblk1p2"
#Install rootfs
do_command "$ mkdir -p /mnt/mmcblk1p5" "Create directory"
do_command "$ mount -t ext3 /dev/mmcblk1p5 /mnt/mmcblk1p5" "Mount mmcblk1p5"
do_command2 "pipe tar -jxv -C /mnt/mmcblk1p5" "-f ${WORKING_DIR}/files/${IMAGE_FILE}.tar.bz2" "Installing ${IMAGE_FILE}"
do_command "frf" "Writing rootfs"
do_command "$ umount /mnt/mmcblk1p5" "unmount mmcblk1p5"
#Install qspi header
do_send_command "send -f ${WORKING_DIR}/firmware/"qspi-header.sh.tar"" "Sending qspi-header.sh.tar"
do_command "$ tar xf \$FILE " "Extracting qspi-header.sh.tar"
do_send_command "send -f ${WORKING_DIR}/firmware/qspi-nor-rigado-config" "Sending qspi-nor-rigado-config"
do_command "$ sh qspi-header.sh \$FILE" "Executing qspi-header.sh"
do_command "$ busybox hexdump -R qspi-tmp > qspi-header" "Executing hexdump"
do_command "$ dd if=qspi-header of=/dev/mtd0 bs=1k seek=1" "Writing qspi-header"
do_command "$ rm qspi-tmp" "Removing qspi-tmp"
do_command "$ rm qspi-header" "Removing qspi-header"
# Done
echo " "
echo -e "${GREEN} ${NC}"
echo -e "${GREEN} -> Board Setup Complete <- ${NC}"
echo -e "${GREEN} ${NC}"
echo " "
#!/bin/bash
RED='\e[1;37;41m'
GREEN='\e[1;37;42m'
YELLOW='\e[1;33m'