Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

DM814x AM387x PSP Flashing Tools Guide

From Texas Instruments Wiki
Jump to: navigation, search
TIBanner.png
DM814x/AM387x PSP Flashing Tools Guide
Linux PSP

IMPORTANT

DM814x refers to DM814x/AM387x devices unless specified.

Warning Warning: This user guide does not cover using CCS on Linux host and does not support makefile based build.

NoteNote: The pre-built flashing tools binaries provided with this release were tested with CCS 5.1.0.05000. Please re-build if you are using a different CCS version. Before connecting CCS, the bootswitch S1 should be all 0's (BTMODE[4:0] = 00000). Also make sure switch SW2 is set as mentioned in EVM Switch Settings section in U-Boot User Guide for the respective boot media (NAND/SPI). Change bootswitch to required bootmode only after flashing the image, this applies to all memory device (NAND/SPI).

Read This First

About this Manual

This document describes steps to build the different flashing tools and procedure to use them on DM814x platform. In case you are using the pre-built binaries for the flash writers jump to section on Steps for Flashing

Setup

Starting CCS

  • System Requirements – CCS v5.1 or above installed on Windows XP with Service Pack 2
  • Use the Configuration and gel file to set up CCS from host-tools package for the respective release

NoteNote: The bootmode switch S1 should be all 0s (i.e. BTMODE[4:0] = 00000)

  • Connect the Spectrum Digital XDS560V2 STM USB emulator to the DM814x EVM
  • Start CCS by navigating to 'Start' menu in Windows XP
  • Select the workspace folder where you want to store your project
    • Select "View -> Target Configurations"
    • In the "Target Configurations" tab select "New Target Configuration File" button (in the top left corner)
    • Name the file (example, ti814x_usb.ccxml)
    • Click "Finish"
    • Connection = Spectrum Digital TI XDS560V2 STM USB Emulator
    • Board or Device = TI814x
    • Save configuration
    • From next run, the project and target configuration will be readily available and can be skipped
  • Select "Debug Perspective" in CCS if you are not there already: Window --> Open Perspective --> CCS Debug
  • Select View -> Target Configurations.
  • Expand "User Defined" configuration tree, Right click on the newly created target configuration and select "Launch Selected Configuration"
  • This should launch debug session
  • In Debug view, (scroll till the end) Select "Spectrum Digital XDS560V2 STM USB Emulator_0/Cortex A8" connection.
  • Right click on the Cortex A8 core listed and click on "Connect Target"

Warning Warning: If you get the following error in CCS "ARM9_TPPSS: Failed to retrieve the Wait in Reset Mode: Failed to get PRSC status" then press "Power ON Reset" push button and then repeat the previous step. A "Disassembly" view with PC halted should pop up in one of the tabs. If not, do a 'System Reset' from Target menu and then Halt (for GP device)

  • From the View menu --> Registers, open CPSR and set "T" field as "0". This is required to change ARM state from "Thumb" to "ARM" mode.

Loading GEL File

IMPORTANT

* Flashing tool expects the GEL file to initialize the PLLs, DDR, on-chip RAM and GPMC.
  • The GEL file in Linux PSP release is just for reference hence might not work on all boards.
  • Please check the SDK release for latest GEL file.
  • Ensure that the GEL file package File:DM814x gel.zip is copied to the Windows Machine
  • The .zip contains GEL files for both PG2.x (DM814x_PG2.x.gel) and PG1.x (DM814x_PG1.x.gel). Please check your EVM documents or Schematic to find out the PG version on your EVM (This is usually written on the EVM PCB).
  • Select Tools --> GEL Files from CCS IDE
  • This opens a new tab in the Debug view. On right hand side empty area in this window, right click and select "Load GEL". This should open the file browser dialog.
  • Navigate to the directory containing gel file and select the respective gel file (DM814x_PG1.x.gel for PG1.x and DM814x_PG2.x.gel for PG2.x).
  • A "Scripts" menu item (on top) should now be available.
NOTE

Sometimes the Scripts menu will be disabled. In this case, go to Debug window and select Spectrum Digital XDS560V2 STM USB Emulator_0/CortexA8 (top level node) and the Scripts menu should get activated.
  • Jump to respective PG section below for further initialization.

