TI Flash and Boot Utilities
Serial Boot and Flash Loading Utility
From Texas Instruments Embedded Processors Wiki
TI Flash and Boot Utilities
These packages (currently available for the DM35x, DM644x, and DM646x) contain a set of utilities, some for running under CCS on Windows, and others for running from the command-line on both Windows and Linux. In these second set of utilities are applications for flashing the NOR and NAND (and in the future SD cards, SPI FLash/EEPROM, I2C EEPROM) of the EVMs via the serial port. All source is included for users who wish to adapt the applications to their own custom platform. The entire project is released under the GPLv2 license.
The Serial Flashing Host Utility (which offers the same functionality as a previous program called DVFlasher) executable is called sfh_<DEVICENAME>.exe, where device name is DM35x, DM644x, or DM646x.
The Serial Loading Host Utility (which offers the same functionality as a previous program called DVLoader) executable is called slh_<DEVICENAME>.exe, where device name is DM35x, DM644x, or DM646x.
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.
The binary UBL in the case of the Serial Flasher program is known as the Serial Flasher Target, or sft. The binary UBL in the case of the Serial Loader program is the Serial Loader Target, or slt. The code for these is present in the directories of the same name.
Other alternatives for RBL UBL and host programs are also available.
Running
- Under Windows - This utilities can be run from the command line under Windows with the .Net Framework 2.0 or later installed.
sfh_<DEVICENAME>.exe [options] slh_<DEVICENAME>.exe [options]
- Under Linux - They can also be run on a Linux machine with the latest open-source Mono Framework installed.
mono sfh_<DEVICENAME>.exe [options] mono slh_<DEVICENAME>.exe [options]
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 DM35x device via the UART boot mode.
Under Windows
The currently supported method is to use the Cygwin environment (such as the one provided with the Montavista Linux tools for Windows) and put the C sharp compiler's (the csc.exe executable) install location in the user's path. This compiler comes with the .NET Framework installation and can usually be found in C:/WINDOWS/Microsoft.NET/Framework/<version number>. Then go to the top level directory of the package and run:
make
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.
Serial Loader Usage
More info can be found by running the utility with the '-h' option.
slh_<DEVICENAME>.exe -h
1) Load a UBL or small UBL-like application to the DM35x IRAM
slh_<DEVICENAME>.exe -load2IRAM <UBL binary file>
2) Load a larger image compiled to run at start of DDR space
slh_<DEVICENAME>.exe -load2DDR <binary application file>
For the load to IRAM option, the file size is limited to 14KB, and the application assumes an entry point address of 0x0100 (the smallest allowed). The entry point address canbe modified by using the -startAddr command line option, with the address specified in hex.
For the load to DDR option, the file size is limited to 32MB, and the application assumes a load address and entry point address of 0x80000000. The entry point address can be altered by using the -startAddr command line option, as with the -load2IRAM case. The load address can be altered from the default by using the -loadAddr command line option
Serial Flasher Usage
More info can be found by running the utility with the '-h' option.
sfh_<DEVICENAME>.exe -h
1) Erase the NAND flash
sfh_<DEVICENAME>.exe -nanderase
2) Flash the NAND with a UBL and u-boot image
sfh_<DEVICENAME>.exe -nandflash <UBL binary file> <binary application file>
The entry point of the UBL is assumed to be 0x0100, but this can be changed by using the -UBLStartAddr option. The entry point and load address of the application default to 0x81080000 (u-boot defaults). To change these values, use the -APPStartAddr and -APPLoadAddr option.
sfh_<DEVICENAME>.exe -nandflash -UBLStartAddr <address> -APPLoadAddr <address> <UBL binary file> <binary application file>
3) Erase the NOR flash
sfh_<DEVICENAME>.exe -norerase
4) Flash the NOR with a UBL and u-boot image
sfh_<DEVICENAME>.exe -norflash <UBL binary file> <binary application file>
The entry point of the UBL is assumed to be 0x0100, but this can be changed by using the -UBLStartAddr option. The entry point and load address of the application default to 0x81080000 (u-boot defaults). To change these values, use the -APPStartAddr and -APPLoadAddr option.
sfh_<DEVICENAME>.exe -norflash -UBLStartAddr <address> -APPLoadAddr <address> <UBL binary file> <binary application file>
5) Flash the NOR with a single u-boot image (old u-boot builds)
sfh_<DEVICENAME>.exe -norflash_noubl <binary application file>
NOTE: Currently, YOU MUST USE THE UBL BINARY CREATED BY THE UBL PROJECT IN THIS PACKAGE. If you use any other UBL binary, the boot procedure will most likely fail.
Other Options for Both Utilities
-p <COM PORT NAME> : Allows specifying com port other than default 'COM1' or '/dev/ttyS0'. -h : Show help text. -v : See verbose output from the DM35x.
Obtaining the software
The latest software can be download from SourceForge by visiting the download page here.
Test Environment
The binaries included in the package were generated under Windows XP SP2 using the .NET Framework v2.0 C# compiler (csc.exe, v8.00.50727.42) and the CodeSourcery arm-none-linux-gnueabi cross compiler (gcc v4.2.3, Sourcery G++ Lite 2008q1-126). The slh and sfh binaries were tested under Windows XP using the .Net framework v2.0 and the Mono Framework for Windows v1.9.1, with a native serial port. Previous versions have been tested under Fedora 7 Linux, using a USB->serial adapter (Prolific PL2303 chipset), running both the Mono 1.2.3 and Mono 1.9.1 Frameworks.
Known Problems
We have had reports of problems when using this utility with a USB to Serial adapter on Ubuntu or Kubuntu 8.04. The data transfer hangs while the CRC is being transmitted to the EVM from the host.
The Mono serial port code for Linux platforms has a major bug that affects Mono 1.2.6 and 1.9.1. This has been fixed in newer versions of Mono (ie 2.0) and some distributions may have backported the fix to older versions of Mono. If not you can fix the Mono write_serial() function in support/serial.c yourself.
- Patch file: File:Mono-fix-linux-serial.patch.gz
- Mono bug report: https://bugzilla.novell.com/show_bug.cgi?id=375580
To fix Mono under Ubuntu 8.04:
sudo -i mkdir mono cd mono apt-get build-dep mono-2.0-devel apt-get source mono-2.0-devel wget http://wiki.davincidsp.com/images/9/93/Mono-fix-linux-serial.patch.gz cd mono-1.2.6+dfsg zcat Mono-fix-linux-serial.patch.gz | patch -p 1 dpkg-buildpackage -b dpkg -i ../libmono0_1.2.6+dfsg-6ubuntu3_i386.deb
This has been tested and works on Ubuntu 8.04 using standard serial ports and USB serial port adapters.
To fix Mono under Ubuntu 9.04:
You can do the above steps, or you can use an unofficial Mono 2.4.2.3 package for Ubuntu 9.04.
License
These tools are provided as freeware, with no guarantee. Issues can be reported to the DaVinci Linux Open Source mailing list.