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.

Flash v1.4 User Guide

From Texas Instruments Wiki
Jump to: navigation, search

TIBanner.png


Installation Instructions

  1. Download "FlashTool for AM35x, AM37x, DM37x and OMAP35x Devices" from here:

         focus.ti.com/docs/toolsw/folders/print/flashtool.html onto a PC running the Windows XP O/S.

    2.  Open the downloaded FlashTool_vX.X.zip file and run setup.exe to start the Windows Installer. 

    3.  Follow the installer instructions.

    4.  The default installation directory is "C:\Program Files\Texas Instruments\Flash v1.4", but this

         can be changed when running the installer.

    5.  The FlashTool software can be uninstalled at any time by accessing the Add/Remove Programs

         function of Windows (Start -> Control Panel -> Add/Remove Programs).

About Flash v1.4

This page contains a description of a tool – Flash v1.4 – that can be used to transfer binary images

from a host PC to certain TI ARM-based target platforms. The tool consists of two main components:

 - a GUI host application, called Flash v1.4
 - a CLI host application, called OMAPFlash.

It is recommended to use the GUI for performing flashing functions. This documentation covers usage

of the GUI. Future documentation will cover the CLI interface in more detail. This application has been

designed with flexibility and portability in mind. It is now possible to modify target register configurations

without rebuilding the tool. This allows for easy modifications to various target peripheral configurations

(such as SDRC, GPMC, Pad Control, etc.). This capability makes it possible to support new DDR devices

and NAND devices without software changes. Check out the section #Porting_Guide for more information

on this feature.  Internally, the tool makes use of a ROM code mechanism for peripheral boot from UART

or USB to transfer compatible drivers to the internal memory of the OMAP device. These drivers provide

the mechanism by which the host applications can program binary images into the internal memories

(NAND and SDRAM) of the target. All of this operation is hidden from the user.

Release Notes

Version 1.4: :

New Features

Added AM35xx and Custom_AM35xx target types

Updated "What's This?" help text for UART and USB target connection types

Limitations
OMAP35xx devices cannot use 4-bit BCH error correction (not supported by silicon)

On-chip ECC is not supported

Programming flash via UART target connection is not supported

Otherwise, similar functionality to previous releases.


Version 1.3

 New Features
  • GUI updates, including "What's This?" style help, link to user's guide.
  • Defined Custom target types for AM37xx and OMAP35xx, to allow customers to more easily make

    changes for custom boards.

  • Enhanced NAND capabilities: SW vs. HW ECC Selection, 1b/4b/8b Error Correction, ONFI NAND

    selection via check box.

 Limitations
  • Still no AM35xx support (coming in future release).
  • Otherwise, similar functionality to previous releases.

Version 1.2:

 New Features
  • USB Support
  • Can install over previous versions without manual uninstall
  • Selectable NAND vs. ONFI NAND mode
 Limitations
  • Same as before

Version 1.1:

 New Features
  • OMAP35xx Support.
 Limitations
  • Same as before

Version 1.0:

 Features
  • UART support
  • AM37xx/DM37xx support
  • Can support new NAND devices via text config file modification.
  • Can modify target registers via text config file modification (for example SDRC, GPMC, pad config

    settings)

  • ONFI NAND Support
  • Supported operations: Download, Download and Execute (to Thumb mode code), Erase Region,

    Erase All.

  • Windows GUI (no Linux yet).
  • Scriptable Windows CLI (no Linux yet).
  • Fully open source, BSD-style license.
 Limitations
  • Download and execute can only branch to Thumb code.
  • Storing images to NAND uses HWECC. Therefore, you cannot use a standard xloader to load uboot

    from NAND. Xloader uses SWECC when reading from NAND. The workaround is to use the uboot

    provided on the SD card to flash itself into NAND memory.

  • GUI support does not yet exist to define new platforms. However, two memory choices are supplied,

    Hynix and Micron. For experimenting with modifications to the configuration text file (for instance, to

    port to a new platform) it is recommended that you modify the Micron files (and save a copy if you need

    the originals).

Accessing Online Help

