AM335x CCS Flashing Tools Guide

NOTE

The pre-built flashing tools binaries provided with this release were tested with CCS v5.1. Please re-build if you are using a different CCS version. About this manual

This document describes steps to build the different flashing tools and procedure to use them on AM335x platform using CCS v5.1. In case if you are using the pre-built binaries, you can skip the portion of Build Flashing Tool binaries and directly jump to section Steps For Flashing

Build Flashing Tool binaries
Requirements

Windows machine with CCS v5.1 installed.

Building NAND Flash Writer
NOTE Pre-built image is available as host-tools/nand-flash-writer.out of PSP release package
 * NAND flasher source should be available as part of AM335x release package under host-tools/src/nandflash-&lt;version&gt;.tar.gz
 * untar source zip
 * Start CCS v 5.1 and import this project using following steps.


 * 1) Start CCS v 5.1 from windows start menu.
 * 2) Open c/c++ projects view by View &gt; C/C++ Projects.
 * 3) Open Import dialogue box from File-&gt;Import.
 * 4) Expand CCS option and select Existing CCS/CCE Eclipse Project and select Next.
 * 5) Click Browse button and select the NAND flasher folder.
 * 6) Click on checkbox which says NAND Flasher and click Finish.


 * From projects menu click Build Project, Project &gt; Build Project.
 * The flashing tool out file should be available in Nand_flasher/Debug.

= Steps For Flashing = System Requirements CCS v 5.1 or above installed on Windows XP.

Connecting CCS to AM335x EVM.
NOTE Target is connected using CCS v5.1.
 * Connect the XDS560 emulator to the AM335x EVM.
 * Start CCS v5.1 by navigating to 'Start' menu in Windows XP.
 * Use target configuration file AM335x.ccxml. If there is a need to create a new configuration, then follow steps below.


 * 1) Create new Target Configurations pane by File &gt; New &gt; Target configuration file.
 * 2) Name it as AM335x.ccxml and click on Finish.
 * 3) In the new Target configuration select Basic pane and select connection type as TI XDS560 Emulator and device type as AM335x by checking the box.
 * 4) Save the target configuration, eg: AM335x.ccxml.
 * 5) Select coretex A8 core in the advanced pane and update the initialization script with AM335x.gel file.
 * 6) Save the target configuration.


 * Select Debug in CCS if not there already: View-&gt; Debug
 * Select View -&gt; Target Configurations. Expand User defined till you reach AM335x.ccxml.
 * Right click and click "Launch Selected Configuration".
 * This should launch debug session.
 * In Debug view, (scroll till the end) Select "TI XDS560 Emulator_0/Cortex A8" connection.
 * Right click and select "Set Debug Scope" option. This will make remove all the cores except Cortex A8 from the debug view.
 * Right click on the Cortex A8 core listed in Debug view and click on "Connect Target".
 * Run the initialization script under scripts tab, AM335x System initialization ==&gt;&gt; AM335x_EVM_Initialization

Loading GEL File
NOTE Flashing tool expects the GEL file to initialize the DDR and on-chip RAM. The latest GEL file can be found at http://processors.wiki.ti.com/index.php/OMAP_and_Sitara_CCS_support Load the Gel file by selecting the GEL Files under Tools tab after connecting to target. After loading Gel File initialize the EVM using scripts under Scripts tab. To initialize EVM select the AM335x_EVM_Initialization under AM335x System Initialization

Burning NAND Flash (using CCS)
This section describes how to burn an image to the NAND flash on the EVM. The pre-built CCS tool (host-tools/nand-flash-writer.out) for NAND flash should be available as part of PSP release package.

NAND flashing tool used to flash SPL and U-boot. SPL should be flashed to first four blocks as in AM335x, RBL checks for SPL at 1st 4 Blocks. If the 1st block fails, RBL checks in 2nd blocks and so on till 4th Block. To support this feature, SPL needs to be flashed to 1st 4 blocks. So the offset for flashing SPL are 0x0, 0x20000, 0x40000 &amp; 0x60000. For U-Boot flashing offset to 0x80000, on the 4th block. Flash layout of NAND is shown here NOTE Flashing utility run each time to flash each component. While Flashing, flashing utility taken care of erasing the required blocks in NAND flash device.

Due to heavy pin-muxing, NAND flash is only available on few AM335x EVM and in few profiles. The user has to make sure that the d profiles have been properly selected to enable NAND before flashing the image to NAND. On unsupported profiles NAND flash tool will fail to detect NAND. NOTE For more information about EVM Configuration &amp; profile Descriptions, please refer to EVM reference manual.

Flashing image to NAND Flash
Choose your operation Enter 1 ---&gt; To Flash an Image Enter 2 ---&gt; To ERASE the whole NAND Enter 3 ---&gt; To EXIT Select option 1 when prompted. Select option 2 in case if you want to erase the whole NAND.
 * Start CCS using steps mentioned in Connecting CCS to AM335x EVM.
 * Load GEL file using steps mentioned in Loading GEL File.
 * After the GEL file is loaded reset the board by running scripts from GEL File. go to scripts -&gt; AM335x System Initialization and click "AM335x_EVM_Initialization".
 * Ensure that the image (e.g. MLO) to be flashed is present in the Windows XP Machine.
 * Load nand-flash-writer.out and run it. nand-flash-writer.out should be available in the release package under board-utilities\
 * Select option for flashing.

Enter image file path Provide the complete path (e.g. C:\images\MLO)
 * Enter the image path to flash when prompted as shown below.

Enter offset (in hex): This offset is the start location from where the image should be flashed. NOTE Use hex format (For example, Enter 0x0 for flashing MLO image (i.e. 1st Stage)) in first block. 0x80000 for U-Bootto flash it in 4th block. Choose the ECC scheme from given options Enter 1 ---&gt; BCH 8 bit Enter 2 ---&gt; HAM Enter 3 ---&gt; T0 EXIT Please enter ECC scheme type: Always select BCH8 for MLO and U-Boot as the ROM code uses the BCH8 ECC scheme. Enter 1 for selecting BCH8.
 * Enter the offset when prompted when prompted as shown below.
 * Select ECC for flashing.


 * Ensure that the flash info displayed by the tool matches the NAND flash in the EVM.

Application is successfully flashed NAND boot preparation was successful!
 * After this the tool should first erase the required region in flash and then start flashing the new image.
 * Finally you should see the following message.
 * Disconnect CCS and then turn off the board.
 * Make sure that Profile is selected for the NAND boot mode.
 * Boot the Board &amp; verify