PG1.x

  • Select Scripts --> Centaurus System Initialization --> PLL_CLOCKS_Config. This should setup all the clocks.
  • Now select Scripts --> Centaurus System Initialization --> DDR2_Initialization. This should setup EMIF for DDR2.
  • And then select Scripts --> Centaurus System Initialization --> GPMC_ClkEnable. This should initialize GPMC.

PG2.x

  • Select Scripts --> Centaurus2 System Initialization --> ALL_ADPLL_CLOCKS_ENABLE_API. This should setup all clocks.
  • Now select Scripts --> Centaurus2 DDR Configuration --> DDR3_EMIF0_EMIF1_Config. This should setup EMIF for DDR3.
  • And then select Scripts --> Centaurus2 CORE_CLKS Configuration --> GPMC_ClkEnable_API. This should initialize GPMC.

Building

Building NAND Flash Tool

NoteNote: Pre-built image is available in host-tools/nand-flash-writer.out

  • NAND flasher source should be available as part of DM814x release package under src/nandflash-<version>.tar.gz
  • untar source zip
  • Start CCS and import this project using following steps.
    • Start CCS from Windows Start menu
    • Refer Starting CCS for remaining steps
    • Open Import dialogue box from File menu
    • Expand CCS option and select Existing CCS/CCE Eclipse Project.
    • Click Browse button and select the NAND flasher folder.
    • Click on checkbox which says NETRA NAND and click Finish
  • From Project menu, click Clean and wait for clean operation to complete and then click Build All
  • The flashing tool out file should be available in NETRA/Debug folder

Building NOR Flash Tool

NoteNote: Pre-built image is available in host-tools/norflash-writer.out

  • NOR flasher source File:Nor-Flash-Writer.zip should be available as part of DM816x release package under host-tools/src/norflash-<version>.tar.gz
  • untar source zip
  • Start CCSV5 and import this project using following steps.
    • Start CCSv5 from windows start menu
    • Refer Starting CCS for remaining steps
    • Open Import dialogue box from File->Import
    • Expand CCS option and select Existing CCS/CCE Eclipse Project.
    • Click Browse button and select the NOR flasher folder.
    • Click on checkbox which says NOR Flasher and click Finish
  • From Project menu, click Clean and wait for clean operation to complete and then click Build All
  • The flashing tool out file File:Norflash-writer.zip (norflash-writer.out) should be available in ccsv4/Debug/

Building SPI Flash Tool

NoteNote: Pre-built image is available in host-tools/spi-flash-writer.out

  • SPI flasher source should be available as part of DM814x release package under src/spiflash-<version>.tar.gz
  • untar source zip
  • Start CCS and import this project using following steps.
    • Start CCS from Windows Start menu
    • Refer Starting CCS for remaining steps
    • Open Import dialogue box from File menu
    • Expand CCS option and select Existing CCS/CCE Eclipse Project.
    • Click Browse button and select the SPI flasher folder.
    • Click on checkbox which says SPI Flasher and click Finish
  • From Project menu, click Clean and wait for clean operation to complete and then click Build All
  • The flashing tool out file should be available in Debug/

Steps for Flashing

Burning images to NAND Flash (using CCS)

This section describes how to burn an image to the NAND flash on the EVM. The pre-built NAND flashing tool binary should be available as part of PSP release package.

NoteNote: NAND flashing tool supports flashing only 1st stage u-boot. For flashing 2nd stage u-boot, use 1st stage u-boot and loadb command as mentioned in user guide. For kernel and filesystem, use tftp in 2nd stage u-boot.

If the daughter card is connected then SW1 on the daughter card should be set to all off

  • Start CCS using steps mentioned in Starting CCS
  • Load GEL file using steps mentioned in Loading GEL
  • Ensure that the image (e.g. u-boot.min.nand) to be flashed is present in the Windows XP Machine
  • Load nand-flash-writer.out and run it ("Run -> Load -> Load Program" Browse to "nand-flash-writer.out" file, open it and then run it). nand-flash-writer.out should be available in the release package
  • Start the application from Run -> Resume. Or hit F8.
  • Select option 1 when prompted. Select option 2 only in case if you want to erase the whole NAND
  Choose your operation 