There are two methods to get help from the user interface:

1. Click the "What's This Do?" Button. This changes the cursor type. Move the cursor over a widget

    until you see the cursor change to a question mark. Then, you may click and get context sensitive

    help.

2. Click the "Open User's Guide" Button. This will open your normal HTML browser to the Flash User's

    Guide Page (this page).

Setup for USB Peripheral Boot Mode

1. Ensure that your EVM is set up for peripheral boot from USB.


For Mistral OMAP EVM (AM37x, DM37x or OMAP35xx devices) 

  • Set SW4 switches #2 and #3 to the ON position and all others OFF. 
  • Connect a USB cable from the board's USB "On the Go" port to a USB port on the PC. 
  • Power on the EVM or press the reset pushbutton (labelled "OMAP_RST")



For LogicPD AM3517EVM:

  • Set SW7 switches #1 and #4 to the ON position and all others OFF. 
  • Connect a USB cable from the board's USB "On the Go" port to a USB port on the PC. 
  • Power on the EVM or press the reset pushbutton (labelled "RESET")


2. If this is the first time to connect the EVM to your PC via USB you will need to perform

    the following steps to install the required USB driver:

  • You will see the "Found New Hardware Wizard" dialog box. Select "No, not this time",

    then "Next". 

  • Select "Install from a list or specific location (Advanced)". 
  • Use the browse box to select the following folder: <Flash-install-dir>\usb_drv_windows.

    Normally, the full path will be:

    C:\Program Files\Texas Instruments\Flash v1.4\usb_drv_windows. 

  • Make sure the box "search removable media" is unchecked. 
  • Make sure the box "Include this location in the search" is checked. 
  • Click Next. The driver should install correctly without error messages. 
  • Click Finish to exit the Found New Hardware Wizard.

Setup for UART Peripheral Boot Mode

NOTE: Flash programming using UART peripheral boot mode is NOT supported in Flash_v1.4.

           This feature will be supported in a future release.


1. Ensure that your EVM is set up for peripheral boot from UART.


For Mistral OMAP EVM (Rev G): 

  •    Set SW4 switches #2 and #4 to the ON position and all others OFF. 
  •    Connect a 9-pin serial NULL-MODEM cable, from your host PC to the

       “UART3” port on the target board. 

  •    Power on the EVM or press the reset pushbutton (labelled "OMAP_RST")


For LogicPD AM3517EVM: 

  • Set SW7 switches #1 and #4 to the ON position and all others OFF.
  • Connect a 9-pin serial NULL-MODEM cable, from your host PC to the

    “UART” port on the target board. 

  • Power on the EVM or press the reset pushbutton (labelled “RESET").



Making Binary Images Accessible to the Windows XP O/S

The binary images for XLOADER, U-Boot and the Linux Kernel must be made accessible to the

Windows XP O/S.  There are a few methods for doing this:

1)  If you are running your Linux Host as a virtual machine (using VMWare or using Sun Virtual

    Box) you can setup a shared folder that can be accessed by both the Linux Host and the

    Windows O/S.   (You can also create sub-folders below that as needed - the resulting directory

    tree will be accessible to both Linux and Windows.)

    See How to Set up a Shared Folder in VMWare or How to Setup a Shared Folder in Virtual Box 

    for details.

 

    OR


2) You can setup a Samba server that makes a designated location in your Linux Host file system

    appear as a drive to the Windows O/S.


The binary images can be copied to the shared folder or Samba drive:

1)  From the PSP/prebuilt-images subdirectory of the Sitara SDK installed on the Ubuntu Linux Host.

    OR

2) From the boot partition of the SD Card that came with the Sitara EVM.

Starting the Flash Application

To start the Flash application under Windows XP:

  •  Double click the "Shortcut to Flash.exe" icon on the desktop

OR

  • Use the Windows Start menu:

    "Start -> All Programs -> Texas Instruments -> Flash v1.4 -> Shortcut to Flash.exe".


Below is a screen capture of Flash_v1.4 upon startup.


Flash v1.4 Startup-2.PNG


Details about the Flash GUI

