readme.txt for ADSP-BF518F EZ-Board Power-On Self-Test (POST)

Last updated:	February 10, 2010


__________________________________________________________

CONTENTS

I.   FUNCTIONAL DESCRIPTION
II.  IMPLEMENTATION DESCRIPTION
III. OPERATION DESCRIPTION
IV.  POST NOTES
V.   USING LOADER FILES

__________________________________________________________

I.  FUNCTIONAL DESCRIPTION

This directory contains an example power-on self-test (POST) project 
which tests the many peripherals of the ADSP-BF518F EZ-Board.  
This application is also loaded into the parallel flash on the 
ADSP-BF518F EZ-Board.  Using the following instructions, you can 
test each peripheral and also create a loader file suitable 
for loading into the on-board flash.

__________________________________________________________

II.  IMPLEMENTATION DESCRIPTION

Executes a POST on the EZ-Board.  By selecting certain pushbutton 
sequences, you can choose which test or tests to run.

__________________________________________________________

III.  OPERATION DESCRIPTION

Certain tests require special switch and jumper settings.  
Most tests use the default settings, shown in the table below.  
Configure the EZ-Board with these default test settings;
if changes are needed for a specific test, refer to the 
POST test notes below.

Also note that POST is designed to work on a specific rev EZ-Board.
If you want to build for a different rev EZ-Board you need to
change a definition in the project settings.  To do that follow
these steps:

- From VisualDSP++, click on the "Project" menu item and select
  "Project Options...".
- Select "Compile" and then "Preprocessor" in the left hand window.
- In the "Preprocessor definitions" window enter the define for
  your EZ-Board.  Valid options are:
  _BF518F_EZBOARD_REV_1_0_
  _BF518F_EZBOARD_REV_0_2_
  _BF518F_EZBOARD_REV_0_1_
- If a valid board rev is not defined POST will not build.
- Add _USING_OTP_BASIC_ to the "Preprocessor definitions" line 
  along with the board rev above. 
- Then click "OK" and rebuild the project.

*******************************************************
* Rev 1.0 EZ-Board settings
*******************************************************

* Preprocessor definition: _BF518F_EZBOARD_REV_1_0_
* Switch settings for rev 1.0 EZ-Board:

		SWITCH						POSITION
						1	2	3	4	5	6	7	8
	=====================================================
	SW1  (BOOT MODE)	POSITION = 1
	SW2   (ON BACK)		ALL ON
	SW3  				ALL ON
	SW4  				ALL OFF
	SW5					OFF	OFF	ON	OFF ON	ON
	SW10				ON	OFF	ON	OFF
	SW15				ALL ON
	SW19				ALL OFF
	SW20				ALL OFF
	SW21				OFF	OFF
	SW22  (ON BACK)		ALL OFF
	SW23  (ON BACK)		ALL OFF
	
* Jumper settings for rev 1.0 EZ-Board:
	
	JP3					NOT INSTALLED
	JP14				NOT INSTALLED
	JP15				INSTALLED ON 2 AND 3
	JP16				NOT INSTALLED
	JP17				NOT INSTALLED
	JP18				NOT INSTALLED
	P8 - P11			INSTALLED
	
*******************************************************
* Rev 0.2 EZ-Board settings
*******************************************************

* Preprocessor definition: _BF518F_EZBOARD_REV_0_2_
* Switch settings for rev 0.2 EZ-Board:

		SWITCH						POSITION
						1	2	3	4	5	6	7	8
	=====================================================
	SW1  (BOOT MODE)	POSITION = 1
	SW2  				ALL ON
	SW3  				ALL ON
	SW4  				ALL OFF
	SW5					OFF	OFF	ON	OFF
	SW6					OFF	OFF	ON	OFF
	SW7					ON	ON	ON	OFF
	SW8					ON	ON	ON	OFF
	SW10				ON	OFF	ON	OFF
	SW15				ON	ON	ON	ON	ON	ON
	SW16				ON	OFF	ON	OFF	ON	OFF
	SW17				ON	ON	ON	OFF	ON	OFF
	SW18				ON	ON	ON	OFF	OFF	OFF
	SW19				OFF	OFF	OFF
	SW20				OFF	OFF	OFF	OFF	OFF	OFF	OFF	OFF
	SW21				OFF	OFF
	SW22  (ON BACK)		ALL OFF
	SW23  (ON BACK)		ALL OFF
	
