The following instructions enable you to run the blink example program from
the on-board flash memory.

NOTE:   Code Composer Studio should not be open while running this example.

1) If you installed Code Composer Studio in c:\ti, create a folder called "flash" in the c:\ti\myprojects folder.  (If you installed elsewhere, create a folder within the myprojects folder in the location where you installed.)

2) Copy the command file, blink_flash_hex.cmd, and the out file, blink_flash.out, from the c:\ti\c5400\dsk\examples\dsp\flash\ folder to this new folder.

3) At a DOS Command Prompt, change the directory to your working directory (c:\ti\myprojects\flash\). Enter the following command:

  hex500 blink_flash_hex.cmd

This command runs the hex conversion utility (hex500.exe) with the options stated in the command file, blink_flash_hex.cmd.  The hex conversion utility outputs a map file, blink_flash.map, and a hex file, blink_flash.hex.

4) The flash utility program (flashu.exe) can then be used to program the on-board flash memory.  Make sure the DSK board is set for HPI boot (JP2 pins 1 & 2 connected). At the DOS Command Prompt, enter:

  cd c:\ti\c5400\dsk\utilities\

Then enter:

  flashu 2 -l c:\ti\myprojects\flash\blink_flash.hex

NOTE: Flash programming takes at least 25 seconds because the entire flash is erased before being programmed.  A 20-second delay is inserted to give the device enough time to complete the erase operation.

5) Press the hardware-reset button. Or, power-down the board and power it back up.  The blink program will boot from flash, blinking all three LEDs in sequence.

6) To erase the flash memory, enter the following command while in the c:\ti\c5400\dsk\utilities directory:

  flashu 2 -e

NOTE: The out file, blink_flash.out, was built using the TMS320C54x ANSI C Compiler, COFF Assembler, and COFF Linker.  To generate the out file yourself, copy blink_flash.c, board.lcf, blink_flash_build.bat, and blink_flash_hex.cmd from the directory c:\ti\c5400\dsk\examples\dsp\flash\ to the directory c:\ti\myprojects\flash\.  At a DOS Command Prompt, change the directory to your working directory (c:\ti\myprojects\flash\). The commands for invoking the compiler, assembler, linker, and hex conversion utility are contained in blink_flash_build.bat.  Run the batch file by typing "blink_flash_build".  The compiler, assembler, linker, and hex conversion utility programs will run.  The following files are output: blink_flash.obj, blink_flash.out, blink_flash.map, blink_flash.lst, and blink_flash.hex.  At this point, you can start at step 4 above.