1. CHOOSE TARGET (drop-down box)

    This allows selection of pre-defined target configuration files for the different EVM boards.  The

    target configuration files contain register initialization code that mimics what is performed

    by XLOADER to initialize clocks and memory interfaces prior to flash programming.  The

    following pre-defined EVM configurations and custom configurations are provided.  Choose a

    a custom target configuration and click the "Edit Config File" button to view or modify the target

    configuration for your custom design.   See the Porting Guide section for more information

    on how to design a custom target configuration file.

   

Pre-Defined EVM Target Board Configurations
Target Board Target Configuration Description
AM35xx (Micron) LogicPD AM3517EVM with AM3517A SOM and Micron discrete NAND and DDR2 memories
AM37xx (Hynix) Mistral OMAP3 EVM with AM37x or DM37x SOM containing Hynix POP Memory
AM37xx (Micron) Mistral OMAP3 EVM with AM37x or DM37x SOM containing Micron POP Memory
OMAP35xx (Micron) Mistral OMAP3 EVM with OMAP35x SOM containing Micron POP Memory


Custom Target Board Configurations
Target Board Configuration Description
Custom AM35xx Board Same as AM35xx (Micron) - Modify for your custom AM35xx design.
Custom AM37xx Board Same as AM35xx (Micron) - Modify for your custom AM37x/DM37x design.
Custom OMAP35xx Board Same as AM35xx (Micron) - Modify for your custom OMAP35xx design.


2. SELECT TARGET CONNECTION TYPE (Radio Buttons)

    This allows selection of the target connection.   Select USB or UART for communication between

    the Host PC and the target board (and also the peripheral boot mode that will be used).

    For the UART connection, also select the PC COM port that will be used (typically 1 for COM1).


        NOTE:  Only the USB target connection is supported by this Flash Tool release.


3. CHOOSE THE DESIRED MEMORY TYPE

    This selects the destination memory type.   Selecting NAND enables Erase and Download

    operations.  Selecting SDRAM allows Download and Download and Execute operations.


4. SELECT MEMORY OPTIONS

    If you have selected SDRAM, there are no other memory options to select.  If you have selected NAND,

    choose from the following group of options:

  • ECC STYLE (Radio Buttons)

    This selects the offset in the NAND Out Of Band (OOB) area where ECC data begins.  Choose

    HWECC or SWECC.  This has nothing to do with the method that is used to perform error correction.

    When programming XLOADER, always choose HWECC and 1-bit ECC, as this is required by the

    ROM Boot Loader.  When programming UBoot, the Linux Kernel or a File System the ECC style

    must be set to be compatible with the software that will read the downloaded image from NAND.

  • ONFI COMPLIANT NAND? (check box)

    Check this box for operations on an ONFI-compliant NAND device.  When checked, data specifying

    NAND memory geometry and features are read from the NAND device.  Otherwise, this data is taken

    from the header in the Target Configuration file.

  • ERROR CORRECTION (Radio Buttons)

    Select the error correction algorithm that will be used to program the ECC data into the OOB area. 

    For ECC data in the SWECC location, only 1-Bit ECC (Haming Code) is allowed.  For ECC data in

    the HWECC location, 1-bit ECC, 4-bit BCH or 8-bit BCH algorithms can be selected.  (4-bit BCH is

    not available for the OMAP35xx device due to silicon limitations).


5. CHOOSE OPERATION PARAMETERS (Radio Buttons)

    Select the operation to be performed:

  • DOWNLOAD

    Choose this to download a binary image to either NAND or SDRAM.

    Before downloading an image to NAND, you must first erase the region where the image will be

    downloaded (or Erase All NAND).

    Set OFFSET (hexadecimal value) to the offset from the beginning of NAND or SDRAM where the

    image will be downloaded.

  • DOWNLOAD AND EXECUTE

    Choose this to download a binary image and execute it.  Applies to SDRAM as destination only. 

    Supports Thumb Mode ARM code only.

    Set OFFSET (hexadecimal value) to the offset from the beginning SDRAM where the image will be

    downloaded.

  • ERASE REGION

    Choose this to erase a region in NAND flash.   

    Set OFFSET (hexadecimal value) to offset from beginning of NAND device where erasing begins. 

    Set SIZE (hexadecimal value) to the number of bytes which will be erased.    Use a multiple of the

    NAND BLOCK size.

  • ERASE ALL

    Choose this to erase the entire NAND flash.