* Jumper settings for rev 0.2 EZ-Board:
	
	JP3					NOT INSTALLED
	JP4					INSTALLED
	JP11				NOT INSTALLED
	JP12				INSTALLED
	JP13				NOT INSTALLED
	JP14				NOT INSTALLED
	JP15				INSTALLED ON 2 AND 3
	JP16				NOT INSTALLED
	JP17 - JP28			INSTALLED ON 2 AND 3	
	P8 - P11			INSTALLED	
	
	
__________________________________________________________

 IV.  POST TEST NOTES
 
  
This POST uses a pushbutton sequence to select individual tests.  
With only two pushbuttons available and a large number of tests, 
it requires that you enter a 5-button sequence to choose a test.
The only exception is the standard loop, which can also be entered 
with a single pushbutton pressed at reset.

Note that this POST allows you to run multiple tests without resetting 
the board.  After a test runs successfully, it will return to the 
standard blinking pattern.  At this time, you may choose to run 
another test.  If you want to run a single test continuously, 
enter the LOOP_FLAG sequence (2-2-2-2-2); when the standard blinking 
pattern returns, enter the test on which to loop.

Refer to the table in main.c for all the pushbutton sequences 
and their corresponding LED status.  All references to LED status 
will be in the order of LED3-LED2-LED1.  Also, since multiple tests 
will have the same LED pattern, a failure will result in the pattern 
being blinked a certain number of times with a larger delay between 
each series.  For example, TEST1 and TEST8 have the same LED 
pattern (0-0-1).  If TEST1 fails, it will blink the pattern one time 
since it is in the first group.  If TEST8 fails, it will blink the 
pattern twice since it is in the second group.  
Failing test patterns would look like this for the two tests:

TEST1:  0-0-1................0-0-1................0-0-1................
TEST8:  0-0-1...0-0-1........0-0-1...0-0-1........0-0-1...0-0-1........

Note that this POST sends helpful debug information over the UART connector.  
By placing a serial cable between the J2 connector and a COM port on your PC,
you can receive useful debug status information.  In order to receive debug 
information, you must run a terminal application on the PC with 
these settings:
*  115200 baud
*  8 data bits
*  no parity
*  1 stop bit
*  no flow control

The following sections contain notes for running each test:

Program Digipot

1.  Power up the EZ-Board.
    The LEDs should blink the standard pattern.
2.  Press and release the pushbuttons one at a time,
    corresponding to the PROG_DIGIPOT test: 2-1-1-1-2.
3.  The status LEDs should light up: 0-1-1.
4.  The LEDs should return to the original blinking pattern 
    to indicate success.  
    If the test fails, the status LEDs will blink the test pattern.
5.  In case of failure, do not continue.  
    Tag the board and put it aside.

Verify Digipot

1.  Power up the EZ-Board.
    The LEDs should blink the standard pattern.
2.  Press and release the pushbuttons one at a time,
    corresponding to the CHK_DIGIPOT test: 1-1-2-1-1.
3.  The status LEDs should light up: 1-0-0.
4.  The LEDs should return to the original blinking pattern 
    to indicate success.  
    If the test fails, the status LEDs will blink the test pattern.
5.  In case of failure, do not continue.  
    Tag the board and put it aside.

Standard Loop Tests

1.  Place ethernet loopback connectors in J14 and J15 (PORT1 and PORT2) 
    for a rev 0.2 PCB or in J14 for a rev 1.0 PCB.
