NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
AM335x CCS Flashing Tools Guide
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
Windows machine with CCS v5.1 installed.
Building NAND Flash Writer
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-<version>.tar.gz
- untar source zip
- Start CCS v 5.1 and import this project using following steps.
- Start CCS v 5.1 from windows start menu.
- Open c/c++ projects view by View > C/C++ Projects.
- Open Import dialogue box from File->Import.
- Expand CCS option and select Existing CCS/CCE Eclipse Project and select Next.
- Click Browse button and select the NAND flasher folder.
- Click on checkbox which says NAND Flasher and click Finish.
- From projects menu click Build Project, Project > Build Project.
- The flashing tool out file should be available in Nand_flasher/Debug.
Steps For Flashing
CCS v 5.1 or above installed on Windows XP.
Connecting CCS to AM335x EVM.
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.
- Create new Target Configurations pane by File > New > Target configuration file.
- Name it as AM335x.ccxml and click on Finish.
- 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.
- Save the target configuration, eg: AM335x.ccxml.
- Select coretex A8 core in the advanced pane and update the initialization script with AM335x.gel file.
- Save the target configuration.
- Select Debug in CCS if not there already: View-> Debug
- Select View -> 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
- 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 ==>> AM335x_EVM_Initialization
Loading GEL File
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 & 0x60000. For U-Boot flashing offset to 0x80000, on the 4th block. Flash layout of NAND is shown here
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.
For more information about EVM Configuration & profile Descriptions, please refer to EVM reference manual.
Flashing image to NAND Flash
- 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 -> 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.
Choose your operation Enter 1 ---> To Flash an Image Enter 2 ---> To ERASE the whole NAND Enter 3 ---> To EXIT
Select option 1 when prompted. Select option 2 in case if you want to erase the whole NAND.
- Enter the image path to flash when prompted as shown below.
Enter image file path
Provide the complete path (e.g. C:\images\MLO)
- Enter the offset when prompted when prompted as shown below.
Enter offset (in hex):
This offset is the start location from where the image should be flashed.
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.
- Select ECC for flashing.
Choose the ECC scheme from given options Enter 1 ---> BCH 8 bit Enter 2 ---> HAM Enter 3 ---> 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.
- Ensure that the flash info displayed by the tool matches the NAND flash in the EVM.
- 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.
Application is successfully flashed NAND boot preparation was successful!
- Disconnect CCS and then turn off the board.
- Make sure that Profile is selected for the NAND boot mode.
- Boot the Board & verify