6. IMAGE SELECTION (Edit Box)

    For download operations, you must specify the binary image to be downloaded.  Click the BROWSE

    button to select an XLOADER, U-Boot, Linux Kernel or file system binary image.


    NOTE:

    The default folder that is opened is the "test_data" folder under the Flash application installation folder.

    Do not program any of these example binaries to the NAND device.  You can download any of these

    to SDRAM to test if Flash Tool communication is functional.


7. GO (Button)

    Once you have successfully made your selections, the GO button will be enabled. Click the GO start

    execution of the specified operation.

        

8. ABORT (Button)

    Once the operation is in progress, you will have the option of clicking the ABORT button to cancel it.

    This would be used if communication with the target device fails or if the target board fails to complete

    the peripheral boot process.

9. OUTPUT (Text Window)

    While the operation is in progress, status information is output to the OUTPUT text window.   First a

    message will be displayed to "Please turn off device" (if powered on) and then "Please turn on device".

    At this point you can cycle power to the target EVM or (if already powered on) just press the RESET

    button on the EVM (For Mistral OMAP3 EVM, use the button labelled "OMAP_RST", as shown below.)

     Evm revg reset.JPG 

   The Flash Tool will then automatically perform the following operations, as related status information is

   displayed in the OUTPUT text window:

  • Read the ASIC ID from the target device
  • Download the "2nd Loader"  program" (for communication with Flash Tool)
  • Wait for "2nd Loader" program to start executing on the target board
  • Perform register initializations as specified in the Target Configuration file.
  • Download a software driver for the specific destination memory device
  • Perform the specified Erase or Download operation


   If any errors occur, related information will be displayed in the OUTPUT text window.   Please cut and

   paste the information from the OUTPUT text window if support is needed to diagnose the problem.  

 

10. CLEAR OUTPUT (Button)

      At any time, you may clear the OUTPUT text window by clicking the CLEAR OUTPUT button.

Example 1:  Flashing the AM/DM37x Evaluation Module

For this example, Flash Tool settings are shown for erasing and programming XLOADER, U-BOOT

and the Linux Kernel to NAND flash.   It is assumed here that the image files shown were copied

from the AM37x Sitara SDK from the "<SDK-Install-Dir>/psp/preloaded-images" folder of the Ubuntu

Linux Host.  For the AM37x Sitara SDK v4.0.1.0, the pre-built XLOADER, U-BOOT and Kernel

images are configured to use the 4-Bit BCH algorithm.  (XLOADER must be programmed into

NAND using HWECC 1-BIT ECC, but the code in this XLOADER module expects to read U-BOOT

from NAND using 4-bit BCH.) 


As an alternative, Erase All could be used instead of the three Erase Region operations below. However,

this would also erase the U-Boot parameters partition in NAND. For the erase operations, the ECC

STYLE and ERROR CORRECTION settings are don't cares. They can be left in the default state:

HWECC and 1-bit ECC.


For all of the operations listed below, also use these settings:

CHOOSE TARGET: AM37xx (Hynix)

SELECT TARGET CONNECTION TYPE: USB

CHOOSE THE DESIRED MEMORY TYPE: NAND


 Perform NAND ERASE and NAND DOWNLOAD operations using the parameters shown here:

OPERATION MEMORY OPTIONS OFFSET SIZE IMAGE FILE
Erase Region for XLOADER NON-ONFI            0     80000
Download XLOADER

NON-ONFI,HWECC,1-BIT ECC

           0        N/A MLO-am37x-evm-<version>
Erase Region for UBOOT NON-ONFI     80000     80000
Download UBOOT NON-ONFI, HWECC, 4-BIT BCH     80000        N/A u-boot-am37x-evm-<version>
Erase Region for Linux Kernel NON-ONFI    280000   300000
Download Linux Kernel NON-ONFI, HWECC, 4-BIT BCH    280000        N/A uImage-<version>