2.  Turn SW6.1 ON for a rev 0.2 PCB.
3.  Turn SW10.4 ON.
4.  While holding down PB1, power up the EZ-Board.
5.  When LED1 lights up, PB1 may be released.  
    At this point, POST has entered the standard loop test.  
    Note: This test can also be chosen by entering 
    1-1-1-1-1 after powering up when the standard pattern is blinking.
6.  The first test is processor version: 0-0-1.  
    If this fails (it is only considered a warning), continue with 
    the rest of the tests, but alert Engineering of this warning.
7.  The next test is pushbuttons and LEDs (PBLED): 0-1-0.  
    Press and release PB1 and PB2 one at a time.  
    You should see the LEDs toggling with each press.
8.  At this point, the tests will continue without requiring user input.
    When the last test is reached, it will loop back to this point 
    so that tests will continue to run without any further user input.
9.  If a test fails, POST will stop at that point and blink the 
    LED pattern for the failing test.  Refer to the table in main.c 
    for LED patterns.
10. When you have finished the standard loop test, you may power off 
    the EZ-Board.
11. Turn SW6.1 OFF for a rev 0.2 PCB.
12. Turn SW10.4 OFF.

UART

1.  Turn SW10.4 ON.
2.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
3.  Press and release the pushbuttons one at a time,
    corresponding to the UART test: 1-2-1-1-1.
4.  The status LEDs should light up: 0-0-1.
5.  The LEDs should return to the original blinking pattern 
    to indicate success.  If the test fails, the status LEDs 
    will blink the test pattern.
6.  Turn SW10.4 OFF.

Rotary

1.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
2.  Turn SW19 all ON for a rev 0.2 PCB or SW19.1-3 ON for a rev 1.0 PCB.
3.  Press and release the pushbuttons one at a time,
    corresponding to the ROTARY test: 1-2-2-2-2.
4.  LED1 will be blinking to indicate the ROTARY test.  
    Turn SW14 (ENCODER) clockwise and the LED will speed up.  
    Keep turning until the LED stops blinking.  
    Then press SW14 from the side to get the LED blinking again.  
    Then turn SW14 counter-clockwise until the LED stops blinking again.
5.  Turn SW19 all OFF.

SPI Flash

1.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
2.  Turn SW3.4 OFF.
3.  Install JP16.
4.  Press and release the pushbuttons one at a time,
    corresponding to the SPI_FLASH test: 1-2-1-2-1.
5.  The status LEDs should light up: 0-1-1.
6.  The LEDs should return to the original blinking pattern 
    to indicate success.  If the test fails, the status LEDs 
    will blink the test pattern.
7.  Remove JP16.
8.  Turn SW3.4 ON.


Verify Public Key (OTP)

1.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
2.  Press and release the pushbuttons one at a time,
    corresponding to the CHECK_PUBLIC_KEY test: 1-2-2-2-1.
3.  The status LEDs should light up: 1-1-1.
4.  The LEDs should return to the original blinking pattern 
    to indicate success.  If the test fails, the status LEDs 
    will blink the test pattern.

EMMC

1.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
2.  Press and release the pushbuttons one at a time,
    corresponding to the EMMC test: 2-1-2-2-1.
3.  LED1 should blink to indicate it's ready to configure.  
    You have about 2 minutes to configure for this test before 
    it times out and fails.
4.  Turn SW2 all OFF.
5.  Turn SW15 all OFF.
6.  Turn SW19.1 ON.
7.  Turn SW20 all ON.
8.  Turn SW21 all ON.
9.  Now turn SW14 (ROTARY) clockwise to indicate that you are 
    ready to continue.
10. The test will run, and then LED1 will start blinking again, 
    this time slower.
11. Turn SW2 all ON.
12. Turn SW15 all ON.
13. Turn SW20 all OFF.
14. Turn SW21 all OFF.
15. Turn SW14 (ROTARY) clockwise to indicate that you are 
    ready to continue.
