Serial Boot and Flash Loading Utility for OMAP-L138

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search


  • Image:Google-16x16.png Search for an article here:


Contents

TI Flash and Boot Utilities

This package contains a set of utilities running from the command-line on Windows for flashing the NAND, NOR, and SPI Flash of the OMAP-L138 EVM via the serial port.

The Serial Flashing Host Utility (which offers the same functionality as a previous program called DVFlasher) executable is called sfh_OMAP-L138.exe.

These programs each encapsulate a distinct binary UBL which is transferred via the UART. This implies that the chip must be operating in the UART boot mode, showing the BOOTME prompt.

NOTE: The assumption is made that the UART of the device operates at 115200, 8N1. If the oscillator used with the device does not match the one used on the EVM (e.g. on a custom platform), the baud rate assumption may be incorrect.

Obtaining the software

The latest source code and binaries can be download from here.

Compiling

A makefile is included for compiling the host and target parts of each utility. The target portions are built first since they are embedded into the the host executables. These target portions are loaded to the OMAP-L138 device via the UART boot mode.

Note that the pre-built executables have been tested to work on the EVMs. It is not necessary to rebuild them unless changes need to be made for a custom board.

Under Windows

Please see the following page for detailed instructions for rebuilding the utilities in included in this package:

http://processors.wiki.ti.com/index.php/Rebuilding_the_Flash_and_Boot_Utils_Package

Under Linux

The Mono Framework must be installed and in the path. RPMs are available at 'http://www.mono-project.com/Downloads'. Then go to the top level directory of the package and run:

    make
 

The above instructions assume the that GNU ARM cross-compiler tools (arm-none-linux-gnueabi-gcc, etc.) are in the current PATH.

Running

Under Windows

This utility can be run from the command line under Windows with the .Net Framework 4.0 or later installed through the following steps:

  1. Set the boot pins to UART2 boot mode. This is done by setting switch S7 on the OMAP-L138 EVM according to the following table:
    Pin# 1 2 3 4 5 6 7 8
    Position OFF OFF OFF OFF OFF OFF ON ON
  2. Connect a serial cable from the host computer to the OMAP-L138 EVM
  3. Open a command prompt on the host computer and change directory to where the SFH executable is located.
  4. Run the flashing utility with this command:
    • ..\OMAP-L138\gnu\sfh_OMAP-L138.exe [options]
  5. Turn on the board

Under Linux

The serial flasher can be run on a Linux machine with the latest open-source Mono Framework installed. The steps are identical to the Windows environment except the command:

  • mono ./sfh_OMAP-L138.exe [options]

Serial Flasher Options

There are three modes for using the serial flasher:

  1. Erase the target flash type - This will erase the entire contents of the flash.
    • ..\sfh_OMAP-L138.exe -erase
  2. Flash the memory with a single application image - This will place an application image at address 0x0 of the flash.
    • ..\sfh_OMAP-L138.exe -flash_noubl <binary application file>
  3. Flash the memory with a UBL and application image - This will place a UBL at address 0x0 of the flash and an application image, such as u-boot, at address 0x10000.
    • ..\sfh_OMAP-L138.exe -flash <UBL binary file> <binary application file>

Note: Only the UBL found in the OMAP-L138/GNU/UBL directory can be used with the serial flasher. Other UBLs are not compatible with the serial flasher format.

Currently, the only supported flash types are NAND, NOR, and SPI.

Additional options are shown below:

  -targetType         : Specifies exact target type within OMAP-L138 family (default OMAP-L138)
  -flashType          : Specifies exact flash type (default SPI_MEM)
  -p <COM PORT NAME>  : Allows specifying com port other than default 'COM1' or '/dev/ttyS0'.
  -h                  : Show help text.
  -v                  : See verbose output from target device
  -baud <BAUD RATE>   : Allows specifying baud rate other than default (115200)
  -APPStartAddr       : Changes entry point of application (default 0xC1080000)
  -APPLoadAddr        : Changes load address of application (default 0xC1080000)

Once any command is run, the "Waiting for BOOTME..." prompt shows. Power cycle the board or press the reset button to continue.

Restoring the OMAP-L138 EVM SPI Flash

If the contents of the OMAP-L138 SPI flash become corrupted, they can be restored through the following steps:

  1. Set the boot pins to UART2 boot mode. This is done by setting switch S7 on the OMAP-L138 EVM according to the following table:
Pin# 1 2 3 4 5 6 7 8
Position OFF OFF OFF OFF OFF OFF ON ON
  1. Obtain the UBL and u-boot binary files and place them in the same directory as the SPI flashing utility.
    • A pre-built UBL bin file is located in the OMAP-L138/GNU/ubl/ directory of this serial flashing project. The UBL bin file from the PSP installation will also work, located at images/u-boot/.
    • A pre-built u-boot image is located in the images/u-boot/ directory of the PSP installation.
  2. Run the following command to flash the UBL and u-boot binary files:
    • ..\sfh_OMAP-L138.exe -flash <UBL binary file> <u-boot binary file>
    • Note that if the serial port is not on COM1, the correct port must be specified using the "-p" option. To determine which COM port to use, open HyperTerminal, connect to one of the ports, and make sure the word "BOOTME" appears when the EVM is reset.
  3. Turn on the board
  4. After the UBL and u-boot files have been flashed, set the boot pins to SPI boot mode and reboot the board. This is done by setting switch S7 on the OMAP-L138 EVM according to the following table:
Pin# 1 2 3 4 5 6 7 8
Position OFF OFF OFF OFF OFF OFF OFF OFF
  1. Once u-boot has loaded, follow the instructions in the Getting Started Guide to copy the Linux kernel and filesystem to the SPI flash.
    • Booting from SPI Flash
    • Note: This step requires that the setup procedures in the Getting Started guide have been followed:

Considerations for Custom Boards

The default settings used by the tools apply only to the EVMs. For custom boards, changes will most likely be required, and the tools must be rebuilt. The custom changes should be made to the files in the OMAP-L138/Common/src and OMAP-L138/Common/include directories. Common changes include:

  • DDR Configuration
    • device.c: Modify the parameters passed to the function DEVICE_ExternalMemInit to match the DDR timing requirements for the custom board
  • UART Settings
    • device_uart.h: Modify the #define DEVICE_UART_PERIPHNUM to set which UART is connected to the host PC.
  • SPI Settings
    • device_spi.h: Modify the global macros to select the appropriate peripheral and chip select numbers.

License

These tools are provided as freeware, with no guarantee.


For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Serial Boot and Flash Loading Utility for OMAP-L138 here.
Leave a Comment

Comments

Comments on Serial Boot and Flash Loading Utility for OMAP-L138


Jheoaustin said ...

Can this be used to flash linux kernel instead of going through complex steps of setting up Linux host, shared file system, exporting part of PSPs, etc.?

--Jheoaustin 22:33, 28 March 2010 (CDT)

Personal tools