Enter 1 ---> To Flash an Image 
Enter 2 ---> To ERASE the whole NAND 
Enter 3 ---> To EXIT 
  • Enter the image path to flash when prompted as shown below. Provide the complete path and the file name should not have any white spaces (e.g. c:\u-boot.min.nand)
     Enter image file path
  • Enter the offset when prompted when prompted as shown below. This offset is the start location from where the image should be flashed. NOTE: Use hex format (For example, Enter 0x0 for flashing u-boot.min.nand image (i.e. 1st Stage))


     Enter offset (in hex): 


  • Select ECC for flashing. Always select BCH8 for U-Boot as the ROM code uses the BCH8 ECC scheme. Enter 1 for u-boot.min.nand.
     Choose the ECC scheme from given options 
Enter 1 ---> BCH 8 bit
Enter 2 ---> HAM
Enter 3 ---> T0 EXIT
Please enter ECC scheme type :


  • 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 successfully flashed
NAND boot preparation was successful!
  • Turn off the board and disconnect the CCS from the device.

After flashing the image please refer PSP User-Guide on how to proceed further with U-Boot configuration and how to boot the kernel.


Burning images to NOR Flash (using CCS)

This section describes how to burn an image to the NOR flash on the EVM.

The pre-built NOR flashing tool binary should be available in the PSP release package. However the package does not come with pre-built U-Boot image for NOR. You will have to recompile U-Boot for NOR to generate the appropriate binary. Refer to Building U-Boot for NOR for steps on how to build U-Boot for NOR.

  • Start CCS using steps mentioned in Starting CCS
  • Load GEL file using steps mentioned in Loading GEL
  • Ensure that the image to be flashed is present in the Windows XP Machine
  • Load norflash-writer.out and run it ("Run -> Load -> Load Program" Browse to "norflash-writer.out" File:Norflash-writer.zip file, open it and then run it). norflash-writer.out should be available in the release package.
  • Start the application from Run -> Resume. Or hit F8
  • Enter the file name to flash when prompted as shown below. Provide the complete path and the file name should not have any white spaces (e.g. c:\u-boot.bin)
     Enter the File Name
  • Enter the offset when prompted as shown below. This offset is the start location from where the image should be flashed. NOTE: This offset should be in decimal and not


in hex. For u-boot it should be 0.

     Enter the Offset in bytes (decimal)
  • The whole flash could be erased or only for the file size using the following option. You could enter either 0 or 1 based on the requirement. It is always recommended to use '1' for the first time and after that use '0' so that we would not erase anything which was flashed separately (like u-boot environment) after first time erase.
 Erase Options:
---------------
0 -> Erase Only Required Region
1 -> Erase Whole Flash
Enter Erase Option:
  • After this the tool should first read the data from the Image file (this would take couple of minutes) then erase the flash and then start flashing the new image.
  • Finally you should see the following message
     !!! Successfully Flashed !!!
  • Turn off the board and disconnect the CCS from the device

After flashing the image please refer PSP User-Guide on how to proceed further with U-Boot configuration and how to boot the kernel.

Burning images to SPI Flash (using CCS)

This section describes how to burn an image to the SPI flash on the EVM.

If the daughter card is connected then SW1 on the daughter card should be set to all off

  • Start CCS using steps mentioned in Starting CCS
  • Load GEL file using steps mentioned in Loading GEL
  • Ensure that the image (e.g. u-boot.min.spi) to be flashed is present in the Windows XP Machine
  • Load spi-flash-writer.out and run it ("Run -> Load -> Load Program" Browse to "spi-flash-writer.out" file, open it and then run it). spi-flash-writer.out should be available in the release package
  • Start the application from Run -> Resume. Or hit F8.
  • Ensure that the flash info displayed by the tool matches the spi flash in the EVM
  • Enter the file name to flash when prompted as shown below. Provide the complete path and the file name should not have any white spaces (e.g. c:\u-boot.min.spi).
     Enter the File Name
  • Enter the offset when prompted when prompted as shown below. This offset is the start location from where the image should be flashed. NOTE: This offset should be in decimal and not in hex. In case of u-boot.min.spi (i.e 1st stage), offset should be 0.
     Enter the Offset in bytes (decimal)
  • After this the tool should first erase the flash and then start flashing the new image.

NoteNote: After printing few lines of progress (debug) prints, the CCS IDE will become non responsive. We have observed this issue with some CCS versions (CCSv5.1.0.05000). Please be patient till you see the below message

     Verifying...Success
  • Turn off the board and disconnect the CCS from the device.

After flashing the image please refer PSP User-Guide on how to proceed further with U-Boot configuration and how to boot the kernel.