16. Now turn SW19.1 OFF.
17. The LEDs should return to the original blinking pattern 
    to indicate success.  If the test fails, the status LEDs 
    will blink the test pattern.

Secure Digital (SD)

1.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
2.  Turn SW15 all OFF.
3.  Insert an SD card into J13.
4.  Press and release the pushbuttons one at a time,
    corresponding to the SD test: 1-2-2-1-1.
5.  The LEDs should return to the original blinking pattern 
    to indicate success.  If the test fails, the status LEDs 
    will blink the test pattern.
6.  Turn SW15 all ON.
7.  Remove SD card from J13.

ADC

1.  Move JP26 to position 1-2 for a rev 0.2 PCB.
2.  Move JP28 to position 1-2 for a rev 0.2 PCB.
3.  Turn SW22.5 ON for a rev 0.2 PCB or SW22.1 ON for a rev 1.0 PCB.
4.  Turn SW23.5 ON for a rev 0.2 PCB or SW22.4 ON for a rev 1.0 PCB.
5.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
6.  Press and release the pushbuttons one at a time,
    corresponding to the ADC test: 2-1-1-2-1.
7.  The LED1 should blink to indicate it's ready to configure.  
    You have about 15 seconds to configure the remaining switches 
    before it times out.
        a.  Turn SW2 all OFF.
        b.  Turn SW4 all ON for rev 0.2 PCB.
		c.  Turn SW4.1-4 ON for rev 1.0 PCB.
8.  The test will run, and then LED1 will start blinking again, 
    this time slower.
9.  You have 30 seconds to turn SW2 all ON.
10. You now can configure the rest of the settings.
        a.  Turn SW4 all OFF.
        b.  Turn SW22.5 OFF for a rev 0.2 PCB or SW22.1 OFF for a rev 1.0 PCB..
        c.  Turn SW23.5 OFF for a rev 0.2 PCB or SW22.4 OFF for a rev 1.0 PCB..
        d.  Move JP26 to position 2-3 for a rev 0.2 PCB.
        e.  Move JP28 to position 2-3 for a rev 0.2 PCB.
11. The LEDs should return to the original blinking pattern 
    to indicate success.  If the test fails, the status LEDs 
    will blink the test pattern.

Real Time Clock (RTC)

1.  This test requires the RTC battery to be populated in J12 
    before beginning.
2.  Note that this test allows for 1 hour to complete or else 
    the test will fail.
3.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
4.  Press and release the pushbuttons one at a time,
    corresponding to the SET_RTC test: 1-1-1-2-2.
5.  The status LEDs should light up: 0-1-1.
6.  The LEDs should return to the original blinking pattern 
    to indicate success; otherwise, the test failed.
7.  If there were no errors, then continue.
    Otherwise, this test has failed.
8.  Power down and power up the EZ-Board again.
    The LEDs should be blinking the standard pattern.
9.  Press and release the pushbuttons one at a time,
    corresponding to the CHECK_RTC test: 1-2-1-2-2.
10. The status LEDs should light up: 1-0-0.
11. The LEDs should return to the original blinking pattern 
    to indicate success; otherwise, the test failed.

Verify Configuration Data

1.  Power up the EZ-Board.
    The LEDs should be blinking the standard pattern.
2.  Press and release the pushbuttons one at a time,
    corresponding to the CHECK_CONFIG_DATA test: 1-2-2-1-2.
3.  The status LEDs should light up: 1-1-0.
4.  The LEDs should return to the original blinking pattern 
    to indicate success.  If the test fails, the status LEDs 
    will blink the test pattern.


_________________________________________________________

 V.  USING LOADER FILES
 
POST ships already programmed into the parallel flash.  
If you wish to make changes to POST or create your own application 
to program into flash, you may do so as well.  Flash drivers and
interface applications are provided for each flash on this EZ-Board
allowing you to program each flash with the VisualDSP++ Flash Programmer.

