TS-7552 Blasting Procedure

From embeddedTS Manuals

The stock boards contain a hook in the startup procedure that can be used to easily replicate an image from a thumb drive. The default linuxrc script will:

  • Check for a USB drive
  • Turn on red LED
  • If detected load USB and ethernet modules
  • Mount the first partition of the drive
  • Execute tsinit which should contain any blasting mechanism
  • Turn off red LED

To prepare the USB drive, erase any existing partitions and replace them with a single FAT32 or EXT2/EXT3 partition. The script will attempt to mount /dev/sda1. The linuxrc script will execute a file on the drive named "tsinit". Make sure the script is marked as executable.

This example expects an xnand-image.dd and/or an sd-image.dd in the root of the flash drive. If you exclude either, it will still run while only programming one. Normally, it will begin programming both and wait for them both to finish executing. When the script exits, the red LED will turn off automatically.

#!/bin/sh

# The linuxrc file will mount the USB drive in /mnt/usbdev/, so any
# files you access must use that path.

## Program Nand ##
killall nandctl
nandctl -XW 2048 -z 131072 -i /mnt/usbdev/xnand-image.dd &

## Program SD ##
dd if=/mnt/usbdev/sd-image.dd bs=32k conv=sync of=/dev/nbd5 &

## Program Onboard and Offboard SPI flash ##
spiflashctl -l 0 -W 64 -z 65536 -i /mnt/usbdev/spiflash-image.dd &
spiflashctl -l 1 -W 64 -z 65536 -i /mnt/usbdev/spiflash-image.dd &

wait

You could also mount a network drive and write the image from NFS rather than keeping the image on the USB drive.