Tsimx6 usb production: Difference between revisions

From embeddedTS Manuals
No edit summary
m (Non-link text auto-updated for 2022 re-branding ( http://ftp.embeddedarm.com/ftp/ts-socket-macrocontrollers/ts-4900-linux/distributions/debian/debian-armhf-jessie-latest.tar.bz2 →‎ http://ftp.embeddedTS.com/ftp/ts-socket-macrocontrollers/ts-4900-linux/distributions/debian/debian-armhf-jessie-latest.tar.bz2))
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The USB blasting image can be downloaded [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/usb-blaster/tsimx6_usb_blaster-latest.tar.bz2 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.
Download the latest USB production image [https://files.embeddedTS.com/ts-socket-macrocontrollers/ts-4900-linux/usb-blaster/tsimx6_usb_blaster-latest.tar.bz2 here]. This is a tarball that contains a rootfs based on Buildroot. It contains the kernel and filesystem, as well as a basic script to tell U-Boot to boot to Linux on the USB drive.


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 image will be written to a USB drive. Most USB drives enumerate in under a second and will work, but some USB mass storage devices like external spinning hard drives typically have long initialization around 10-15 seconds.  These will not enumerate in time to work from U-Boot.
 
The blast image and scripts require a minimum of 50 MB. When sizing the USB drive to use, this must be taken in to account along with any images or tarballs that will reside on the USB drive as a part of the production process. The USB drive must have at least 1 partition, with the first partition being formatted ext2/3 or fat32/vfat.
{{Note| The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used with ext4 for proper compatibility. Older versions of e2fsprogs do not need these options passed nor are they needed for ext3.}}
<source lang=bash>
<source lang=bash>
# This assumes your thumbdrive is /dev/sdc:
# This assumes the USB is /dev/sdc:
sudo mkfs.ext3 /dev/sdc1
sudo mkfs.ext3 /dev/sdc1
sudo mkdir /mnt/sd/
sudo mkdir /mnt/sd/
Line 9: Line 12:
sudo tar --numeric-owner -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
# Normally, customized images would be copied to the /mnt/sd/, but for
# an example these steps would write our latest debian image:
# 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
sudo wget -O /mnt/sd/emmcimage.tar.bz2 http://ftp.embeddedTS.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
# A symlink can be used to write the same image to SD
sudo ln -s /mnt/sd/emmcimage.tar.bz2 /mnt/sd/sdimage.tar.bz2
sudo ln -s /mnt/sd/emmcimage.tar.bz2 /mnt/sd/sdimage.tar.bz2
sudo umount /mnt/sd
sudo umount /mnt/sd
Line 18: Line 21:
</source>
</source>


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:
{{Note|This image can be written from a Windows OS, but make sure it is extracted with 7-zip instead of the built in windows zip support or it can break the line formatting of blast.sh}}
 
The USB drive boots into a small Buildroot 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. Upon completion of the script, the green or red LEDs will blink to visually indicate a pass or fail of the script. This script can be used without modification to write images from USB with these filenames:


{| class=wikitable
{| class=wikitable
! rowspan=2 | SD Card  
! rowspan=2 | SD Card  
| sdimage.tar.bz2
| 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.
| Tar of the filesystem.  This will partition the SD card to have a single ext4 partition and extract this tar to the filesystem.  If the file /md5sums.txt is present in the tarball, it will be used via the md5sum command to check and verify every file on the filesystem after extraction is complete.  This /md5sums.txt file is optional and can be omitted, but it must not be blank if present.
|-
|-
| sdimage.dd.bz2
| 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.
| Disk image of the SD card.  This will be written to /dev/mmcblk0 directly.  If the file /sdimage.dd.md5 is present on the USB drive, the image written to disk will be read back and compared to the md5sum contained in the sdimage.dd.md5 file.
|-
|-
! rowspan=2 | eMMC
! rowspan=2 | eMMC
| emmcimage.tar.bz2
| 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.
| Tar of the filesystem.  This will repartition the eMMC to have a single ext4 partition and extract this tar to the filesystem.  If the file /md5sums.txt is present in the tarball, it will be used via the md5sum command to check and verify every file on the filesystem after extraction is complete.  This /md5sums.txt file is optional and can be omitted, but it must not be blank if present.
|-
|-
| emmcimage.dd.bz2
| 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.
| Disk image of the eMMC.  This will be written to /dev/mmcblk1 directly.  If the file /emmcimage.dd.md5 is present on the USB drive, the image written to disk will be read back and compared to the md5sum contained in the emmcimage.dd.md5 file.
|-
|-
! rowspan=2 | SATA <ref>SATA is only present on the Dual/Quad CPUs</ref>
! rowspan=2 | SATA <ref>SATA is only present on the Dual/Quad CPUs</ref>
| sataimage.tar.bz2
| 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.
| Tar of the filesystem.  This will repartition the SATA drive to have a single ext4 partition and extract this tar to the filesystem.  If the file /md5sums.txt is present in the tarball, it will be used via the md5sum command to check and verify every file on the filesystem after extraction is complete.  This /md5sums.txt file is optional and can be omitted, but it must not be blank if present.
|-
|-
| sataimage.dd.bz2
| 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.
| Disk image of the card.  This will be written to /dev/sda directly.  If the file /sataimage.dd.md5 is present on the USB drive, the image written to disk will be read back and compared to the md5sum contained in the sataimage.dd.md5 file.
|-
|-
! SPI
! SPI
| u-boot.imx
| 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.
| This will write U-Boot on the SPI flash.  The imx_type variables will be checked before writing any data to ensure the file being written is compatible with the current CPU. If the file /u-boot.imx.md5 is present on the USB drive, the image written to SPI flash will be read back and compared to the md5sum contained in the u-boot.imx.md5 file.
|}
|}


<References />
<References />


Most users should be able to use the above script without modification, but our buildroot sources are included [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/usb-blaster/tsimx6_usb_blaster-sources-latest.tar.bz2 here].  The .config in this directory includes our config alreadyFormat the USB drive to have one ext2/3/4 or fat32 partition and then run:
Most users should be able to use the above script without modification, but the Buildroot sources used are available from [https://github.com/embeddedTS/buildroot-2017.05 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 ext2 formatted filesystemThis 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.
<source lang=bash>
<source lang=bash>
# Assuming /dev/sdc1 is your usb drive's first partition
# Assuming /dev/sdc1 is the USB drive's first partition
make && sudo make_usb_prog.sh /dev/sdc1
make ts4900_defconfig && make && sudo ./make_usb_prog.sh /dev/sdc1
</source>
</source>

Latest revision as of 14:38, 18 January 2022

Download the latest USB production image here. This is a tarball that contains a rootfs based on Buildroot. It contains the kernel and filesystem, as well as a basic script to tell U-Boot to boot to Linux on the USB drive.

This image will be written to a USB drive. Most USB drives enumerate in under a second and will work, but some USB mass storage devices like external spinning hard drives typically have long initialization around 10-15 seconds. These will not enumerate in time to work from U-Boot.

The blast image and scripts require a minimum of 50 MB. When sizing the USB drive to use, this must be taken in to account along with any images or tarballs that will reside on the USB drive as a part of the production process. The USB drive must have at least 1 partition, with the first partition being formatted ext2/3 or fat32/vfat.

Note: The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used with ext4 for proper compatibility. Older versions of e2fsprogs do not need these options passed nor are they needed for ext3.
# This assumes the USB 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/

# Normally, customized images would be copied to 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.embeddedTS.com/ftp/ts-socket-macrocontrollers/ts-4900-linux/distributions/debian/debian-armhf-jessie-latest.tar.bz2
# A symlink can be used 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
Note: This image can be written from a Windows OS, but make sure it is extracted with 7-zip instead of the built in windows zip support or it can break the line formatting of blast.sh

The USB drive boots into a small Buildroot 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. Upon completion of the script, the green or red LEDs will blink to visually indicate a pass or fail of the script. 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 partition the SD card to have a single ext4 partition and extract this tar to the filesystem. If the file /md5sums.txt is present in the tarball, it will be used via the md5sum command to check and verify every file on the filesystem after extraction is complete. This /md5sums.txt file is optional and can be omitted, but it must not be blank if present.
sdimage.dd.bz2 Disk image of the SD card. This will be written to /dev/mmcblk0 directly. If the file /sdimage.dd.md5 is present on the USB drive, the image written to disk will be read back and compared to the md5sum contained in the sdimage.dd.md5 file.
eMMC emmcimage.tar.bz2 Tar of the filesystem. This will repartition the eMMC to have a single ext4 partition and extract this tar to the filesystem. If the file /md5sums.txt is present in the tarball, it will be used via the md5sum command to check and verify every file on the filesystem after extraction is complete. This /md5sums.txt file is optional and can be omitted, but it must not be blank if present.
emmcimage.dd.bz2 Disk image of the eMMC. This will be written to /dev/mmcblk1 directly. If the file /emmcimage.dd.md5 is present on the USB drive, the image written to disk will be read back and compared to the md5sum contained in the emmcimage.dd.md5 file.
SATA [1] sataimage.tar.bz2 Tar of the filesystem. This will repartition the SATA drive to have a single ext4 partition and extract this tar to the filesystem. If the file /md5sums.txt is present in the tarball, it will be used via the md5sum command to check and verify every file on the filesystem after extraction is complete. This /md5sums.txt 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 /dev/sda directly. If the file /sataimage.dd.md5 is present on the USB drive, the image written to disk will be read back and compared to the md5sum contained in the sataimage.dd.md5 file.
SPI u-boot.imx This will write U-Boot on the SPI flash. The imx_type variables will be checked before writing any data to ensure the file being written is compatible with the current CPU. If the file /u-boot.imx.md5 is present on the USB drive, the image written to SPI flash will be read back and compared to the md5sum contained in the u-boot.imx.md5 file.
  1. SATA is only present on the Dual/Quad CPUs

Most users should be able to use the above script without modification, but the Buildroot sources used 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 ext2 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 the USB drive's first partition
make ts4900_defconfig && make && sudo ./make_usb_prog.sh /dev/sdc1