NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
SPRA549 C5000 TMS320F206 TMS320 C2000 SPRU018 - Datasheet Archive
SPRA549 COFF to DSK Translator Aaron K. Aboagye and Behrang Mohit C5000 DSAG Abstract Development platforms available for digital
Application Report SPRA549 SPRA549 COFF to DSK Translator Aaron K. Aboagye and Behrang Mohit C5000 C5000 DSAG Abstract Development platforms available for digital signal processor (DSP) designers today are mainly the evaluation module (EVM) and the DSP starter kit (DSK). Executable code generated on these two platforms is not compatible and migration from one platform to the other is not straight forward. This application report presents a description of a utility designed to translate the executables produced by the tools used by the two platforms (COFF for EVMs and the DSK for DSKs), to help reduce the amount of work required for migration from one platform to the other. The programming of this utility was done in Borland C+ and testing was done on the White Mountain DSP TMS320F206 TMS320F206 DSK and the Spectrum Digital EVM. Contents Introduction. 2 Definitions. 2 Common Object File Format (COFF) . 2 DSP Starter Kit (DSK) . 2 Translation Algorithm . 3 Using the Translator. 4 COFF-to-DSK Translator . 4 DSK-to-COFF Translator . 4 Error Handling. 4 Testing . 5 Conclusion. 5 Digital Signal Processing Solutions May 1999 Application Report SPRA549 SPRA549 Introduction Currently, there are two major development platforms for DSP designers using the Texas Instruments (TITM) TMS320 TMS320 DSPs. In this application report, we will focus mainly on the C2000 C2000 family of DSPs and the two platforms available, the evaluation module (EVM), produced by Spectrum Digital, and the DSP starter kit (DSK), produced by White Mountain DSP. Inexperienced DSP designers and beginners generally prefer to use the DSK because of its low cost and simple programming. However, the DSK has a limitation in the available on-board memory, 4K of data memory, and this, eventually, causes designers to upgrade to the EVM that features a full 64K of data memory. Both platforms utilize the TI 2xx instruction set for programming but there is a difference in the debugging environment. Development on the EVM requires the programmer to build executables using the 2xx assembler, linker, or compiler available from TI to produce executables conforming to the industry COFF standard. Development on the DSK, on the other hand, requires the programmer to build executables using the tools available with the DSK that produce executables conforming to the TI-tagged object format. This difference in executable formats inhibits a smooth transition back and forth between the two platforms. This application report presents the 2XX COFF-DSK translator and the methodology used to translate executables from one platform to the other. Definitions Common Object File Format (COFF) An implementation of an object file in a binary format that was developed by AT&T. COFF encourages modular programming and provides more powerful and flexible methods for managing code segments and target system memory. The COFF format is based on multiple sections of both program and data memory. DSP Starter Kit (DSK) This kit includes the DSK board, the DSK development tools, and the debugger (Code ExplorerTM). The DSK files are in ASCII format and, unlike COFF, have only two sections: data and program memory. Names of sections and labels are not available in this format. COFF to DSK Translator 2 Application Report SPRA549 SPRA549 Translation Algorithm In this section, the main parts of the translation algorithm will be presented. The source code was written in Borland C+. Detailed descriptions of the COFF and TI-tagged object formats may be obtained from the TMS320C2xx Assembly Language Tools Users Guide (SPRU018 SPRU018). There are two versions of the COFF format, COFF1 and COFF2, and a version flag at the start of each file indicates this version. These flags, C1 and C2, are used by the COFF-to-DSK translator to determine the version and thus, the structure. A few cases were observed where the tools produced files with different version flags and those cases are handled as errors in this version of the utility. The COFF-to-DSK translator works in two stages: it first reads the address information of sections and then it writes the data into the DSK file. Each section in a COFF file has a start address and length and the COFF-to-DSK translator reads this information from the file before the raw data is stripped off. The TI-tagged format only requires start addresses so once the translator has this information, it becomes a simple task of writing the hexadecimal data values into an ASCII file. Another important piece of information is the entry point to the executable code. The COFF file contains this information and is read and written to the DSK file, since it is required in both formats. The DSK-to-COFF translator uses the same two steps as the COFF-to-DSK translator, but generating the binary COFF file is not as simple. This is because the COFF format requires sectional information, which is not readily available in a DSK file. The translator thus has to compute all the required information and build the COFF structured binary file. In writing the translator, it was assumed that any data in the DSK file located between 0x0000 and 0x0040 is an interrupt vector. The TI-tagged format has a checksum at the end of each line of data. The user's guide provides a method to compute this checksum and the translator adheres to this method. It was observed during testing, that the DSK files produced by the DSK tools do not have correct checksums. However, the Code Explorer debugger does not seem to evaluate the checksums and neither does the serial flash loader so it is not a very significant factor for proper functionality. COFF to DSK Translator 3 Application Report SPRA549 SPRA549 Using the Translator Currently, the translation utility comes with two independent translators, COFF to DSK (coff-dsk.exe) and DSK to COFF (dsk-coff.exe). You need to run the appropriate application to perform either translation. COFF-to-DSK Translator Once this application is executed, you will be prompted to do the following: X X Enter the Path and Name of the input COFF file Enter the Path and Name of the output DSK file If the utility is successful in opening the COFF file, the DSK file will be generated under the specified path. In addition to the DSK file, a statistics text file will be generated when you run this program. This file has some information about the input COFF file such as number of words and physical address of each section in the COFF file. This statistics file has the same name and path as your input COFF file with an extension of txt; for example, if the file test.out is translated to test.dsk, the statistics file will be named test.txt. After the translation is successfully done, you may press any key to perform another translation or `q' to quit the program. DSK-to-COFF Translator Once this application is executed, you will be prompted to do the following: X X Enter the Path and Name of the input DSK file Enter the Path and Name of the output COFF file If the utility is successful in opening the DSK file, the COFF file will be generated under the specified path. In addition to the COFF file, a statistics text file will be generated when you run this program. This file has some information about the input DSK file such as number of words and physical address of each section in the COFF file. This statistics file has the same name and path as your input DSK file with an extension of txt; for example, if the file test.dsk is translated to test.out, the statistics file will be named test.txt. After the translation is successfully done, you may press any key to perform another translation or `q' to quit the program. Error Handling In case of an error in the path or name you enter, either program will prompt you to again enter the correct path or name. If you want to quit the program, you can press Ctrl+C any time during execution. In case of an error in your input file, either program will prompt you about the section of your input file that has a problem and the program will then terminate. COFF to DSK Translator 4 Application Report SPRA549 SPRA549 Testing Testing of the translators was done in two stages. The first stage involved translating code written on each of the platforms to the other and running the code on the target platform to verify functionality. The second stage involved translating a DSK file to COFF and then back to DSK to verify that no errors occur and no information is lost between translations. As expected, when this was performed in the other direction, COFF to DSK to COFF, the resulting COFF file had no labels in the code but execution was correct. Conclusion As indicated in the testing section, the first release of the utility has definitely met the objectives even though there is room for improvement. Improvement may include dynamic relocation of interrupt vectors and I/O configurations that will eliminate the need for programmers to manually make these modifications before translation. Time permitting, a better GUI will be provided. COFF to DSK Translator 5 Application Report SPRA549 SPRA549 TI Contact Numbers INTERNET TI Semiconductor Home Page www.ti.com/sc TI Distributors www.ti.com/sc/docs/distmenu.htm PRODUCT INFORMATION CENTERS Americas Phone +1(972) 644-5580 Fax +1(972) 480-7800 Email sc-infomaster@ti.com Europe, Middle East, and Africa Phone Deutsch +49-(0) 8161 80 3311 English +44-(0) 1604 66 3399 Español +34-(0) 90 23 54 0 28 Francais +33-(0) 1-30 70 11 64 Italiano +33-(0) 1-30 70 11 67 Fax +44-(0) 1604 66 33 34 Email epic@ti.com Japan Phone International +81-3-3344-5311 Domestic 0120-81-0026 Fax International +81-3-3344-5317 Domestic 0120-81-0036 Email pic-japan@ti.com Asia Phone International +886-2-23786800 Domestic Australia 1-800-881-011 TI Number -800-800-1450 China 10810 TI Number -800-800-1450 Hong Kong 800-96-1111 TI Number -800-800-1450 India 000-117 TI Number -800-800-1450 Indonesia 001-801-10 TI Number -800-800-1450 Korea 080-551-2804 Malaysia 1-800-800-011 TI Number -800-800-1450 New Zealand 000-911 TI Number -800-800-1450 Philippines 105-11 TI Number -800-800-1450 Singapore 800-0111-111 TI Number -800-800-1450 Taiwan 080-006800 Thailand 0019-991-1111 TI Number -800-800-1450 Fax 886-2-2378-6808 Email tiasia@ti.com Code Explorer and TI are trademarks of Texas Instruments Incorporated. COFF to DSK Translator 6 IMPORTANT NOTICE Texas Instruments and its subsidiaries (TI) reserve the right to make changes to their products or to discontinue any product or service without notice, and advise customers to obtain the latest version of relevant information to verify, before placing orders, that information being relied on is current and complete. All products are sold subject to the terms and conditions of sale supplied at the time of order acknowledgement, including those pertaining to warranty, patent infringement, and limitation of liability. TI warrants performance of its semiconductor products to the specifications applicable at the time of sale in accordance with TI's standard warranty. Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty. Specific testing of all parameters of each device is not necessarily performed, except those mandated by government requirements. CERTAIN APPLICATIONS USING SEMICONDUCTOR PRODUCTS MAY INVOLVE POTENTIAL RISKS OF DEATH, PERSONAL INJURY, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE ("CRITICAL APPLICATIONS"). TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, AUTHORIZED, OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS. INCLUSION OF TI PRODUCTS IN SUCH APPLICATIONS IS UNDERSTOOD TO BE FULLY AT THE CUSTOMER'S RISK. In order to minimize risks associated with the customer's applications, adequate design and operating safeguards must be provided by the customer to minimize inherent or procedural hazards. TI assumes no liability for applications assistance or customer product design. TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right of TI covering or relating to any combination, machine, or process in which such semiconductor products or services might be or are used. TI's publication of information regarding any third party's products or services does not constitute TI's approval, warranty, or endorsement thereof. Copyright © 1999 Texas Instruments Incorporated COFF to DSK Translator 7