Note that POST has only been tested and verified to boot from
parallel flash on this EZ-Board.  POST may not fit into or it may
not be compatible with running out of the other flash memories on
the EZ-Board.  Also note that POST flash tests will overwrite portions
of each flash thus potentially overwriting anything you store in flash.
The parallel flash test is designed not to overwrite the POST image
in parallel flash.

The first step is to make a loader (.ldr) file.

1.  Open an ADSP-BF518F EZ-Board session in VisualDSP++.
2.  Open the "Power_On_Self_Test" project.
3.  From the "Project" menu, choose "Project Options...".
4,  Select "Project" in the tree control on the left.
5.  Ensure that "Type" is set to "Loader file".
6.  Select the "Project:Load:Options" from the left side of the window.
7.  Under "Boot Mode", choose "Flash/PROM" for parallel flash 
    or "SPI" for serial flash.
8.  Ensure that "Boot Format" is set to "Intel hex".
9.  "Output Width" should be "16-bit" for parallel flash 
    and "8-bit" for serial flash.
10. "Use default start address" should be selected.
11. "Verbose" should be cleared (unchecked).
12. Since external memory is to be used, 
    the "Initialization file" should be:
    "$(VDSP)\Blackfin\ldr\ezboardBF518_initcode_ROM-V00.dxe" for rev 0.0 silicon
    or "$(VDSP)\Blackfin\ldr\ezboardBF518_initcode_ROM-V01.dxe" for rev 0.1
13. "Output file" and "Additional options" should be blank. 
14. After all the options have been set up, click "OK".
15. From the "Project" menu, choose "Rebuild Project" 
    to build the loader file.
16. The loader file should now be in your output folder.

Next we need to download the loader file.  We can use the VisualDSP++ 
Flash Programmer to accomplish this.  To setup the board to download to
flash do the following:

1.  For parallel flash use the default switch settings.
2.  For external SPI flash, turn SW3.4 OFF and install JP16.
3.  For internal SPI flash use the default switch settings.

Now you are ready to download the loader file.

1.  Using your current session, from the "Tools" menu, choose 
    "Flash Programmer...".
    The Flash Programmer window opens.
2.  On the "Driver" tab, click on the "Browse..." button 
    to browse for the driver.
3.  For parallel flash, choose the executable (.dxe) located here:
    "<VDSP>\Blackfin\Examples\ADSP-BF518F EZ-Board\Flash Programmer\Parallel".
    For internal SPI flash, choose the executable (dxe) located here:
    "<VDSP>\Blackfin\Examples\ADSP-BF518F EZ-Board\Flash Programmer\InternalSPI".
    For external SPI flash, choose the executable (dxe) located here:
    "<VDSP>\Blackfin\Examples\ADSP-BF518F EZ-Board\Flash Programmer\Serial".
4.  Select the .dxe file and then click "Load Driver".
5.  Click on the "Programming..." tab.
6.  Ensure that "Pre-program erase options" is set to "Erase affected".
7.  "File format" should be "Intel Hex".
8.  Click on the "Browse..." button for to browse for the "Data file".
9.  Select the .ldr file you just created and click "Program".
10. Monitor the progress with the status bar.
11. When complete, close the Flash Programmer window.

To boot from flash, just disconnect from VisualDSP++, 
configure SW1 (BOOT MODE), and reset the EZ-Board.
SW1 setting: parallel = 1, internal SPI = 2, external SPI = 3
    
Note: As an alternative method for users connecting with the EZ-Board 
      on-board debug agent.  The above steps will work; however, 
      for your convenience, the following alternate method can be
      used to reset the board and perform a boot without 
      disconnecting from VisualDSP++.
  
1.  From the "Settings" menu, choose "Boot Load".  
    This will cause the board to boot from flash and run.
2.  You can halt the processor at any time by clicking 
    on the "Debug:Halt" menu item.
3.  You can then load the symbols of your application using 
    the "File:Load Symbols" menu item and selecting the .dxe file.  
    This will not change the state of the processor from where 
    it was halted, but it will correlate debug information to 
    what was booted from the flash.