XLOADER and U-BOOT may be rebuilt with options to specify other error correction algorithms.   

See Error Correction User Guide for information about how to do that.

  

Example 2:  Flashing the AM3517A Evaluation Module

For this example, Flash Tool settings are shown for erasing and programming XLOADER, U-BOOT

and the Linux Kernel to NAND flash.   It is assumed here that the image files shown were copied

from the AM3517 Sitara SDK from the "<SDK-Install-Dir>/psp/preloaded-images folder" on the

Ubuntu Linux Host.  For the AM3517 Sitara SDK v4.0.1.0, the pre-built XLOADER, U-BOOT and

Kernel images are configured to use the 4-Bit BCH algorithm.  (XLOADER must be programmed into

NAND using HWECC 1-BIT ECC, but the code in this XLOADER module expects to read U-BOOT

from NAND using 4-bit BCH.) 


As an alternative, Erase All could be used instead of the three Erase Region operations below.

However this would also erase the U-Boot parameters partition in NAND. For the erase

operations, the ECC STYLE and ERROR CORRECTION settings are don't cares. They can be left

in the default state: HWECC and 1-bit ECC.


For all of the operations listed below, also use these settings:

CHOOSE TARGET: AM35xx (Micron)

SELECT TARGET CONNECTION TYPE: USB

CHOOSE THE DESIRED MEMORY TYPE: NAND

 

Perform NAND ERASE and NAND DOWNLOAD operations using the parameters shown here:

OPERATION MEMORY OPTIONS OFFSET SIZE IMAGE FILE
Erase Region for XLOADER ONFI            0     80000
Download XLOADER ONFI, HWECC, 1-BIT ECC            0        N/A MLO-am3517-evm-<version>
Erase Region for UBOOT ONFI     80000     80000
Download UBOOT ONFI, HWECC, 4-BIT BCH     80000        N/A u-boot-am3517-evm-<version>
Erase Region for Linux Kernel ONFI    280000   300000
Download Linux Kernel ONFI, HWECC, 4-BIT BCH    280000        N/A uImage-<version>


XLOADER and U-BOOT may be rebuild with options to specify other error correction algorithms.   

See Error Correction User Guide for information about how to do that.

After Programming Flash: Set EVM for NAND Boot Mode

After flash programming has been completed, you need to change the EVM to NAND boot mode

to execute the x-loader and u-boot binaries at boot up from NAND flash. 


For Mistral OMAP EVM (AM37x, DM37x or OMAP35xx devices) 

  • Set SW4 switches #2 and #4 to the ON position and all others OFF. (UART3, NAND boot order)
  • OR set SW4 switches #2, #4 and #6 to the ON position and all others OFF. (NAND, UART3 boot order)
  • Power cycle the EVM


For LogicPD AM3517EVM:

  • Set SW7 switches ALL to the OFF position.  (NAND, EMAC, USB, MMC1 boot order)
  • Power cycle the EVM


