Tsimx6 usb production: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
Line 7: Line 7:
sudo mkdir /mnt/sd/
sudo mkdir /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo tar xf /path/to/tsimx6_usb_blaster-latest.tar.bz2 -C /mnt/sd/
sudo tar --numeric-owner -xf /path/to/tsimx6_usb_blaster-latest.tar.bz2 -C /mnt/sd/


# Now you would create your images on the /mnt/sd/, but for
# Now you would create your images on the /mnt/sd/, but for

Revision as of 10:35, 27 September 2017

The USB blasting image can be downloaded here. This includes a basic linux kernel, and a small initramfs that will mount the usb drive at /mnt/usb/, and execute /mnt/usb/blast.sh.

The blast image/scripts requires 20MB, and the thumbdrive needs to just be sized to your disk image. The thumbdrive can use vfat or fat32. To create this on your workstation:

# This assumes your thumbdrive is /dev/sdc:
sudo mkfs.ext3 /dev/sdc1
sudo mkdir /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo tar --numeric-owner -xf /path/to/tsimx6_usb_blaster-latest.tar.bz2 -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.bz2 http://ftp.embeddedarm.com/ftp/ts-socket-macrocontrollers/ts-4900-linux/distributions/debian/debian-armhf-jessie-latest.tar.bz2
# You can use a symlink to write the same image to sd
sudo ln -s /mnt/sd/emmcimage.tar.bz2 /mnt/sd/sdimage.tar.bz2
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 which by default includes code to reprogram the board. When it is finished it will blink green or red to indicate pass or fail. This script can be used without modification to write images from USB with these filenames:

SD Card sdimage.tar.bz2 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.bz2 Disk image of the card. This will be written to mmcblk0 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.bz2 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.bz2 Disk image of the card. This will be written to mmcblk1 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 [1] sataimage.tar.bz2 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.bz2 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.
SPI u-boot.imx This will rewrite u-boot on the SPI flash. This will also verify the imx_type variables match before allowing it to be rewritten to make sure the RAM configs match. If u-boot.imx.md5 is present the SPI flash will be read back and verified.
  1. SATA is only present on the Dual/Quad CPUs

Most users should be able to use the above script without modification, but our buildroot sources are included here. The .config in this directory includes our config already. Format the USB drive to have one ext2/3/4 or fat32 partition and then run:

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