world leader in high performance signal processing
Trace: » adi-board-test

ADI Board Testing

This document covers the procedure ADI uses when programming new STAMP boards to ship to people.

All the files that we use to program/test with can be found in STAMP software package.

All scripts that we use can be found in the STAMP svn repo.

Initial Flash

U-Boot is initially put into the board's flash in one of three ways:

  • board house programs it for us
  • loaded over JTAG (via a Linux flash programmer or VisualDSP's flash programmer)
  • loaded over the UART (for compatible parts)

The preferred method is of course for this step to already be taken care of at the board house so that testing new batches of boards takes less time.

Tweaked U-Boot

The U-Boot binary that is used for this process is tweaked slightly. This is because the POST code that comes with the board includes a loopback UART test and when we reset the board, we do not want the status output from U-Boot itself (which will get fed back into U-Boot via the loopback) causing the autoboot prompt to halt. We pick the letter q since this does not appear anywhere in the status output from U-Boot.

These are the settings we use for the BF537-STAMP:

#define CONFIG_BOOTCOMMAND "bootldr 0x203f0100"
#define CONFIG_AUTOBOOT_PROMPT "autoboot in %d seconds: press space to stop\n"

Board House Firmware

The firmware image that is sent to the board house is specially crafted. It includes both the U-Boot binary as well as a POST LDR which comes with all EZKits.

For the BF537-STAMP, you take the U-Boot binary, pad it with 0xff (the byte that represents “erased flash”) until you get to the last sector of flash, pad some more 0xff bytes to make space for the MAC address, append the POST LDR, and then pad the remaining sector space with 0xff.

Since this can be a painstaking procedure, we've written a small script to do all of this for us. Take the U-Boot binary and the POST LDR and execute this script:

$ ./bin/ -u u-boot.bin -p BF537_STAMP_bin16_init.ldr -v
Flash size : 0x400000
Last Sector: 0x3f0000
Post Offset: 0x3f0100 (0x100 bytes into last sector)
 Input U-Boot    : u-boot.bin (146704 bytes)
 Input POST      : BF537_STAMP_bin16_init.ldr (57876 bytes)
Output Firmware  : board-firmware.bin (4194304 bytes)

This board-firmware.bin file can be programmed into the entire flash to get the “stock” setup.

Test Bench

A large number of USB serial dongles are attached to a single Linux machine. All the boards to be tested are hooked up to the USB serial ports and powered up. Expect scripts are used with Kermit to program new versions of POST tests, U-Boot, the Linux uImage, and MAC addresses.

Hardware Test

The first thing we do with a fresh board is execute the post.exp script. This will update the U-Boot binary, the POST code in the last sector of the flash, as well as program the MAC address (if need be). By virtue, it also makes sure the board powers on and can run U-Boot in external memory as well modify the flash.

Once the current software versions have been updated in the board, a series of hardware tests are executed to verify the external memory and all onboard peripherals (Audio, MAC, UART, Ethernet, CAN, etc…). Any failures here obviously keep the board held back from shipping for analysis and garbage collection.

Specifically for the BF537-STAMP, we do:

  • load uboot-537.bin via serial into flash at 0x20000000
  • load post_537.bin via serial into flash at 0x203f0100
  • program MAC address into flash at 0x203f0000
  • set bootcmd to bootldr 0x203f0100
  • set bootstopkey to q
  • save the new environment to flash
  • reboot and execute the POST code

Basic Linux Test

After the hardware has passed all tests, the linux.exp script is used to update all the boards automatically with the current released Linux uImage. We load it via tftp and program it into the flash. Then we boot it and make sure it is usable.

Specifically for the BF537-STAMP, we do:

  • set bootcmd to flashboot 0x20020000
  • unset bootstopkey
  • save the new environment to flash
  • load uImage-bf537 over ethernet into flash at 0x20020000
  • reset and boot Linux