Flash v1.4 (Information for Developers)

  • Source Code SVN repository is located on GForge in project Flash (https://gforge.ti.com/gf/project/flash)
  • You can jump directly to this page from the Flash GUI by clicking the "Developers Welcome!" button.

Feedback

Several options exist for feedback:

  • Leave comments using the link at the bottom of the page. For any error conditions, please

    copy and paste the text in the output box into the body of the email. Also, identify your

    target board, processor, and memory types. Provide a synopsis of what you are trying to do.

  • Join the mailing list (arm_mpu_flash_tool@list.ti.com)
  • Join the development effort via the GForge page, and provide feedback there.

Porting Guide

[Remainder of document intended for advanced users]

This is a small porting guide for Flash. It contains an introduction to the modifications that may be necessary in order to get Flash working on a new board or with a new memory device.

Porting to a new platform

In general, porting to a new platform should not require the modification or recompilation of the code base. The starting point will be to create a board configuration file for the new platform.

Existing board configuration files are found in .\Targets\Configurations. In order to add support for a new platform it is recommended to modify configuration_custom_am37xx.txt (used when selecting target "Custom AM37XX Board") or configuration_custom_omap35xx.txt (used when selecting target "Custom OMAP35xx Board".

Once the board configuration file has been created, it will need to be added to the content of omapflash2nd.txt, present in the application installation folder. (NOTE: in the case of the prebuilt custom files, this is already done for you). This file allows Flash to find the board configuration file. When modifying the file, simply add a new line to it:

 <platform> <omap id> <omap version> <omap type> <second loader file> -pheripheralboot_reopen -board_config <board configuration file>

where <platform> is the platform name (use a new name for the new platform), <omap id> is an id number provided by the OMAP device during peripheral boot over UART or USB along with the <omap version> number, <omap type> specifies whether the OMAP detected should be a High Security 'HS' or General Purpose 'GP' type, <second loader file> specifies the second loader to use with the combination of <platform>, <omap id>, <omap version> and <omap type> and the <board configuration file> is the newly added board configuration.

An example could be:

 SDP_MDDR_HYNIX_4G 363007 07 GP Targets\2nd-Downloaders\dnld_startup_omap3_gp_4g.2nd -pheriphalboot_reopen 
 -board_config Targets\Configurations\configuration_sdp3630_hynix_4g.txt

Note that the installation currently comes with second loaders supporting memory sizes of 2 Gb, 4 Gb and 8 Gb for GP and HS devices:

 dnld_startup_omap3_gp_2g.2nd - OMAP3 GP w 2 Gb SDRAM 
 dnld_startup_omap3_gp_4g.2nd - OMAP3 GP w 4 Gb SDRAM
 dnld_startup_omap3_gp_8g.2nd - OMAP3 GP w 8 Gb SDRAM
 dnld_startup_omap3_hs_2g.2nd - OMAP3 HS w 2 Gb SDRAM
 dnld_startup_omap3_hs_4g.2nd - OMAP3 HS w 4 Gb SDRAM
 dnld_startup_omap3_hs_8g.2nd - OMAP3 HS w 8 Gb SDRAM
 dnld_startup_omap4_gp_2g.2nd - OMAP4 GP w 2 Gb SDRAM
 dnld_startup_omap4_gp_4g.2nd - OMAP4 GP w 4 Gb SDRAM
 dnld_startup_omap4_gp_8g.2nd - OMAP4 GP w 8 Gb SDRAM
 dnld_startup_omap4_hs_2g.2nd - OMAP4 HS w 2 Gb SDRAM
 dnld_startup_omap4_hs_4g.2nd - OMAP4 HS w 4 Gb SDRAM
 dnld_startup_omap4_hs_8g.2nd - OMAP4 HS w 8 Gb SDRAM

The reason for this is that there is a link-time dependency on the placement of the heap and external memory for the memory device drivers in SDRAM and on the location of the second loader components in internal memory between HS and GP devices. Pick the right one - e.g. if you have a 4 Gbit memory on an OMAP3 GP based board, use 'dnld_startup_omap3_gp_4g.2nd'.

Board configuration

In order to create the new file it is often useful to start with a copy of one of the existing files. The file has three main sections:

  1. 'use' directive, pointing to a definition file listing a number of OMAP registers and their addresses
  2. 'memory' directives, specifying the memories on the platform
  3. initialization commands, modifying registers to control the configuration of the OMAP to match the platform

Definitions

A 'use' directive can be used to point to a device definition file, e.g.:

 use definitions_omap3.txt

Only one definition file can be used and it must be indicated before the first element using its definitions occurs in the configuration file.  The device definition file basically holds a set of paired of labels and values. The labels can be used in the device configuration file in place of the values in order to make the device configuration file more readable. The  syntax is as follows:

 PRM_CLKSRC_CTRL                           0x48307270
 CM_CLKEN_PLL                              0x48004D00 
 PRM_CLKSEL		                   0x48306D40 
 CM_CLKSEL1_PLL                            0x48004D40 
 CM_CLKSEL2_PLL                            0x48004D44 
 CM_CLKSEL3_PLL                            0x48004D48 

A maximum of 1000 definition pairs can be present in a definition file.

Memories

Memories are specified using the 'memory' directive:

 memory NAME [driver DRIVER] [parameters PARAMETER1 VALUE1 PARAMETER2 VALUE2 ... PARAMETERN VALUEN]

An example of a memory specification could be:

 memory NAND driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 1 address 0x28000000 bberase 0

where the device name is NAND and the driver required to access it is present in the binary file nand_onfi_16bit_8bit.bin (part of this distribution). The driver needs a number of configuration parameters for correct operation. These are passed directly to driver as written on the line following the 'parameters' keyword. This distribution contains a number of driver binaries for various memory types. At present these are:

 File      : nand_onfi_16bit_8bit.bin
 Type      : NAND
 Parameters: gpmc      (mandatory)               Base address of the GPMC in the OMAP
             cs        (mandatory)               Chip select where the device is present (or GPMC-config index)
             address   (mandatory)               Address of the device as mapped in the GPMC
             bberase   (mandatory)               Erase bad blocks in the device (0 for no, 1 for yes). 
                                                 Caution: erasing bad blocks may cause an irreversible loss of manufacturing information.
             onfi      (optional)                Read and use ONFI device description from the device (0 for no, 1 for yes).
             bpp       (mandatory if onfi = 0)   Bytes per page if ONFI information is not used.
             sbpp      (mandatory if onfi = 0)   Spare bytes per page if ONFI information is not used.
             ppb       (mandatory if onfi = 0)   Pages per block if ONFI information is not used
             bpl       (mandatory if onfi = 0)   Blocks per logical unit if ONFI information is not used
             l         (mandatory if onfi = 0)   Logical unit count (only 1 supported by the driver)
             acv       (mandatory if onfi = 0)   Address cycle values - 8 bit value with lower 4 bits for row and upper 4 bits for 
                                                 column.
             f         (mandatory if onfi = 0)   Features - 16 bit value with bit 0 = 16 bit data operation, rest are don't-care

 Examples  : memory NAND driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 1 address 0x28000000 
             bberase 0
             memory NAND driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 1 address 0x28000000 
             bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 4096 l 1 acv 0x23 f 0x0019
             

For SDRAM, no driver is required, but the memory type must be specified with one parameter stating the base address in the memory map, e.g.:

 memory SDRAM parameters address 0x80000000

Initialization of Target Device

A number of register operation commands can be used to configure the target device:

  • WRITE - Write a value to a register
  • MODIFY - Modify the value of a register
  • POLL_ZERO - Poll a register value until zero
  • POLL_NZERO - Poll a register value until not zero
  • POLL_VALUE - Poll a register until value
  • WAIT_N - Loop n times in a simple while-loop (where n is a value from 0x0000 to 0xFFFF)
  • SPIN - Loop forever. This may be used for debugging.
  • MODE_16 - Use 16 bit register access mode
  • MODE_32 - Use 32 bit register access mode

The command structures are:

  • WRITE  : WRITE REGISTER VALUE
  • MODIFY  : MODIFY REGISTER MASK VALUE
  • POLL_ZERO  : POLL_ZERO REGISTER MASK
  • POLL_NZERO  : POLL_NZERO REGISTER MASK
  • POLL_VALUE  : POLL_VAL REGISTER MASK VALUE
  • WAIT_N  : WAIT_N N
  • SPIN  : SPIN
  • MODE_16  : MODE_16
  • MODE_32  : MODE_32

The definitions included from a definition file specified in a 'use' directive can be used with the commands. Definitions can be used for registers, values and masks, e.g.:

 MODIFY        CM_CLKEN_PLL_MPU     EN_XXX_DPLL_MODE_MASK              EN_XXX_DPLL_LOCK_MODE
 WRITE         CM_CLKSEL3_PLL       0x00000009
 POLL_ZERO     CM_IDLEST_CKGEN      ST_PERIPH_CLK_DPLL4_LOCKED