A83x usb production

From Technologic Systems Manuals

Download the latest USB production image here.

The blast image and scripts require a minimum of 50 MB; this plus any disk images or tarballs used dictate the minimum disk size required. The USB drive must have at least 1 partition, with the first partition being formatted ext2/3/4 or fat32/vfat.

# This assumes your thumbdrive is /dev/sdc:
sudo mkfs.ext4 /dev/sdc1
sudo mkdir /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo tar --numeric-owner -xJf /path/to/tsa38x_usb_blaster-latest.tar.xz -C /mnt/sd/

# Now you would create your images on the /mnt/sd/, but for
# an example these steps would write our latest debian image:
sudo wget -O /mnt/sd/emmcimage.tar.xz http://ftp.embeddedarm.com/ftp/ts-arm-sbc/ts-7800-v2-linux/distributions/ts7800v2-deb_stretch-latest.tar.xz
# You can use a symlink to write the same image to sd
sudo ln -s /mnt/sd/emmcimage.tar.xz /mnt/sd/sdimage.tar.xz
sudo umount /mnt/sd
sync

The USB drive boots into a small buildroot initramfs environment with filesystem and partitioning tools. This can be used to format SD, eMMC, SATA, or even rewrite u-boot and its environment. The buildroot starts up and calls /blast.sh on the USB device. By default this script is set up to look for a number of of specific files on the USB disk and write to media on the host device. The blast.sh script will turn on both LEDs when it is run. Upon completion of the script the green led will blink for pass, or the red led will blink for failure. This script can be used without modification to write images from USB with these filenames:

SD Card sdimage.tar.xz Tar of the filesystem. This will repartition the SD card to 1 ext4 partition and extract this tar to the filesystem. If present, a /md5sums.txt will be checked and every file can be verified on the filesystem. This md5sums file is optional and can be omitted, but it must not be blank if present.
sdimage.dd.xz Disk image of the card. This will be written to tssdcarda directly. If present a sdimage.dd.md5 will cause the written data on the SD card to be read back and verified against this checksum.
eMMC emmcimage.tar.xz Tar of the filesystem. This will repartition the eMMC to 1 ext4 partition and extract this tar to the filesystem. If present, a /md5sums.txt will be checked and every file can be verified on the filesystem. This md5sums file is optional and can be omitted, but it must not be blank if present.
emmcimage.dd.xz Disk image of the card. This will be written to mmcblk0 directly. If present a emmcimage.dd.md5 will cause the written data on the eMMC to be read back and verified against this checksum.
SATA sataimage.tar.xz Tar of the filesystem. This will repartition the SATA drive to 1 ext4 partition and extract this tar to the filesystem. If present, a /md5sums.txt will be checked and every file can be verified on the filesystem. This md5sums file is optional and can be omitted, but it must not be blank if present.
sataimage.dd.xz Disk image of the card. This will be written to sda directly. If present a sataimage.dd.md5 will cause the written data on the SATA to be read back and verified against this checksum.
eMMC bootloader u-boot.kwb This will rewrite u-boot on the mmcblk0boot0 partition
FPGA ts7800-fpga-<rev>.rpd If this file is present, and <rev> is later than what is programmed on the board, this will update the FPGA. This update will run first, and will reboot if an update is needed. Users should only copy files here as recommended by Technologic Systems support. Updating the FPGA using any other file may require an RMA to repair the board.


Most users should be able to use the above script without modification, but our buildroot sources are available from our github repo. To build the whole setup and create a USB drive, the following commands can be used. This will wipe any data on the specified partition and replace it with an ext4 formatted filesystem. This filesystem will have all of the necessary files written to it to create a bootable USB drive. Note that this must be the first partition of the disk.

# Assuming /dev/sdc1 is your usb drive's first partition
make tsa38x_defconfig && make && sudo ./make_usb_prog.sh /dev/sdc1

Our shipping images include a /md5sums.txt file in the root, but after the system has been booted there will be some file modification so this is no longer valid. This should be removed from your image, or updated to match your filesystem. To add this to your custom tar.xz:

mkdir tmp/
tar -xf yourimage.tar.xz -C tmp/
cd tmp/
find . -type f -print0 | xargs -0 md5sum >> ../md5sums.txt
mv ../md5sums.txt .
tar --numeric-owner -cJf ../yourimage-withmd5sums.tar.xz .
cd ../
# now use yourimage-withmd5sums.tar.xz with the usb production tool