4300 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 sd-image.dd, and/or flash-image.dd in the root of the flash drive. 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 SD ##
dd if=/mnt/usbdev/sd-image.dd bs=32k conv=sync of=/dev/nbd5 &

## Program Onboard SPI flash ##
spiflashctl -W 0x3800 -k 2048 -i /mnt/usbdev/flash-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.