#!/bin/bash
echo "Programming FPGA...."
killall b110_main
killall remote
mv /home/root/fpga/B110_top.bit /home/root/fpga/B110_top_tmp.bit
cp /home/root/fpga/B110_top_prog.bit /home/root/fpga/B110_top.bit
cp /home/root/fpga_load /var/tmp
cd /var/tmp
chmod +x fpga_load
sync
./fpga_load
echo "Programming M30...."
cd /home/root/02_M30/02_tools
chmod +x *
./flash_write_all.sh
cp /home/root/fpga/B110_top_tmp.bit /home/root/fpga/B110_top.bit
cd /var/tmp
sync
#./fpga_load
#cp /home/root/b110_main /var/tmp
#cd /var/tmp
#chmod +x b110_main
#./b110_main
