Getting Started Guide PSP 03.00.00 Nov 20, 2009 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI's terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI's standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed. TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions: Products Applications Amplifiers amplifier.ti.com Audio Data Converters dataconverter.ti.com Automotive www.ti.com/automotive DSP dsp.ti.com Broadband www.ti.com/broadband Interface interface.ti.com Logic logic.ti.com Power Mgmt power.ti.com Microcontrollers microcontroller.ti.com Low Power Wireless www.ti.com/lpw Digital Control Military Optical Networking Security Telephony Video & Imaging Wireless 2 www.ti.com/audio www.ti.com/digitalcontrol www.ti.com/military www.ti.com/opticalnetwork www.ti.com/security www.ti.com/telephony www.ti.com/video www.ti.com/wireless Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 EVALUATION BOARD/KIT IMPORTANT NOTICE Texas Instruments (TI) provides the enclosed product(s) under the following conditions: This evaluation board/kit is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, OR EVALUATION PURPOSES ONLY and is not considered by TI to be a finished end-product fit for general consumer use. Persons handling the product(s) must have electronics training and observe good engineering practice standards. As such, the goods being provided are not intended to be complete in terms of required design-, marketing-, and/or manufacturing-related protective considerations, including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards. This evaluation board/kit does not fall within the scope of the European Union directives regarding electromagnetic compatibility, restricted substances (RoHS), recycling (WEEE), FCC, CE or UL, and therefore may not meet the technical requirements of these directives or other related directives. Should this evaluation board/kit not meet the specifications indicated in the User's Guide, the board/kit may be returned within 30 days from the date of delivery for a full refund. THE FOREGOING WARRANTY IS THE EXCLUSIVE WARRANTY MADE BY SELLER TO BUYER AND IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. The user assumes all responsibility and liability for proper and safe handling of the goods. Further, the user indemnifies TI from all claims arising from the handling or use of the goods. Due to the open construction of the product, it is the user's responsibility to take any and all appropriate precautions with regard to electrostatic discharge. EXCEPT TO THE EXTENT OF THE INDEMNITY SET FORTH ABOVE, NEITHER PARTY SHALL BE LIABLE TO THE OTHER FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES. TI currently deals with a variety of customers for products, and therefore our arrangement with the user is not exclusive. TI assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein. Please read the User's Guide and, specifically, the Warnings and Restrictions notice in the User's Guide prior to handling the product. This notice contains important safety information about temperatures and voltages. For additional information on TI's environmental and/or safety programs, please contact the TI application engineer or visit www.ti.com/esh. 3 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 No license is granted under any patent right or other intellectual property right of TI covering or relating to any machine, process, or combination in which such TI products or services might be or are used. Mailing Address: Texas Instruments Post Office Box 655303 Dallas, Texas 75265 Copyright © 2009, Texas Instruments Incorporated FCC Warning This evaluation board/kit is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, OR EVALUATION PURPOSES ONLY and is not considered by TI to be a finished end-product fit for general consumer use. It generates, uses, and can radiate radio frequency energy and has not been tested for compliance with the limits of computing devices pursuant to part 15 of FCC rules, which are designed to provide reasonable protection against radio frequency interference. Operation of this equipment in other environments may cause interference with radio communications, in which case the user at his own expense will be required to take whatever measures may be required to correct this interference. 4 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 Preface About This Guide This Getting Started Guide (GSG) provides a brief overview of the PSP SDK software package and steps for installation and further usage. Notational Conventions This document uses the following conventions: Program listings, program examples, and interactive displays are shown in a mono-spaced font. Examples use bold for emphasis, and interactive displays use bold to distinguish commands that you enter from items that the system displays (such as prompts, command output, error messages, etc.). Square brackets ( [ and ] ) identify an optional parameter. If you use an optional parameter, you specify the information within the brackets. Unless the square brackets are in a bold typeface, do not enter the brackets themselves. 5 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 Trademarks The Texas Instruments logo and Texas Instruments are registered trademarks of Texas Instruments. Trademarks of Texas Instruments include: TI, OMAP, the OMAP logo, XDS, Code Composer, Code Composer Studio, Probe Point, Code Explorer, DSP/BIOS, RTDX, Online DSP Lab, OMAP, TMS320, TMS320C54x, TMS320C55x, TMS320C62x, TMS320C64x, TMS320C67x, TMS320C5000, and TMS320C6000. MS-DOS, Windows, and Windows NT are trademarks of Microsoft Corporation. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a registered trademark of Linus Torvalds. CodeSourcery and CodeSourcery’s Sourcery G++ are trademarks or registered trademarks of CodeSourcery, Inc. Solaris, SunOS, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. All other brand, product names, and service names are trademarks or registered trademarks of their respective companies or organizations. 6 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 Revision History: Rev No. Changes Date 1.0 Initial Release Sept 30, 2009 1.1 Update for AM3517 Nov 20,2009 7 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 Table of contents 1 Overview...............................................................................................................................................10 1.1 1.1.1 What’s in the kit?....................................................................................................................10 1.1.2 What is on the board?............................................................................................................11 1.1.3 EVM Switch Settings..............................................................................................................11 1.2 2 What’s in the kit?....................................................................................................................12 1.2.2 What is on the board?............................................................................................................13 1.2.3 Identifying Board Variations ...................................................................................................14 1.2.4 EVM Switch Settings..............................................................................................................17 1.3 SDK Contents ..........................................................................................................................19 1.4 Updates & Further information.................................................................................................22 Software Setup .....................................................................................................................................23 2.1 Requirements...........................................................................................................................23 2.2 Extracting the Software ............................................................................................................23 2.3 Installing the Toolchain ............................................................................................................23 3.1.1 5 Setting up the Toolchain ........................................................................................................24 Updating the Flash Image ....................................................................................................................25 3.1 4 OMAP3530 EVM......................................................................................................................12 1.2.1 2.3.1 3 AM3517 EVM ...........................................................................................................................10 Using U-boot to update the Flash Memory ..............................................................................25 Running the Re-flash Procedure ...........................................................................................25 Rebuilding the Software .......................................................................................................................28 4.1 Rebuilding U-boot ....................................................................................................................28 4.2 Rebuilding the Linux Kernel .....................................................................................................29 4.3 Rebuilding the Initial NAND X-loader.......................................................................................29 4.4 Rebuilding the NFS Image.......................................................................................................30 4.5 Rebuilding the Full Ramdisk Image .........................................................................................31 4.6 Rebuilding the JFFS2 File-System Image ...............................................................................32 EVM Operation .....................................................................................................................................33 5.1 Using Telnet .............................................................................................................................33 5.2 Booting the New Linux Kernel..................................................................................................33 5.2.1 Checking the TFTP server setup in the Linux development PC............................................33 5.2.2 Using TFTP to boot the New Linux Kernel ............................................................................34 5.2.3 Flashing the New Linux Kernel ..............................................................................................35 5.3 Changing Options in U-boot.....................................................................................................35 5.4 Exporting an NFS Root File-System ........................................................................................36 8 Document PSP 03.00.00 Getting Started Guide Document Number 9 Rev 1.1 Date Nov 20, 2009 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1 Overview This chapter introduces the PSP Software Development Kit for AM3517 & OMAP3530 EVMs. 1.1 AM3517 EVM 1.1.1 What’s in the kit? The kit comes with the following hardware pieces: • AM3517™ Evaluation Module Target Board • USB cable • Serial Cable • Ethernet Cable • Universal Power supply and power cords The Software development kit can be downloaded from the PSP Update Advisor Webpage. Installation and use of the Software Development Kit is described in this document. This document assumes the use of the LITE version of CodeSourcery tools. This version is an unrestricted command line toolchain available free of charge from the CodeSourcery web site (see Section “Installing the Toolchain”). 10 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1.1.2 What is on the board? The following block diagram shows the major hardware components present on the AM3517 EVM: 1.1.3 EVM Switch Settings The AM3517EVM main board’s S7 DIP switch controls the boot mode of AM3517 processor. By default the EVM boots from the NAND. To change the default behavior and to boot from the MMC/SD card, S7-1 and S7-4 should be set in the ON position. 11 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1.2 OMAP3530 EVM 1.2.1 What’s in the kit? The kit comes with the following hardware pieces: • OMAP3530™ Evaluation Module Target Board o Includes dual-mode touch screen LCD display and stylus • USB cable • Serial Cable • Ethernet Cable • Universal Power supply and power cords The Software development kit can be downloaded from the PSP Update Advisor Webpage. Installation and use of the Software Development Kit is described in this document. This document assumes the use of the LITE version of CodeSourcery tools. This version is an unrestricted command line toolchain available free of charge from the CodeSourcery web site (see Section “Installing the Toolchain”). 12 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1.2.2 What is on the board? The following block diagram shows the major hardware components present on the OMAP3530 EVM: GPMC, Camera, I2C and ETM DVI Connector DVI Transmitter McBSP, UART, SPI, MMC, DSS Level Shifter EXPN Connectors OMAP3530 UART1 3.7” LCD with TP Level Shifter DSS PORT1 UART2 Touch Screen Controller RJ45 LAN9115 UART3 SPI PoP Memory Level GPMC Shifter PORT2 V-DAC CVBS S-Video MMC Connector MMC1 JTAG ETM ISP1504 Selection ULPI I2C McBSP Audio In USB Connector Keypad (15 keys) Audio Out TW4030 Power Section Power ON BATT DC-IN 13 AC CHRG Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1.2.3 Identifying Board Variations There are two variations of the 3530 EVM that have been produced: OMAP3EVM (Rev D) and OMAP3EVM2 (Rev G). Likewise there are two versions of the Processor card: ES2.1 Si with Nand/Onenand and ES3.1 Si with Nand. Both use the package on package configuration, which places the memory part on top of the OMAP processor. The following section will help you identify the 3530 EVM you are working with. 14 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 Samsung Memory Micron Memory Processor Board Sticker O3530-PB-nnnn O3530-PB-nnnn-M DDR 128 Mbytes 128 Mbytes Flash 128 Mbytes OneNAND 256 Mbytes NAND Processor Board Sticker O3530-PBxx-yyyy-M2 DDR 256 Mbytes Flash 256 Mbytes NAND 15 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 Different settings are used for the 3530 EVM main board SW4 switch for the two board variations. The switch setting adjusts the SYS_BOOT signals to the OMAP processor that select the boot processing performed by the OMAP Boot-ROM. In addition, the other system software (x-loader, u-boot, Linux kernel) uses these switch settings to identify which type of memory is used on the board. 16 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1.2.4 EVM Switch Settings Samsung Micron The 3530 main board’s SW4 DIP switch controls the boot mode of OMAP3 processor. The default setting shown above will try to boot from UART3. If no response is seen in a short time (< 1s) the processor will attempt to boot from the attached flash memory. Consult the Hardware User’s Guide for details and for other settings. Please ensure to match the numbers in the diagram to the numbers on the DIP switch as the orientation of the switch may not be what you expect. SW4-7 Samsung OneNAND SW4-8 BOOT_ UART UART/Flash OFF OFF Flash/UART OFF OFF MMC OFF OFF SW4-8 BOOT_ UART SW4-7 UART/Flash OFF OFF Flash/UART OFF OFF MMC OFF OFF OFF Micron NAND Not used Not used SW4-6 SYS_BOOT 5 SW4-5 SYS_BOOT 4 SW4-4 SYS_BOOT 3 SW4-3 SYS_BOOT 2 SW4-2 SYS_BOOT 1 SW4-1 SYS_BOOT 0 OFF OFF ON OFF OFF ON ON OFF ON OFF OFF ON OFF ON ON OFF OFF ON SW4-6 SYS_BOOT 5 SW4-5 SYS_BOOT 4 SW4-4 SYS_BOOT 3 SW4-3 SYS_BOOT 2 SW4-2 SYS_BOOT 1 SW4-1 SYS_BOOT 0 OFF OFF ON OFF ON OFF ON OFF ON OFF ON OFF OFF OFF ON ON ON Note: Switch OFF == logic 1 and Switch ON == logic 0. The DIP switch on the processor module controls various signal routing choices. Please be sure it matches the diagram below for normal operation. SW1 must be configured differently to use a JTAG emulator with the EVM. Consult the Hardware User’s Guide for more detail. 17 Document PSP 03.00.00 Getting Started Guide Document Number 18 Rev 1.1 Date Nov 20, 2009 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1.3 SDK Contents The SDK comes as compressed tar archive. The contents can be extracted using the following command # tar xvfz OMAP35x-PSP-SDK-MM.mm.pp.bb.tgz The extracted directory structure looks like: 19 Document PSP 03.00.00 Getting Started Guide Document Number ~---OMAP35x-PSP-SDK-MM.mm.pp.bb | Software-manifest.html | Arago-FS-Software-manifest.html +---docs | |-- Building-RootFs-Arago.html | |-- GettingStarted-PSP.pdf | |-- omap3517 | | |-- DataSheet-MM.mm.pp.bb.pdf | | |-- MigrationGuide-MM.mm.pp.bb.pdf | | |-- ReleaseNotes-MM.mm.pp.bb.pdf | | `-- UserGuide-MM.mm.pp.bb.pdf | |-- omap3530 | | |-- DataSheet-MM.mm.pp.bb.pdf | | |-- MigrationGuide-MM.mm.pp.bb.pdf | | |-- ReleaseNotes-MM.mm.pp.bb.pdf | | `-- UserGuide-MM.mm.pp.bb.pdf +---host-tools | |-- linux | | `-- signGP | |-- src | | `-- signGP.c |-- images | |-- boot-strap | | |-- omap3517 | | | `-- x-load.bin.ift | | |-- omap3530 | | | `-- x-load.bin.ift | |-- fs | | |-- nfs-base.tar.gz | | |-- ramdisk-base.gz | | |-- rootfs-base.jffs2 | | |-- omap3517 | | | |-- nfs.tar.gz | | | |-- ramdisk.gz | | | `-- rootfs.jffs2 | | |-- omap3530 | | | |-- nfs.tar.gz | | | |-- ramdisk.gz | | | `-- rootfs.jffs2 | |-- kernel | | |-- omap3517 | | | `-- uImage | | |-- omap3530 | | | `-- uImage | |-- u-boot | | |-- omap3517 | | | `-- u-boot.bin | | |-- omap3530 | | | `-- u-boot.bin |-- scripts | |-- omap3517 | | |-- Readme.txt | | |-- initenv-micron.txt | | `-- reflash-micron.txt | |-- omap3530 | | |-- Readme.txt | | |-- initenv-micron.txt 20 Rev 1.1 Date Nov 20, 2009 Document PSP 03.00.00 Getting Started Guide Document Number | | | |-| | | | | | | | | | | | | | | | | | | | | | | | | `-- | | | src |-| | | | | | |-| |-| | | | | | | |-- Rev 1.1 Date Nov 20, 2009 |-- initenv-samsung.txt |-- reflash-micron.txt `-- reflash-samsung.txt boot-strap |-- ChangeLog-MM.mm.pp.bb |-- ShortLog |-- Unified-patch-MM.mm.pp.bb.gz |-- diffstat-MM.mm.pp.bb |-- x-loader-patches-MM.mm.pp.bb.tar.gz `-- x-loader-MM.mm.pp.bb.tar.gz examples `-- examples.tar.gz kernel |-- ChangeLog-MM.mm.pp.bb |-- Readme.txt |-- ShortLog |-- diffstat-MM.mm.pp.bb |-- Unified-patch-MM.mm.pp.bb.gz |-- kernel-patches-MM.mm.pp.bb.tar.gz `-- linux-MM.mm.pp.bb.tar.gz u-boot |-- ChangeLog-MM.mm.pp.bb |-- Readme.txt |-- ShortLog |-- Unified-patch-MM.mm.pp.bb.gz |-- diffstat-MM.mm.pp.bb |-- u-boot-MM.mm.pp.bb.tar.gz `-- uboot-patches-MM.mm.pp.bb.tar.gz test-suite `-- lftb-MM.mm.pp.bb.tar.gz Note: The values of MM, mm, pp and bb in this illustration will vary across the releases and actually depends on individual component versions. 21 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 1.4 Updates & Further information Once registered you will be able to find software and documentation updates at: www.ti.com/omapsoftwareupdates A wiki based information site is available. User contributions are encouraged. http://wiki.omap.com/index.php?title=OMAP3_Overview For technical support please post your questions at http://e2e.ti.com 22 Document PSP 03.00.00 Getting Started Guide Document Number 2 Rev 1.1 Date Nov 20, 2009 Software Setup 2.1 Requirements The following are the requirements for software setup: • • PC Linux Host o Root login or liberal sudo privileges o Most Linux Distributions should work with this SDK SDK Release Package 2.2 Extracting the Software Extract the software using the following command: $ tar xzvf OMAP35x-PSP-SDK-MM.mm.pp.bb.tgz –C $HOME/ It will extract the SDK software in the directory specified by the user. After doing so, the directory will contain the file structure as documented in Section “SDK Contents” 2.3 Installing the Toolchain This guide assumes use of the LITE version of the CodeSourcery toolchain. This version is an unrestricted command line toolchain available free of charge from the CodeSourcery web site. Alternatively, a full featured IDE 30 Day time limited version of Sourcery G++ can be downloaded from Codesourcery website. The toolchain used is ARM GNU/Linux 2009q1. It can be downloaded via the following URL: http://www.codesourcery.com/sgpp/lite/arm/portal/release858 (Choose IA32 GNU/Linux Installer prebuilt binary) 23 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 To install the toolchain, follow the sequence below: $ sudo mkdir –p /opt/omap-evm/toolchain $ sudo cp arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 /opt/omap-evm/toolchain $ cd /opt/omap-evm/toolchain $ sudo tar –jxvf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linuxgnu.tar.bz2 $ sudo rm arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 2.3.1 Setting up the Toolchain Add the /opt/omap-evm/toolchain/arm-2009q1/bin directory to your path. This is typically done by adding an additional line to your shell resource file (~/.bashrc). Open the shell resource file with your text editor(E.g. run “# vim ~/.bashrc). Add the following to your .bashrc file: $ export PATH=/opt/omap-evm/toolchain/arm-2009q1/bin:$PATH This adds the CodeSourcery tools to your path and allows you to execute the tools using arm-nonelinux-gnueabi-gcc (or other tools in the tool chain) from any directory. You can test that the toolchain is installed correctly by starting a new shell and using the following command: $ arm-none-linux-gnueabi-gcc –v The example output will be as shown below. Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /scratch/mitchell/builds/4.3-arm-none-linux-gnueabirespin/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pclinux-gnu --target=arm-none-linux-gnueabi --enable-threads --disablelibmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as -with-gnu-ld --with-specs='%{funwind-tables|fno-unwindtables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' --enablelanguages=c,c++ --enable-shared --enable-symvers=gnu --enable__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q1-203' --withbugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls -prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-nonelinux-gnueabi/libc --with-build-sysroot=/scratch/mitchell/builds/4.3arm-none-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabirespin/lite/obj/host-libs-2009q1-203-arm-none-linux-gnueabi-i686-pclinux-gnu/usr --with-mpfr=/scratch/mitchell/builds/4.3-arm-none-linuxgnueabi-respin/lite/obj/host-libs-2009q1-203-arm-none-linux-gnueabii686-pc-linux-gnu/usr --disable-libgomp --enable-poison-systemdirectories --with-build-time-tools=/scratch/mitchell/builds/4.3-armnone-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/bin -with-build-time-tools=/scratch/mitchell/builds/4.3-arm-none-linuxgnueabi-respin/lite/install/arm-none-linux-gnueabi/bin Thread model: posix gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) 24 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 3 Updating the Flash Image This section describes how to install software images onto the flash memory on the EVM. This procedure can be used to install an updated version of the software from TI or to install a customized version built by the customer. 3.1 Using U-boot to update the Flash Memory With u-boot running on the target, you can use it to update any or all of the software in flash. The steps provided here will use the Ethernet connection (directly connected to your Host PC using cross cable or connected through a Hub/Switch) with the TFTP protocol to transfer the files. Install TFTP server of your choice on the Host development machine. Once installed ensure that the SDK installation folder is set as the base folder for TFTP exports. Note: The re-flash scripts erase the flash and then re-program the images downloaded over TFTP. Hence verify that the TFTP setup is functional before running the re-flash scripts.(refer Section 5.2.1). As a fallback option one can boot from MMC/SD if the boot loader images are inadvertently corrupted.(refer Section 2.5 of PSP UserGuide from the SDK docs/ folder) 3.1.1 Running the Re-flash Procedure 1) Ensure that the terminal program is configured with ~300 ms of delay after sending each line. 2) Ensure the environment is set as appropriate for your EVM and network setup. This is a typical setting for a static IP address. OMAP-EVM # setenv ethaddr 00:50:c2:XX:XX:XX (see sticker on EVM) OMAP-EVM # setenv ipaddr 192.168.1.10 (as appropriate) OMAP-EVM # setenv serverip 192.168.1.100 (TFTP Server PC’s addr) OMAP-EVM # setenv netmask 255.255.255.0 (as appropriate) OMAP-EVM # setenv gatewayip 192.168.1.1 (if needed) OMAP-EVM # saveenv 3) The windows IP address can be obtained using the following steps a. Go to Start->Run b. Type cmd to open the command window c. Type ipconfig on command prompt to get the IP address of the Windows host PC 4) Check the IP settings OMAP-EVM # ping $(serverip) (expect “x.x.x.x is alive”) 5) AM3517 EVM: a. Use the terminal program to send the reflash-micron.txt script to the EVM i. path: OMAP35XPSP-SDK-MM.mm.pp.bb/scripts/omap3517/ 1. reflash-micron.txt (for Micron memory boards) ii. For HyperTerminal, use Transfer / Send Text File …; for Teraterm, use File / Send file … ; for minicom, use the paste file command (Ctrl-A Y). 25 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 OMAP3530 EVM: a. Use the terminal program to send the reflash-xxx.txt script to the EVM, where xxx is either samsung or micron depending upon the Samsung or Micron NAND flash used on the board. i. Make sure you know if your board has Samsung or Micron memory parts (See Section 1.2.2 “What is on the board?”) ii. path: OMAP35XPSP-SDK-MM.mm.pp.bb/scripts/omap3530/ 1. reflash-micron.txt (for Micron memory boards) 2. reflash-samsung.txt (for Samsung memory boards) iii. For HyperTerminal, use Transfer / Send Text File …; for Teraterm, use File / Send file … ; for minicom, use the paste file command (Ctrl-A Y). 6) Run the reflash command sequence. Note 1: Ramdisk should be used as JFFS produces warnings and very long boot times. Note 2: The initenv-xxx.txt scripts assume JFFS is used for Samsung and Ramdisk is used for Micron. To adjust the settings, see section 5.3 “Changing Options in U-boot”. For Micron Nand, use the following commands OMAP-EVM # run rf_all_fs_new (for jffs file-system) OMAP-EVM # run rf_all_rd_new (for ramdisk) For Samsung Onenand, use the following commands OMAP-EVM # run rf_all_fs (for jffs file-system) OMAP-EVM # run rf_all_rd (for ramdisk) (Individual components can be reflashed by using commands like rf_ub, rf_kn, etc) 7) Reset the board Note: The current U-boot only allows 40 environment variables. Do not saveenv after the reflash script has been submitted. Instead complete the reflash and reboot before making env changes. 8) AM3517 EVM: a. Use the terminal program to send the initenv-micron.txt script to the EVM. i. path: OMAP35XPSP-SDK-MM.mm.pp.bb/scripts/omap3517/ 1. initenv-micron.txt (for Micron memory boards) OMAP3530 EVM: 26 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 a. Use the terminal program to send the initenv-xxx.txt script to the EVM, where xxx is either samsung or micron depending upon the Samsung or Micron NAND flash used on the board. i. path: OMAP35XPSP-SDK-MM.mm.pp.bb/scripts/omap3530/ 1. initenv-micron.txt (for Micron memory boards) 2. initenv-samsung.txt (for Samsung memory boards) 9) Save the environment OMAP-EVM # saveenv 10) Reset the board and it should boot into the kernel and file-system 27 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 4 Rebuilding the Software This section describes how to rebuild pieces of the software delivery. Ensure that the toolchain setup and install has been completed (see Section “Installing the Toolchain”). Some of the makefiles build development host utilities in the process of building the target content. For these steps to complete correctly the Linux host must be capable of compiling host programs. Most Linux distributions will have this capability by default. However, some Ubuntu distributions are not setup this way initially. The following should work on any Ubuntu derivative: $ sudo apt-get install build-essential libncurses5-dev mtd-tools 4.1 Rebuilding U-boot Rebuilding the U-boot is described in more detail in the User’s Guide. For AM3517 EVM: OMAP35x-PSP-SDK-MM.mm.pp.bb/docs/omap3517/UserGuide-MM.mm.pp.bb.pdf For OMAP3530 EVM: OMAP35x-PSP-SDK-MM.mm.pp.bb/docs/omap3530/UserGuide-MM.mm.pp.bb.pdf Untar the U-Boot source archive from the src/u-boot/ directory of the SDK: $ tar -zxvf u-boot-MM.mm.pp.bb.tar.gz To configure U-Boot, issue the following commands: $ cd u-boot-MM.mm.pp.bb/ $ make omap3517_evm_config (for 3517 EVM) OR $ make omap3_evm_config (for 3530 EVM) Once ready to build U-Boot, run the command: $ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- Resulting U-Boot image namely “u-boot.bin” will be in the current directory, ready to be loaded on the target. 28 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 4.2 Rebuilding the Linux Kernel Rebuilding the kernel is described in more detail in the User’s Guide. For AM3517 EVM: OMAP35XPSP-SDK-MM.mm.pp.bb/docs/omap3517/UserGuide-MM.mm.pp.bb.pdf For OMAP3530 EVM: OMAP35XPSP-SDK-MM.mm.pp.bb/docs/omap3530/UserGuide-MM.mm.pp.bb.pdf Note that building the kernel requires using mkimage, a host side utility built by the u-boot Makefile. You will need to build U-boot and place mkimage in your Path. If you are using a bash shell, Open the shell resource file with your text editor (E.g. run “# vim ~/.bashrc). Add the following to your .bashrc file: export PATH=<path to Uboot>/tools:$PATH After making the modifications to the .bashrc file, make sure you perform the following step for the change to take effect in the current session. $ source ~/.bashrc Untar the Linux kernel source archive from the src/kernel/ directory of the SDK: $ tar -zxvf linux-MM.mm.pp.bb.tar.gz To configure kernel, issue these commands: $ cd linux-MM.mm.pp.bb/ $ make omap3517_evm_defconfig (for 3517 EVM) OR $ make omap3_evm_defconfig (for 3530 EVM) If you need to make changes to the default configuration, you can run: $ make menuconfig Once ready to build the kernel, run: $ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage The resulting kernel image uImage will be placed under arch/arm/boot and is ready to be loaded on the target. 4.3 Rebuilding the Initial NAND X-loader Untar the X-Loader source archive from ti-linux/boot-strap directory of the SDK: $ tar -zxvf x-loader-MM.mm.pp.bb.tar.gz 29 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 Configure X-Loader: $ cd x-loader-MM.mm.pp.bb $ make omap3517evm_config (for 3517 EVM) OR $ make omap3evm_config (for 3530 EVM) To build X-Loader, run the command: $ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- The above command produces the x-load.bin file, but in order for the X-Loader to be loaded by the ROM bootloader, it needs to be signed with the signGP program from the host-tools/bin directory: $ ../../../host-tools/linux/signGP x-load.bin Resulting signed X-loader is named x-load.bin.ift and should be ready for the target. Note: For MMC/SD Card boot loading, this file must be renamed as MLO. $ cp x-load.bin.ift MLO 4.4 Rebuilding the NFS Image In order to prepare a directory to be used as NFS file-system on the target, follow the steps below. It is recommended to perform these commands with root permissions, as it would be easier to manage special files, such as device nodes. Create an empty directory: # mkdir –p $HOME/filesystem Untar the nfs.tar.gz file from images/fs/omap3517 or images/fs/omap3530 directory of SDK, depending on the EVM: $ sudo tar -xvfz nfs.tar.gz –C $HOME/filesystem This nfs tar file comes with several pre-built packages, arranged in an appropriate hierarchy. Upon extraction, user should be able to see the complete directory structure in the folder mentioned above. User can also populate this NFS directory with his own package(s) by issuing the following commands: # sudo tar -zxvf user_package_01.tar.gz -C $HOME/filesystem # sudo tar -zxvf user_package_02.tar.gz -C $HOME/filesystem 30 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 After doing all that, the NFS directory is ready to be exported by the NFS server (see Section “Exporting an NFS Root File-System”). To save the newly created NFS directory for future use, you can use the following commands: # cd $HOME/filesystem # tar -cvfz new-nfs.tar.gz * 4.5 Rebuilding the Full Ramdisk Image The following steps describe the procedure to build the ramdisk for the target. It is recommended to perform these commands with root permissions, as it would be easier to manage special files, such as device nodes and mount the file system image on the host PC. Create an empty directory where file-system will be mounted: # mkdir –p $HOME/ramdisk Create an empty image file: # dd if=/dev/zero of=ramdisk_file bs=40M count=1 Format the image file with the ext2 file-system: # mkfs.ext2 ramdisk_file You may see a warning message like the following. Enter “y” to continue. mke2fs 1.35 (28-Feb-2004) <ramdisk_file> is not a block special device. Proceed anyway? (y,n) y Mount the file-system image to be populated with files: # sudo mount -o loop ramdisk_file $HOME/ramdisk Now the file-system can be populated with the files. Untar the various file-system component archives as described in Section ”Rebuilding the NFS Image.” Now the file system is ready and can be un-mounted: # sudo umount $HOME/ramdisk Compress the file-system image by: # gzip ramdisk_file 31 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 The resulting file ramdisk_file.gz now can be downloaded to the target and used as a ramdisk. 4.6 Rebuilding the JFFS2 File-System Image The procedure to build the JFFS2 file-system for the target is similar and consists of the steps below. It is recommended to perform these commands with root permissions for proper management of device nodes. Start with the $HOME/filesystem directory that was created in Section “Rebuilding the NFS Image.” Package the file-system into the JFFS2 format with the following command: # mkfs.jffs2 -lqnp –e 128 -r $HOME/filesystem -o jffs2_image_file.jffs2 NOTE: Some Linux distributions do not have the mkfs.jffs2 command installed by default. To obtain this command you will need to either obtain the mtd-utils package for your distribution or you can download the mtd-utils sources from http://www.linux-mtd.infradead.org/source.html and build them for your host Linux system. The resulting file jffs2_image_file.jffs2 is in JFFS2 format and can be flashed to the target and used as a root file-system. 32 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 5 EVM Operation 5.1 Using Telnet The initialization file (/etc/init.d/rcS) starts a telnet server. If your development host is in the same sub-net as the EVM, you can telnet to it using the IP address assigned in the U-boot environment. You can use the “ifconfig” command from the Linux prompt to find out the ip address of the EVM. $ telnet 192.168.1.10 You will be prompted for a user name and password. The user name should be root and the password should be left blank (just hit Enter). 5.2 Booting the New Linux Kernel After building the new kernel, in order to use it to boot the EVM, you must transfer it to the board via TFTP. Once you transfer the kernel image to the board via TFTP, you could either perform a TFTP kernel boot or flash the kernel image to the NAND and subsequently use the NAND boot. It is assumed you have completed the steps in Section “Rebuilding the Linux Kernel”, and the boot file, uImage has been copied to /tftpboot (or some other site-specific TFTP accessible location). The following instructions apply for RHEL4 host development machine. For further details (usage on Ubuntu Host) refer to http://wiki.davincidsp.com/index.php/Setting_Up_a_TFTP_Server 5.2.1 Checking the TFTP server setup in the Linux development PC You can check to see if a TFTP server is set up with this command # rpm -q tftp-server If it is not set up, you can follow these steps: 1) To install TFTP, use this command, where -#.#-# is the version number portion of the filename: # rpm -ivh <tftp-server package name> 2) Confirm that TFTP is installed with this command: # /sbin/chkconfig --list | grep tftp You should see the following output: tftp: off If you need to turn on the TFTP server, use this command: # /sbin/chkconfig tftp on The default root location for servicing TFTP files is /tftpboot. 33 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 5.2.2 Using TFTP to boot the New Linux Kernel 1) Power on the EVM board, and abort the automatic boot sequence by pressing the “Enter key” in the console window. 2) Set the following environment variables to ensure that you are starting from a default, clean U-Boot environment. Note: In case of AM3517EVM, the Ethernet MAC Address needs to be explicitly passed through “eth=” bootargs. Substitute the MAC address below with corresponding address for your EVM OMAP-EVM # setenv serverip <tftp server ip address> OMAP-EVM # setenv bootfile uImage OMAP-EVM # setenv bootargs mem=256M console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2 eth=00:11:22:33:44:55 (for AM3517 EVM) OR OMAP-EVM # setenv bootargs mem=128M console=ttyS0,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2 (for OMAP3530 EVM) OMAP-EVM # setenv bootcmd ’tftpboot 0x80000000 uImage ; bootm This configuration boots a new Linux kernel via TFTP with a NAND flash based file system. 3) The initenv-samsung.txt and initenv-micron scripts provide the options for setting the bootargs for the appropriate target file system that is being used for the boot. Kindly refer to the appropriate script files for the flash parts that are being used on the board for more details. In case of use of ramdisk file system, use the following commands: OMAP-EVM # setenv bootargs ‘mem=256M root=/dev/ram0 initrd=0x81600000,40M eth=00:11:22:33:44:55’ OR OMAP-EVM # setenv bootargs ‘mem=128M root=/dev/ram0 initrd=0x81600000,40M console=ttyS2,115200n8 ramdisk_size=40960 (for AM3517 EVM) console=ttyS0,115200n8 ramdisk_size=40960’ (for OMAP3530 EVM) You could use TFTP to transfer the ramdisk image from the development PC or flash it on the NAND flash. Refer Section “Running the Re-flash Procedure” for more details on flashing the file systems on the target In case of use of NFS, use the following commands: OMAP-EVM # setenv bootargs ‘mem=256M console=ttyS2,115200n8 noinitrd ip=dhcp rw root=/dev/nfs nfsroot=/mnt/nfs,nolock eth0=00:11:22:33:44:55’ (for AM3517 EVM) OR OMAP-EVM # setenv bootargs ‘mem=128M console=ttyS0,115200n8 noinitrd ip=dhcp rw root=/dev/nfs nfsroot=/mnt/nfs,nolock, mpurate=600’ (for OMAP3530 EVM) 34 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 5.2.3 Flashing the New Linux Kernel The Linux kernel can also be flashed on the NAND and then could be used for the boot. Perform the following steps for flashing the new or rebuilt Linux Kernel 1. Make sure that the environment variables are properly set: OMAP-EVM # setenv serverip <tftp server ip address> OMAP-EVM # setenv bootfile uImage 2. Flash the Kernel Image onto the Micron NAND flash using the following commands. OMAP-EVM # mw.b 0x81600000 0xff 0x1400000 OMAP-EVM # nand erase 280000 220000 OMAP-EVM # tftpboot 0x81600000 uImage OMAP-EVM # nandecc sw OMAP-EVM # nand write.i 0x81600000 280000 220000 Flash the Kernel Image onto the Samsung NAND flash using the following commands. OMAP-EVM # mw.b 0x81600000 0xff 0x1400000 OMAP-EVM # onenand erase block 20-59 OMAP-EVM # tftpboot 0x81600000 uImage OMAP-EVM # onenand write 0x81600000 0x280000 0x0220000 3. Once the kernel is flashed, refer to Section “Changing Options in U-boot”, for booting kernel from the NAND flash. 5.3 Changing Options in U-boot If you use the environment provided by the initenv-xxx.txt script, where xxx is samsung or micron depending upon the Samsung or Micron NAND flash used on the board, you have several choices for boot options. Most of the boilerplate has been provided; you just need to set your choices. Kernel choices: OMAP-EVM # setenv get_kernel run nand_kernel (get kernel from flash) OMAP-EVM # setenv get_kernel run tftp_kernel (get custom kernel from TFTP) Initrd choices: OMAP-EVM # setenv get_initrd run nand_initrd (get kernel from flash) OMAP-EVM # setenv get_initrd run tftp_initrd (get custom image from TFTP) File-system choices: OMAP-EVM # setenv bootcmd run boot_rd (use an initrd ramdisk) OMAP-EVM # setenv bootcmd run boot_fs (use a JFFS file-system in flash) OMAP-EVM # setenv bootcmd run boot_nfs (use an NFS root directory) Save your choices: OMAP-EVM # saveenv (save to flash) 35 Document PSP 03.00.00 Getting Started Guide Document Number Rev 1.1 Date Nov 20, 2009 To run a JFFS file-system or a ramdisk image from flash, you need to make sure the appropriate image is in flash. You can use the reflash-xxx.txt script to load the appropriate image. Re-flash choices: OMAP-EVM # run rf_all_rd_new (update all using full ramdisk) OMAP-EVM # run rf_all_min_rd_new (update all using minimal ramdisk) OMAP-EVM # run rf_all_fs_new (update all using JFFS image) OMAP-EVM # run rf_rd_new (update just the full ramdisk) OMAP-EVM # run rf_min_rd_new (update just the full ramdisk) OMAP-EVM # run rf_fs_new (update just the JFFS image) Note 1: The two ramdisk images and JFFS are all mutually exclusive in Flash as they occupy the same partition. (Running ramdisk from tftp does not require flash space) Note 2: The current U-boot only allows 40 environment variables. Do not saveenv after the reflash script has been submitted. Instead complete the reflash and reboot before making env changes. 5.4 Exporting an NFS Root File-System If you have already prepared a directory tree to use for the NFS root file-system (see Section “Rebuilding the NFS Image”), you can proceed to the next step. Otherwise, extract the prepared version from the SDK to a new directory with the following commands: # mkdir –p $HOME/filesystem # sudo tar –zxvf images/fs/omap3517/nfs.tar.gz –C $HOME/filesystem (for AM3517 EVM) OR # sudo tar –zxvf images/fs/omap3530/nfs.tar.gz –C $HOME/filesystem (for OMAP3530 EVM) Make sure the NFS server is configured and functioning properly. Add the following line to the /etc/exports file of the server: (not expand $HOME with the path to your home directory) $HOME/filesystem 192.168.1.0/255.255.255.0(rw,sync,no_subtree_check) Please adjust the full path of the exported directory and the network address accordingly. Then issue the following command to notify the NFS server about the new exported directory: # exportfs –a To boot the NFS file system, set the u-boot ‘bootcmd’ variable to “run boot_nfs”. See Section “Changing Options in U-boot” for more information. 36