Home

Getting started with SPEAr Linux support package (LSP3

image

Contents

1. linux linux E armv5 E armv5 linux linux E armv5 E armv7 linux linux E armv7 E armv7 linux linux E armv7 Doc ID 023036 Rev 1 linux spear300_config spear310_config spear320_config spear320_hmi_config spear600_config spear1300_config spear1310_config 4 UM1535 Glossary 8 Glossary 4 Table 3 List of abbreviations Term Definition API Application programming interface ARM Advanced RISC machine BSP Board support package DDR Double data rate RAM DHCP Dynamic host configuration protocol FAT File allocation table FTP File transfer protocol GCC GNU compiler collection GPL General public license GNU IDE Integrated development environment IP Internet protocol LAN Local area network LGPL Lesser GPL LSP Linux support package MAC Media access control MTD Memory technology device NFS Network file system OS Operating system RAM Random access memory RPM RPM package manager RTC Real time clock SDK Software development kit SRAM Static RAM TFTP Trivial file transfer protocol UART Universal asynchronous receiver transmitter USB Universal serial bus ST site http www stlinux com drupal csd Doc ID 023036 Rev 1 33 39 Software license agreement UM1535 9 9 1 9 2 9
2. Installing the USB Flasher The USB flasher tool must be installed on a Windows PC Before setting up the flasher tool download and install an updated TCL package The recommended TCL software is ActiveTCL available free of charge The latest TCL version 8 5 can be downloaded from the following supplier site http www activestate com activetcl Doc ID 023036 Rev 1 ky UM1535 Working with pre flashed software Figure 5 TCL download page ActiveState Code to Cloud Smarter Safer Faster Can N 4 Actveren Downioast Overview gt 7 Need Help Emai Sales v i ActiveTc Webinars gt tas Download White Pape Screencasts gt Community Edition Comin gt Sua Ome gt Rissources gt Oownioad Certi gt AcIveTa Ooarionss Download Tcl ActiveTcl Community Edition AcDveSyPor Oowncacs ActveTa Ocemnicece AcoveFen Fro SAIO Downisass coet Downes AcoveTC Pro Studio Oownicass internal deployments Den Dev Kt POx Oomnioaas Tot Oev Kt TOK Ooanicass Learn more about ActiveTol Business Edition ActiveTc is the leading commercial grade distribution of the open source Tcl programming language Download ActiveTc Community Edition for your development projects and By downloading ActiveTc Community Edition you comply with the terms of use of the ActiveState Community License Komose SC Daro Komono Gen Qoamioags Production servers for external Need priority support how to Plan on redistribut
3. cat cat cat cat cat cat cat proc version Displays proc sys kernel osreleaseDisplays proc sys kernel version Displays proc cpuinfo proc meminfo proc modules proc mtd proc partitions proc stat proc bus usb devices proc net dev proc net tcp proc net udp proc net arp proc net route proc kallsyms Displays Displays Displays Displays Displays Displays Displays Reports Reports Reports Reports Reports Lists al full Linux kernel version information Linux kernel release Linux kernel build date and time information about the SPEAr CPU information about memory usage information about kernel extension modules information about Flash partitions other information about Flash partitions OS status information information about USB Host ports Ethernet information TCP sockets information UDP sockets information ARP table IP routing table 1 kernel symbols The standard proc bus usb subtree is also made available This is used to access USB Host controllers and plugged devices from user space applications For more details about the functionality provided by pseudo file systems please refer to standard Linux documentation Using a USB pen drive USB pen drives can be accessed in a standard Linux way connecting them to a USB host port and mounting their file system under root file system An example of operational sequence for a standard pen
4. Incremental changes to Flash file system If the root file system is stored on Flash memory it is possible to transfer files from the PC to the target board in the following ways e Transfer by USB pen drive e Transfer by MMC SD card Transfer by LAN TFTP Flash file system full replacement To replace the entire file system on Flash memory you can e Rewrite the root file system partition with the USB Flasher tool e Rewrite the root file system partition from U Boot Rewrite the root file system from Linux by overwriting the mtdblock of the file system Setting environment variables for using NFS boot The following U Boot commands set up environment variables for using the NFS file system u boot gt setenv bootargs root dev nfs rw console ttyAMAO0 115200 nfsroot 192 168 1 1 opt STM STLinux 2 4 devkit armv7 target udp ip 192 168 1 10 192 168 1 1 192 168 1 1 255 255 255 0 ethd These commands exports the opt STM STLinux 2 4 devkit armv7 target directory from the host machine IP address 192 168 1 1 to the target board IP address 192 168 1 10 the gateway address used is 255 255 255 0 Command line cross development The most important item concerning host packages is the cross development toolchain a set of programs running on a host PC but targeting ARM specific code output with support for Cross compilation of source code to generate native object code for the ARM CPU cores integrated into SPEAr embed
5. Ti UM1535 Y User manual Getting started with SPEAr Linux support package LSP3 2 3 Introduction This manual provides application developers with a first introduction to the Linux based reference software installed in the Flash memory of the SPEAr evaluation boards It is not intended to be a tutorial on Linux operating system or embedded software design It only covers topics that are specific to the implementation on SPEAr embedded MPUs and boards The Linux Support Package LSP is a set of software provided free of charge by STMicroelectronics for the SPEAr family of embedded microprocessor units eMPUs The LSP has the following objectives Demonstrating capabilities of SPEAr devices through a widespread high level operating system Linux The LSP is only targeting STMicro evaluation boards e Providing a starting point for customers willing to accelerate a Linux porting to their proprietary SPEAr based hardware platforms and products e A detailed description of LSP contents can be found in the following companion document UM1536 User manual Linux support package LSP v3 2 3 for SPEAr eMPU family April 2012 Doc ID 023036 Rev 1 1 39 www st com Contents UM1535 Contents 1 About this Manual isos sien eae assim ioe m ae Red Bata ee eae a ST ee 6 2 Working with pre flashed software 000 cece eee eee 7 2 1 Host PC requirements 00 0 c eee eee 7 2 1 1 Windows PC i teen
6. Flash If needed the XLoader firmware image can be rebuilt Relevant commands to be run on Linux PC are described below EVALSPEAR300 To rebuild U Boot on a Linux host PC run the following commands make mrproper make ARCH arm make ARCH arm EVALSPEAR310 make mrproper make ARCH arm make ARCH arm CROSS_COMPI CROSS_COMPI CROSS_COMPI CROSS_COMPI E armv5 1 E armv5 1 E armv5 1 EVALSP320CPU PLC Expansion board make mrproper make ARCH arm CROSS_COMPI make ARCH arm CROSS_COMPI E armv5 1 E armv5 1 EVALSP320CPU HMI Expansion board make mrproper make ARCH arm make ARCH arm EVALSPEAR600 make mrproper make ARCH arm make ARCH arm EVALSP1300CPU make mrproper make ARCH arm make ARCH arm EVALSPEAR1340 make mrproper make ARCH arm make ARCH arm CROSS_COMPI CROSS_COMPI CROSS_COMPI CROSS_COMPI CROSS_COMPI CROSS_COMPI CROSS_COMPI CROSS_COMPI E armv5 1 E armv5 1 E armv5 1 E armv5 1 E armv5 1 E armv7 1 E armv7 1 E armv7 1 Doc ID 023036 Rev 1 E armv7 1 inux inux inux inux inux inux inux inux inux inux inux inux inux inux spear300_config spear310_config spear320_config spear320_hmi_config spear600_config spear
7. drive connected as sda device only one pen drive present is the following 1 Plug the pen drive in a USB port and wait for the Linux kernel to autodetect it you can see active kernel messages on the terminal 2 Mount the pen drive file system mount dev sdal mnt Now the pen drive file system can be accessed under mnt directory 3 Transfer files as usual for example cp command 4 When finished unmount the pen drive umount mnt Now you can physically unplug the pen drive Doc ID 023036 Rev 1 4 UM1535 Working with pre flashed software 2 5 2 6 2 7 Note Using a MMC SD card Some evaluation boards currently EVALSPEAR1340 EVALSP320CPU EVALSPEAR300 EVALSPEAR600 provide a MMC SD card reader slot An example of operation sequence for a MMC SD card is the following 1 Plug the card into the board slot and wait for the Linux kernel to autodetect it you can see active kernel messages on the terminal 2 Mount the card s file system mount dev mmcblkOp1 mnt Now the card s file system can be accessed under the mnt directory 3 Transfer files as usual for example cp command 4 When finished unmount the card umount mnt 5 Now you can physically remove the card Using a SATA hard disk Some evaluation boards currently EVALSPEAR1340 support SATA An example of the operation sequence for a SATA hard disk is the following 1 Mount the SATA file system mount dev
8. tenet eens 7 2 1 2 IUGR serne isata Soret th ease bag nite eae deeded E eee ea cee 8 2 2 Overview of Flash contents and structure 00 eee eee 9 2 3 Booting up to the Linux prompt 210csveccteeeeeleeeeverteeuees 11 2 4 Using a USB pen drive ccs ced oewet wade cAearaas ae eater ee eke 12 2 5 Using a MMC SD card s2 54 den oevetendesseewaagicea dA pawawe eee 13 2 6 Using a SATA hard disk va ceeckeeseev ede ee tie ee hie ewe bees s 13 2 7 Entering the U Boot resident monitor 0c eee ee eee 13 2 7 1 Information commands 000 cee eee eee ee 14 2 7 2 Environment variables 00 000 eee eee eee 14 2 7 3 Advanced commands 000 0c eee e eee eee eee eae 15 2 8 Connecting the evaluation board toaLAN 00 eee 16 2 9 Updating the pre flashed software 000 cece eee eee eee 18 2 9 1 Installing the USB Flasher 0 00 000 eee eee eee 18 3 The STLINUX distribution lt ccccccevwewncndeess du ank ee ewewedars 20 3 1 OVOINIOW 5558 amred A a a CE Lo Eee TY ae BES 20 3 2 Host PC requirements s ciisccahe wind baw cab ee deb hen es ew ae bs 20 3 3 Thestmyum tool sons rren iiser sereins enha kN ae eed as 20 3 4 Installing the STLinux distribution nassaan 0000 eee eee 21 4 Working at application level userland 2000eeeeeees 23 4 1 Workflow modelS 0 0000 aeaee 23 4 1 1 Remote mounting of the root file system NFS 23 4 1 2 In
9. the most important options are still available with all the functions needed for developing and testing embedded products As well as the features of BusyBox a number of additional executable programs are also included In addition to playing with commands it can be also helpful to explore the Linux standard proc pseudo filesystem This subtree contains user accessible entries that pertain to the runtime state of the kernel and by extension the executing processes that run on top of it The pseudo term is used because the proc filesystem exists only as a reflection of the in memory kernel data structures it displays This is why most files and directories within proc are zero bytes in size In practice the proc file system is intended to be populated at runtime with system information and statistics Proc files may be either read only or read write Each numerically named directory within proc corresponds to the process ID PID of a process currently executing on the system This part of the proc file system totally depends on the runtime state of the target Each numeric entry contains subfiles that provide process specific information The other non numeric entries describe some aspects of kernel operation Doc ID 023036 Rev 1 11 39 Working with pre flashed software UM1535 2 4 12 39 Some of the common user commands performed on the proc file system are cat cat cat cat cat cat cat cat cat
10. the release After cloning you can create your branch from the tag of the LSP release For example to retrieve code for LSP 3 2 3 execute the following command git checkout b lt your_branch gt l1sp 3 2 3 This creates your branch with objects from LSP 3 2 3 Information on tags regarding all releases are mentioned in corresponding release notes Doc ID 023036 Rev 1 27 39 Working with customized kernels UM1535 6 6 1 28 39 Working with customized kernels When working with SPEAr evaluation boards making modifications to supplied Linux kernel is only needed when Changing kernel configuration by enabling or disabling some options or features e Developing new drivers on top of existing ones in order to interface peripherals that can be added through custom add on boards connected to SPEAr evaluation boards where applicable e Rewriting partially or totally some existing reference device drivers for example for further optimization or special needs e Developing custom kernel modules The use of kernel level software with hardware platforms other that SPEAr evaluation boards is not discussed in this section When working at kernel level developers are concerned with the kernel source code tree from which a single binary image file must be generated by rebuilding the kernel The main tasks to be performed are e Kernel reconfiguration Kernel rebuild e Kernel loading and execution on a target eva
11. 1310_reva_config spear1340_config 31 39 Rebuilding the bootloaders UM1535 7 2 32 39 U Boot The default U Boot provided as pre flashed on all SPEAr evaluation boards as well as binary image on ST Web site for upgrades is built for serial NOR Flash If needed the U Boot firmware image has to be rebuilt taking into account each specific embedded MPU and Flash memory type Therefore there are many cases and relevant commands as described below EVALSPEAR300 To rebuild U Boot on a Linux host PC run the following commands make mrproper make ARCH arm make ARCH arm EVALSPEAR310 make mrproper make ARCH arm make ARCH arm CROSS_COMP1 CROSS_COMP CROSS_COMP1 CROSS_COMPT E armv5 linux E armv5 E armv5 Linux linux E armv5 EVALSP320CPU PLC Expansion Board make mrproper make ARCH arm CROSS_COMP make ARCH arm CROSS COMP E armv5 linux linux E armv5 EVALSP320CPU HMI Expansion Board make mrproper make ARCH arm make ARCH arm EVALSPEAR600 make mrproper make ARCH arm make ARCH arm EVALSPEAR1340 make mrproper make ARCH arm make ARCH arm EVALSP1300CPU make mrproper make ARCH arm make ARCH arm CROSS_COMP I CROSS_COMP I CROSS_COMP CROSS_COMP I CROSS_COMP I CROSS_COMP I CROSS_COMP I CROSS_COMPI E armv5
12. 3 9 4 34 39 Software license agreement This Software License Agreement Agreement is displayed for you to read prior to downloading and using the Licensed Software If you choose not to agree with these provisions do not download or install the enclosed Licensed Software and the related documentation and design tools By using the Licensed Software you are agreeing to be bound by the terms and conditions of this Agreement Do not use the Licensed Software until you have read and agreed to the following terms and conditions The use of the Licensed Software implies automatically the acceptance of the following terms and conditions Definitions Licensed Software means the enclosed demonstration software and all the related documentation and design tools licensed in the form of object and or source code as the case maybe Product means a product or a system that includes or incorporates solely and exclusively an executable version of the Licensed Software and provided further that such Licensed Software executes solely and exclusively on ST products License STMicroelectronics ST grants you a non exclusive worldwide non transferable whether by assignment law sublicense or otherwise revocable royalty free limited license to i make copies prepare derivatives works display internally and use internally the source code version of the Licensed Software for the sole and exclusive purpose of developing executable version
13. ackage installed groups of packages can be installed as a single unit increased security as all packages are signed Doc ID 023036 Rev 1 ky UM1535 The STLinux distribution 3 4 Note The STLinux distribution relies on a slightly customized version of Yum known as stmyum to ensure that it does not interfere with any native Yum installation It is automatically installed at opt STM STLinux X X host bin and the PATH environment variable must include this directory to be able to use it Installing the STLinux distribution Installing from the from the STLinux com website To install the STLinux distribution from the STLinux com website perform the following steps 1 Go to the download section of STLinux Download section points to ftp site of STLinux ftp ftp stlinux com pub stlinux Click the 2 4 link on this web site Download install script on your Linux PC Execute the following command to install STLinux 2 4 ARMV7 install all armv7 glibc spear ARMV5 install all armv5 glibc spear 6 The STLinux tool chain installs at the following path opv STM STLinux2 4 If you have STLinux2 3 installed on you machine they can co exist 7 When the installation is completed configure the Linux shell environment as follows ark woh ARMV7 export PATH SPATH opt STM STLinux 2 4 devkit armv7 bin export CROSS_COMPILE armv7 linux ARMV5 export PATH SPATH opt STM STLinux 2 4 devkit a
14. adaptations to a device drivers that are statically linked with kernel code To enable TFTP support on the development PC you must make sure that the TFTP daemon program usr sbin in tftpd is installed On Fedora Core systems you can verify this by running rpm q tftp server If necessary install the TFTP daemon program from your distribution media Most Linux distributions disable the TFTP service by default To enable it for example on Fedora systems edit the file etc xinetd d tftp and remove the line disable yes Doc ID 023036 Rev 1 29 39 Working with customized kernels UM1535 6 3 2 30 39 or change it into a comment line by putting a hash character in front of it An example of TFTP file configuration is shown below service tftp socket_type dgram protocol udp wait yes user root server usr sbin in tftpd server_args c v s tftpboot disable no per_source 11 cps 100 2 flags IPv4 Also make sure that the tftpboot directory exists and is word readable permissions at least dr xr xr x and remember to disable the firewall if present or make new rules to allow TFTP traffic The firewall can be disabled as in the following example command etc init d iptables stop Please note that server_args keeps the default search path for TFTP daemon This is useful for specifying file names omitting this path on the TFTP client side target After this restart the
15. ading LSP source code 5 Note Note Downloading LSP source code There are two options for downloading the LSP source code From the STLinux Web site STLinux distribution contains rpm for source code for XLoader U Boot and Linux The default installation of STLinux2 4 source code can be retrieved from op STM STLinux2 4 devkit sources From the GIT repository XLoader U Boot and Linux kernel development for SPEAr is done on GIT ST GIT repositories are Linux http git stlinux com p spear linux 2 6 git U Boot http git stlinux com p spear u boot git XLoader http git stlinux com p spear xloader git Source code can be viewed on this link using any internet browser GIT source code can obtained using GIT Following is an example for kernel source An identical procedure can be used for XLoader and U Boot Clone the repository or fetch new code If you are downloading SPEAr kernel source for the first time you should clone the repository This can be done with git clone git git stlinux com spear xloader git If you are running the command inside a company Intranet you may be required to set the http_proxy or HTTP_PROXY variable with the DNS name of the proxy machine export htpp_proxy http lt yourlogin gt lt yourpwd gt lt yourproxyaddr gt 8080 If you have already cloned the repository you can fetch updates with the following command git fetch origin Create a new branch from
16. al Help Serial Device dev ttyso LockTile Location war f lock Callin Program Callout Program 4 Bps Par Bits 115200 8N1 Hardware Flow Control Software Flow Control Change which setting ii Screen and keyboard Save setup as dfl Save setup as Exit Exit from Minicom To save a new default configuration which is automatically used by minicom select Save setup as dfl Alternatively to create a new configuration file select Save setup as In order to use it you have to specify the configuration file name in the command line when invoking minicom Please note that by default minicom tries to initialize a modem connected to the specific interface you have chosen To skip this step you can invoke minicom with the o option as follows minicom o Overview of Flash contents and structure On all evaluation boards the default software is only pre stored into serial NOR Flash The use of other memory types available on some evaluation boards NAND parallel NOR requires the installation and usage of the STLinux distribution as described in Chapter 3 The STLinux distribution This subsection only provides an overview of the Flash contents and structuring Details on this subject like offsets and sizes for each partition as well as differences between serial Doc ID 023036 Rev 1 9 39 Working with pre flashed software UM1535 10 39 NOR parallel NOR and NAND is provided in the correspon
17. ation commands To report the U Boot version currently available on the evaluation board Flash memory execute the version command gt version u boot gt version U Boot 2010 03 lsp 3 2 3 Feb 22 2012 11 31 43 SPEAr To list all Flash memory partitions use the imls command u boot gt imls Legacy Image at E6000000 Image Name Xloader 2010 06 l1sp 3 2 3 for sp Image Type ARM Linux Firmware uncompressed Data Size 27384 Bytes 26 7 KiB Load Address b3801504 Entry Point 63801504 Verifying Checksum OK Legacy Image at E6010000 Image Name U Boot 2010 03 l1sp 3 2 3 for spe Image Type ARM Linux Firmware uncompressed Data Size 196264 Bytes 191 7 KiB Load Address 00700000 Entry Point 00000000 Verifying Checksum OK Legacy Image at E6050000 Image Name Linux 2 6 37 lsp 3 2 3 spear13xx Image Type ARM Linux Kernel Image uncompressed Data Size 2579968 Bytes 2 5 MiB Load Address 00008000 Entry Point 00008000 Verifying Checksum OK Environment variables A specific subgroup of U Boot commands very often invoked by end users is related to the management of environment variables Such variables are string type fields that may be read and written as well as stored on Flash to guarantee their persistence across system reboots Some of these variables have a predefined purpose but users may also add their own custom variables It is im
18. ave informed us You will lock the source code of the Licensed Software and all copies thereof in a secured storage inside your official premises at all times when the source code of the Licensed Software is not being used as permitted under this Agreement You will inform all Your employees who are given access to the source code of the Licensed Software of the foregoing requirements and You will take all reasonable precautions to ensure and monitor their compliance with such requirements You agree to promptly notify ST in the event of a violation of any of the foregoing and to cooperate with ST to take any remedial action appropriate to address the violation You shall keep accurate records with respect to its use of the source code of the Licensed Software In the event ST demonstrates to You a reasonable belief that the source code of the Licensed Software has been used or distributed in violation of this Agreement ST may by written notification request certification as to whether such unauthorized use or distribution has occurred You shall reasonably cooperate and assist ST in its determination of whether there has been unauthorized use or distribution of the source code of the Licensed Software and will take appropriate steps to remedy any unauthorized use or distribution You agree that ST shall have the right where ST reasonably suspects that the terms and conditions of this Agreement with reference to Restriction clause have not been complied wi
19. censed Software the documentation or this Agreement even if ST has been advised of the possibility of such damages In no event shall ST s liability to You or any third party under this Agreement including any claim with respect of any third party intellectual property rights for any cause of action exceed 100 US This section does not apply to the extent prohibited by law For the purposes of this section any liability of ST shall be treated in the aggregate Termination ST may terminate this license at any time if You are in breach of any of its terms and conditions Upon termination You will immediately destroy or return all copies of the software and documentation to ST Doc ID 023036 Rev 1 ky UM1535 Software license agreement 9 8 9 9 9 10 9 11 Applicable law and jurisdiction In case of dispute and in the absence of an amicable settlement the only competent jurisdiction shall be the Courts of Geneva Switzerland The applicable law shall be the law of Switzerland Severability If any provision of this agreement is or becomes at any time or for any reason unenforceable or invalid no other provision of this agreement shall be affected thereby and the remaining provisions of this agreement shall continue with the same force and effect as if such unenforceable or invalid provisions had not been inserted in this Agreement Waiver The waiver by either party of any breach of any provisions of this Agre
20. cremental changes to Flash file system 22055 24 4 1 3 Flash file system full replacement 00 0000 eee eee 24 4 1 4 Setting environment variables for using NFS boot 24 4 2 Command line cross development 0 00 cece eee eee 24 4 3 Userland packages is 4 24 veveeeew dda honensalveree waagien cas eed 25 2 39 Doc ID 023036 Rev 1 ky UM1535 Contents 4 4 Rebuilding the root file system 0 0 2 ee 25 5 Downloading LSP source code 000 cece eee eee eens 27 6 Working with customized kernels 00 eee eee eee eee 28 6 1 Reconfiguring the kernel 0 00 eee ee ee 28 6 2 Rebuilding the kernel 00 cee eee 29 6 3 Workilow models ccc veendentiee oe tier een tbe sadulge eave eee Meee 29 6 3 1 Booting the kernel on demand ccc eee ees 29 6 3 2 Updating the kernel on Flash memory by U Boot 30 7 Rebuilding the bootloaders 0 00 cece eee eee 31 7 1 XLOAEN scsi s ava atdwsaiea ped beau baa wi ADEA ae ee eee 31 7 2 U BOOT is sachavakiaws cet ees aadwstes de aeddeanewae pew bata ae 32 8 Glossary i iran gi fie cn ls Mh a i a i le aa e 33 9 Software license agreement 0 20 c eee eee eee eee 34 9 1 Definitions 0 0 0000 eens 34 9 2 Liese sac ta ean as els Aa PARNER Acetg een 8 ERRERA E ERRE NARRA RAE 34 9 3 Ownership and copyright 0 2 cee ees 34 9 4 RES ICONS i345 00c be
21. ded MPU family e Cross linking of ARM object code to generate executable programs or dynamically linkable shared libraries Managing object code archives incremental rebuilding and other auxiliary tasks Doc ID 023036 Rev 1 ky UM1535 Working at application level userland 4 3 4 4 The provided toolchain is based on the widely adopted open source GNU toolset A summary of the main available command line tools is reported in Table 1 For detailed documentation please consult the GNU Web site http Awww gnu org manual manual html Table 1 Main toolchain commands Package Tool Description Gcc C Cross compiler for ARM GCC Gcov Code coverage Ar Archiver As Cross assembler for ARM Gprof Profiling tool Ld Cross linker for ARM Nm Lists symbols in object files binutils Objcopy Copies a binary file Objdump Displays information from object files Ranlib Generates an index to speed access to archives Readelf Displays the information about the contents of ELF format files Rtrip Removes symbols and sections from files GNU Make Make Incremental build management GDB Gdb Debugger Userland packages The general STLinux distribution comes with a set of user space packages prebuilt for the ARM target This set includes programs and libraries for Graphics for example X Server SDL Cairo DirectFB GTK Qt Embedded Programming language runtim
22. der this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES ST PRODUCTS ARE NOT RECOMMENDED AUTHORIZED OR WARRANTED FOR USE IN MILITARY AIR CRAFT SPACE LIFE SAVING OR LIFE SUSTAINING APPLICATIONS NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY DEATH OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE ST PRODUCTS WHICH ARE NOT SPECIFIED AS AUTOMOTIVE GRADE MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or servic
23. ding SPEAr device datasheet and user manual Whatever the Flash memory type software installed in the SPEAr evaluation boards is logically structured into 5 partitions as depicted in Figure 4 Figure 4 Flash memory organization XLoader lt _ 2na stage boot loader U Boot t 3rd stage boot loader and resident monitor U Boot Environment t U Boot settings Kernel 4 Linux kernel with SPEAr BSP Root Initialization scripts Filesystem lt 4 Configuration files Selection of user space programs and runtime libraries To understand the rationale behind this Flash memory organization it is necessary to know how the overall booting process works After power on a SPEAr embedded MPU starts to execute an on chip firmware known as BootROM kept in internal SPEAr ROM area not in Flash memory This is the first stage When a board is configured in Flash booting mode BootROM terminates by loading a 2nd stage component XLoader from Flash memory to on chip SRAM and then gives control to it XLoader is a small ST specific firmware also available in source code that executes in internal SRAM and configures the PLLs and the specific DDR memory available on each board Once performed its task XLoader loads a third stage boot loader U Boot from Flash and jumps to its entry point The widely used open source U Boot program is used as a third stage boot loader in the SPEAr evaluation boards The U Boot version pro
24. e described herein and shall not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countries Information in this document supersedes and replaces all information previously supplied The ST logo is a registered trademark of STMicroelectronics All other names are the property of their respective owners 2012 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Philippines Singapore Spain Sweden Switzerland United Kingdom United States of America www st com ky Doc ID 023036 Rev 1 39 39
25. eatures and higher flexibility especially its scripting capability You can download and find more technical information about Tera Term on http en wikipedia org wiki Tera_Term In order to configure the serial port with TeraTerm 1 Launch the tool 2 Click on Setup gt serial port The configuration must reflect that shown in Figure 2 3 To save the proper setting click on Setup gt save setup Doc ID 023036 Rev 1 7 39 Working with pre flashed software UM1535 Note 8 39 Figure 2 Tera Term configuration for serial port Windows PC Tera Term Serial port setup Port Baud rate 115200 Data 8 bit xj Cancel Parity none Stop fbt Help Flow control none gt Transmit delay 0 msecjchar fo msecfline Using HyperTerminal is very similar To configure the serial port with HyperTerminal 1 Enter the File gt Properties menu 2 Select the COM port for example COM1 in the Connect Using dialog box 3 Press the Configure button 4 Enter the Port Setting fields accordingly 5 To save the current configurations select the File gt Save As menu item Linux PC As an alternative to Windows you can use a PC with Linux OS In the examples below a symbol represents a normal user prompt while a symbol means a root level prompt Please note that you need read write access to the PC serial port If necessary check your distribution documentation to enable i
26. ement shall not operate or be construed as a waiver of any other or a subsequent breach of the same or a different provision Relationship of the parties Nothing in this Agreement shall create or be deemed to create a partnership or the relationship of principal and agent or employer and employee between the Parties Neither Party has the authority or power to bind to contract in the name of or to create a liability for the other in any way or for any purpose Doc ID 023036 Rev 1 37 39 Revision history UM1535 Revision history 38 39 Table 4 Document revision history Date Revision Changes 17 Apr 2012 1 Initial release Doc ID 023036 Rev 1 UM1535 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections modifications or improvements to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted un
27. es for example micro Perl Connectivity for example usblib Bluetooth Bluez Multimedia frameworks for example ALSA GStreamer Database for example sqlite Benchmarking tools for example IOZONE netperf Some of these packages are not supported on SPEAr evaluation boards yet in particular ones requiring specific hardware for audio video wireless connectivity Rebuilding the root file system The default root file system provided as pre flashed on all SPEAr evaluation boards as well as binary image on ST Web site for upgrades is built for serial NOR Flash and formatted according to JFFS2 structure In order to rebuild this configuration the procedure to be run on Linux host PC is as follows Doc ID 023036 Rev 1 25 39 Working at application level userland UM1535 26 39 mkfs jffs2 n p 1 s 0x200 e 0x10000 r rootfs_nor img BUSYBOX _install o The same procedure and results can be directly used in case of parallel NOR Flash always assuming JFFS2 Note that there is no dependency on the specific SPEAr embedded MPU or evaluation board For evaluation boards provided with NAND Flash use the JFFS2 file system In order to rebuild a JFFS2 root file system for NAND on the Linux host PC run mkfs jffs2 n p 1 s 0x200 e 0x4000 r rootfs_nand_smallpage img BUSY BOX _install Doc ID 023036 Rev 1 BUSY BOX _install o UM1535 Downlo
28. essment of which files are actually used and of the overall required size for future migration to Flash memory To remotely mount the root file system configure and start the NFS server on Linux PC Assuming the NFS server functionality is already provided by your host the only configuration is an entry for your target root directory to your etc exports file for example For ARMV7 opt STM STLinux 2 4 devkit armv7 target 192 168 0 0 24 rw no_root_squash sync For ARMV5 opt STM STLinux 2 4 devkit armv5 target 192 168 0 0 24 rw no_root_squash sync This line exports the opt STM STLinux 2 4 devkit armvx target directory with read and write permission to all hosts on the 192 168 0 0 subnet To check NFS availability and start the services use the following commands from user root account rpm q nfs utils After modifying the etc exports file make sure the NFS system is notified about the change for example by running the command Doc ID 023036 Rev 1 23 39 Working at application level userland UM1535 4 2 24 39 service portmap start Starting portmap OK followed by the command service nfs start Starting NFS services OK Starting NFS quotas OK Starting NFS daemon OK Starting NFS mountd OK Each time you change this file when the NFS service is already started you need either to restart it or to force the NFS daemon to reload the new configuration exportfs a
29. et port 0 ethO of the host machine You can configure the IP on the evaluation board side in a static or dynamic way For a static configuration the procedure is as follows 1 Reset the board and enter U Boot mode 2 Use the following commands to configure environment variables gt setenv ipaddr 192 168 1 10 gt setenv serverip 192 168 1 1 gt setenv gatewayip 192 168 1 1 gt setenv netmask 255 255 255 0 gt setenv hostname SPEAR 3 Set the root path as path of your NFS file system If you are using STLinux2 4 as NFS file system then your root path will be For Armv5 SoCs gt setenv rootpath opt STM STLinux 2 4 devkit armv5 target For Armv7 SoCs gt setenv rootpath opt STM STLinux 2 4 devkit armv7 target Default bootargs contain an environment variable named nfsboot This variable uses the environment variables above If extra information is required the environment variable othbootargs can be used 4 As final step modify bootargs with nfsboot Execute the following command for this gt run nfsboot In this way network settings work inside U Boot and are also automatically passed to Linux The dynamic configuration requires a DHCP server running on the LAN for example on a Linux host PC so that the evaluation board automatically gets an IP address at each bootstrap Doc ID 023036 Rev 1 ky UM1535 Working with pre flashed software 4 To check if the DHCP server daemon
30. ev 1 4 UM1535 Working with pre flashed software 2 2 1 Working with pre flashed software SPEAr evaluation boards come with default embedded Linux software already stored in serial NOR Flash memory according to a pre defined generic configuration Using a SPEAr board with pre flashed software is initially useful to get familiar with the target hardware platform and the embedded Linux environment This activity does not strictly require the installation of the SPEAr Linux support package software development environment This can be performed later as described in Chapter 3 of this document Before powering on target hardware hence booting the pre flashed software please carefully check the specific hardware configuration for example DIP switches according to what is described in the relevant hardware manuals Host PC requirements Windows PC In order to control the target hardware use a PC with a Microsoft Windows operating system XP Vista Windows 7 The first step is to set up a serial port for interacting with the embedded consoles Linux shell or U Boot boot loader If a RS232 serial port is not available on the PC you can use a USB RS232 adapter not provided in the kit The second step is to obtain a terminal emulation program Windows comes with the built in HyperTerminal but any equivalent tool can be used as an alternative For instance Tera Term is an open source free application with more f
31. going from a description of the first step and then covering more complex subjects Figure 1 Step by step approach to using the manual About this manual Working with pre flashed software The STLinux distribution Working at application level userland Chapter 4 Downloading LSP source code Working with customized kernels Chapter 6 Rebuilding the bootloaders Early evolution of SPEAr solutions Porting own applications to SPEAr Customizing root file system content Fetching code for Linux XLoader U Boot from Git repository Adding built in Linux features not available by default Tuning kernal parameters Developing new modules and or device drivers Booting from NAND NOR Users can work with Windows or Linux PCs Basic skills required Users must work with Linux PCs Medium skills required Basic Git knowledge is an advantage Users must work with Linux PCs Advanced skills required This guide applies to all currently available SPEAr evaluation boards However each different evaluation board is based on a specific member of SPEAr embedded MPU family and provides in general a different selection and combination of hardware devices on the board and companion boards wherever applicable For a detailed description of hardware features for each evaluation board please refer to the corresponding evaluation board user manual 6 39 Doc ID 023036 R
32. ilename parameters enable U Boot to download and boot a kernel image from the host using the TFTP file transfer protocol you will need a TFTP server on the host see below In order to apply the new configuration settings restart he DHCP server To do this first check the status of the DHCP daemon using the following commands from the Linux PC shell etc rc d init d dhcpd status If the DHCP daemon is stopped start it with the following command etc rce d init d dhcpd start Please be sure to disable your firewall or setup new firewall rules in order to enable DHCP TFTP traffic Updating the pre flashed software This section focuses on updating the contents of serial NOR Flash with default binary images available on ST Web site It also focuses on updating NAND Flash Updating the contents of Flash memory on SPEAr evaluation boards is a recommended step It is possible to update the pre flashed software delivered by default with a SPEAr evaluation board without installing the STLinux distribution The procedure for the update involves the installation and use of the USB Flasher tool provided by ST This tool is a graphical interactive application which can be downloaded from ST company site which also provides download for updated binary images for each evaluation board type to be used with the USB Flasher The use of the USB Flasher for other purposes and scenarios is explained in the help pages embedded in the tool itself
33. ing ActiveTe users Locking for HP UX heip indemnificabon or custom in your products Solaris or AIX builds Looking bulls for older versions Lean more about ActiveTct Enterprise Edition Download Tck Other Platforms and Versions Version Windows Windows Paar x Linus Linux Mac OS X x68 64 bit x64 x86_ 64x86 86 x86_64 Unrversal ssni en Bomars mas DA AS Package AS Package va 841356 A ST na ASPackage AS Package Ep 8 6 0 007 wert eo Mao BAE AS Package AS Package wa Learn more about ActiveTct OEM Licensing The Flashing utility comes with details on installing and using the Flashing utility This document can be found at doc html flasher htm Follow instructions in flasher htm to install the Flashing utility Doc ID 023036 Rev 1 19 39 The STLinux distribution UM1535 3 3 1 3 2 3 3 20 39 The STLinux distribution Overview The STLinux distribution provides all the host side PC and target side evaluation board software components enabling system designers to develop their own applications for SPEAr based platforms as well as customize the various aspects of the embedded software architecture The components can be summarized as follows Command line cross development toolchain compiler linker building tools etc running on a Linux x86 PC Graphical IDE ST Workbench running on a Linux x86 PC e Software for incremental online update of STLinux distribution co
34. luation board different possible workflows For general information about Linux kernel please refer to public Linux documentation For information about SPEAr specific code integrated into Linux kernel please refer to the Linux Support Package LSP user manual UM1536 For the path to the LSP source code please see the release notes Reconfiguring the kernel The kernel configuration is managed with standard Linux kernel configuration tools like make menuconfig Each SPEAr evaluation board has a default kernel configuration file in the kernel source tree directory arch arm configs as shown in following table Table 2 Kernel configuration files Evaluation board Kernel configuration file EVALSPEAR1340 EVALSP1300CPU Spear13xx_defconfig EVALSPEAR300 EVALSPEAR310 Spear3xx_defcontig EVALSP320CPU EVALSPEAR600 Spear6xx_defconfig Doc ID 023036 Rev 1 ky UM1535 Working with customized kernels 6 2 6 3 6 3 1 To configure the kernel using a default configuration for example for SPEAr1340 enter the kernel source tree directory and run the commands make distclean make ARCH arm CROSS_COMPILE armv7 linux spearl3xx_defconfig To modify the default configuration from the terminal run the make ARCH arm CROSS_COMPILE armv7 linux menuconfig tool in the kernel source tree root directory Now you can change all the configuration options Use the arrows keys to navigate in the menu s
35. mponents A set of open source user space ARM packages programs and runtime libraries to be promptly reused in root file systems as support to specific applications The root file system also provides compiler linker and so on for compiling applications on target boards Linux kernel 2 6 37 or higher configurable for the different SPEAr evaluation boards it includes BSP device drivers for the SPEAr hardware features e U Boot boot loader with added support for SPEAr evaluation boards e XLoader firmware configurable for the different SPEAr evaluation boards Most distribution components are also available as source code SRPM files Full details about STLinux components are reported in other specific documents Host PC requirements The STLinux 2 4 distribution is supported on Fedora 6 and later and Redhat Enterprise 4 and later STLinux 2 4 is not officially supported on Ubuntu The guide for installing on an Ubuntu machine is available at following link http www stlinux com install ubuntu The stmyum tool Yum is an automatic updater and package installer remover for RPM Linux host systems like Fedora It automatically computes dependencies and figures out the procedure for installing packages Yum has a number of advantages over using RPM directly automatic updates of installed packages automatic checks for newly available and updated packages all dependent packages are installed automatically for each p
36. ne na a Mas eee ae oe bob Hee 34 9 5 NO wamraniy nso dtseodees pri oeoa Een A EEEE E ee eeere nee 35 9 6 Limitation of liabilities aaau aaaea 36 9 7 Termination 0 0 0c ett 36 9 8 Applicable law and jurisdiction 0 00 e ee 37 99 SQveraviliivncustcntateeesedg aean nea er R E E a e 37 91W07 Waer to een Seiden de ee iEn eiser eb os Re ek 37 9 11 Relationship of the parties 0 0200 cee es 37 REVISION history biti cde ceed eae eRe ere a eae Rew eda Se 38 ky Doc ID 023036 Rev 1 3 39 List of tables UM1535 List of tables Table 1 Table 2 Table 3 Table 4 4 39 Main toolchain commands 00 cece ete ee 25 Kernel configuration files 0 0 0 ccc eee 28 List of abbreviations 0 0 cette tenes 33 Document revision history 0 0 0 00 cee ete ene 38 Doc ID 023036 Rev 1 ky UM1535 List of figures List of figures Figure 1 Step by step approach to using the manual 0 0 00 e eee eee 6 Figure 2 Tera Term configuration for serial port Windows PC 00000 eee eee 8 Figure 3 Minicom serial port configuration Linux PC 0 0 0 cece 9 Figure 4 Flash memory organization 00 eens 10 Figure 5 TCL download page ky Doc ID 023036 Rev 1 5 39 About this Manual UM1535 1 About this Manual This manual focuses on software usage on SPEAr development boards and is organized as a sequence of chapters
37. nts of an environment variable handling it as a script sequence of U Boot commands Checking the ethernet link between the target board and the host PC ping Booting the Linux kernel from the ethernet network by TFTP instead of using a kernel on Flash memory bootm tftp tftpboot Each command has a short name For example you can type print instead of printenv as in the previous example or savee instead of saveenv Doc ID 023036 Rev 1 15 39 Working with pre flashed software UM1535 2 8 Note 16 39 Connecting the evaluation board to a LAN The evaluation board should be connected to a developer s host PC over a private LAN or even a point to point link Commonly used private IP addresses Class C are in the range 0f192 168 0 0 192 168 255 255 Some SPEAr evaluation boards currently EVALSPEAR1340 EVALSP1300CPU EVASPEAR320S and EVALSPEAR310 provide multiple Ethernet ports Each port requires a different IP address The procedure described below is applicable to a single port usually the one used for software development As an example let s assume an IPv4 local area network with the following characteristics Network IPs 192 168 1 X Host PC IP 192 168 1 1 Evaluation board IP 192 168 1 10 On a Linux PC configure the host address as follows ifconfig ethO 192 168 1 1 broadcast 192 168 1 255 netmask 25525552550 In this example we are assuming that evaluation board is connected to Ethern
38. ot providing the best performance in terms of booting time Booting up to the Linux prompt To boot Linux just power up the board You then see the bootloader messages and prompt If you press space key in this phase you stop the bootloader execution and display the U Boot command prompt see next section Instead wait for a few seconds while the Linux kernel is loaded and launched Progress is displayed by a sequence of kernel boot messages The root filesystem is mounted automatically the system shell is run and a prompt appears when it is ready to accept commands The pre flashed filesystem provides a default set of system commands and runtime libraries System commands are the familiar basic utilities mainly provided to support the development and debugging stages They are all stored under standard Linux paths They may not be strictly needed in a final product however their small size allows them to be kept in production devices without a significant penalty in terms of memory footprint As is typical for embedded Linux environments STLinux uses BusyBox an open source program combining tiny versions of many common user space Linux utilities into a single small executable an important factor when minimized Flash footprint is required BusyBox has been developed with size optimization and limited resources in mind for this reason the available commands typically have fewer options than their full featured GNU counterparts However
39. portant to know that a current environment maintained in DDR RAM memory can be sometimes different from the persistent environment stored on Flash Doc ID 023036 Rev 1 ky UM1535 Working with pre flashed software 2 7 3 Note 4 To create a new variable or change the value of an existing one run the setenv command gt setenv MYVAR MYVALU ea To edit existing variables use the edit command gt edit MYVAR gt edit MYVALUI Change the value of the variable MYVAR to a new value MYNEWVAL and press ENTER To make the current values of all variables persistent in Flash memory run the saveenv command zz gt Saveenv Finally to report all current environment settings use the printenv command u boot gt print bootargs console ttyAMA0 115200 root dev mtdblock4 rootfstype jffs2 bootcmd bootm 0xe6050000 ramboot setenv bootargs root dev ram rw console ttyAMAO0 115200 othbootargs bootm 0xe6050000 nfsboot bootp setenv bootargs root dev nfs rw nfsroot serverip rootpath ip ipaddr serverip gatewayip netmask hostname netd ev off bootdelay 1 baudrate 115200 usbtty cdc_acm ethact mii0 stdin serial stdout serial stderr serial verify n Environment size 507 8188 bytes u boot gt Advanced commands More advanced usage of U Boot includes commands for e Reading and writing embedded MPU registers and memory areas e Executing the conte
40. pplication level userland 4 1 Workflow models When working at application level the so called userland developers are only concerned with programs and libraries stored in a root file system Bootloaders and the kernel are assumed to be stable and stored in Flash memory There are many approaches workflows to modify extend the root file system for specific application scenarios the main ones are described in the following subsections 4 1 1 Remote mounting of the root file system NFS If the board can be connected to the development PC through a Ethernet LAN the most practical solution is to leave the root file system stored on the PC and remotely mount it on the target embedded Linux OS through the NFS protocol The advantages of this approach are e The root file system has no global size constraints Developers can keep hundreds or thousands of packages programs and libraries in a directory of their PC disk All file access from the Linux OS running on the board is performed over the network in a transparent way Files are not copied to Flash memory but loaded to DDR RAM strictly on demand e Aprogram or library can be simply built compiled and linked with the output file on the PC disk the new version is then available for execution on the board without any need for manual transfer or board reboot The drawbacks are e File access by NFS over LAN can be slower than direct Flash memory access e There is no early ass
41. r liability in connection with its Licensed Software Nothing contained in this Agreement will be construed as i a warranty or representation by ST to maintain production of any ST device or other hardware or software with which the Licensed Software may be used or to otherwise maintain or support the Licensed Software in any manner and ii a commitment from ST and or its licensors to bring or prosecute actions or suits against third parties for infringement of any of the rights licensed hereby or conferring any rights to bring or prosecute actions or suits against third parties for infringement However ST has the right to terminate this Agreement immediately upon receiving notice of any claim suit or proceeding that alleges that the Licensed Software or your use or distribution of the Licensed Software infringes any third party intellectual property rights All other warranties conditions or other terms implied by law are excluded to the fullest extent permitted by law Limitation of liabilities In no event ST or its licensors shall be liable to You or any third party for any indirect special consequential incidental punitive damages or other damages including but not limited to the cost of labour re qualification delay loss of profits loss of revenues loss of data costs of procurement of substitute goods or services or the like whether based on contract tort or any other legal theory relating to or in connection with the Li
42. rmv5 bin export CROSS_COMPILE armv5 linux As well as these paths the host binaries path is added with export PATH PATH opt STM STLinux 2 4 host bin In order to preserve this configuration the same commands should be also be put in a bash shell initialization file Installing from FTP rsync command The STLinux 2 4 distribution can also be installed by copying contents from the FTP site and then installing Using the rsync command makes copying and synching easy The same command can be run periodically to keep the local copy in sync with the updates on the remote server These local copies can be used to install the STLinux distribution ARMV7 install all armv7 glibc spear ARMV5 install all armv5 glibc spear Doc ID 023036 Rev 1 21 39 The STLinux distribution UM1535 22 39 Run following command rsync rsync ftp stlinux com Sub repositories are listed the important ones being stlinux2 4 armv5 STLinux 2 4 ARM v5 RPMS stlinux2 4 armv7 STLinux 2 4 ARM v7 RPMS stlinux2 4 SRPMS STLinux 2 4 SRPMS Do a local copy on a single sub repository with rsync tav rsync ftp stlinux com stlinux2 4 armv7 my_copy Make sure that you add at the end of the remote path but not at the end of the local path Install the STLinux 2 4 workbench with the following command install stworkbench Doc ID 023036 Rev 1 ky UM1535 Working at application level userland 4 Working at a
43. rocessors manufactured by or for an entity other than ST is a material breach of this Agreement and requires a separate license from ST No source code and or object code relating to and or based upon Licensed Software is to be made available by You to any third party for whatever reason You acknowledge and agrees that the protection of the source code of the Licensed Software warrants the imposition of security precautions and You agree to implement reasonable security measures to protect ST s proprietary rights in the source code of the Licensed Software You shall not under any circumstances copy duplicate or otherwise reproduce the source code of the Licensed Software in any manner except as reasonably necessary to exercise Your s rights hereunder and make one back up copy You are granted the right to make one archival or backup copy of the source code of the Licensed Software which copy shall be marked as an archival copy and as the confidential information of ST Access to the source code of the Licensed Software shall be restricted to only those of Your employees with a need to know for the purpose of this Agreement You will not under any circumstances permit the source code of the Licensed Software in any form or medium including but not limited to hard copy or computer print out to be removed from your official premises as you have informed us The source code of the Licensed Software must remain inside your official premises as you h
44. s of such Licensed Software only for use with the Product ii make copies prepare derivatives works display internally and use internally object code versions of the Licensed Software for the sole purpose of designing developing and manufacturing the Products iii make use sell offer to sell import or otherwise distribute Products Ownership and copyright Title to the Licensed Software related documentation and all copies thereof remain with ST and or its licensors You may not remove the copyrights notices from the Licensed Software You may make one 1 copy of the Licensed Software for back up or archival purposes provided that You reproduce and apply to such copy any copyright or other proprietary rights notices included on or embedded in the Licensed Software You agree to prevent any unauthorized copying of the Licensed Software and related documentation Restrictions Unless otherwise explicitly stated in this Agreement You may not sell assign sublicense lease rent or otherwise distribute the Licensed for commercial purposes in whole or in part purposes unless you are an authorized ST distributor provided that all the other clauses of this DEMO PRODUCT LICENSE AGREEMENT shall apply entirely Doc ID 023036 Rev 1 ky UM1535 Software license agreement 9 5 You acknowledge and agree that any use adaptation translation or transcription of the Licensed Software or any portion or derivative thereof for use with p
45. sdal mnt 2 Now the SATA file system can be accessed under mnt directory 3 Transfer files as usual for example cp command 4 When finished unmount the SATA umount mnt 5 Now you can physically unplug the SATA Entering the U Boot resident monitor The U Boot resident monitor offers an interactive command line interface that can be used through the serial console U Boot is executed before starting the Linux OS In order to interrupt the normal boot process and enter U Boot operation mode press a key from the virtual terminal on the Windows or Linux PC during the initial period after hardware reset when the following message is displayed Hit SPACE to stop autoboot _ To obtain a full list of U Boot commands available on SPEAr board enter the help command or simply type the character When help is followed by a command name a description of that specific command is displayed The following subsections describe basic usage scenarios Please note that command results are only shown as examples and can look slightly different depending on the evaluation board and software version you use Detailed documentation about the described commands as well as additional ones may be found on the main U Boot Web site http www denx de wiki U Boot Not all the commands mentioned in denx are implemented in U Boot Doc ID 023036 Rev 1 13 39 Working with pre flashed software UM1535 2 7 1 2 7 2 14 39 Inform
46. support is available on the PC side use the following command rpm q dhcp If the DHCP package is not available install it on the PC from your distribution media for example Fedora Linux CDROM or website The next step is to create or change the DHCP configuration file etc dhcp dhcpd conf that matches a specific network setup as shown in the following example DHCP Server Configuration file see usr share doc dhcp dhcpd conf sample see man 5 dhcpd conf default lease time 600 max lease time 7200 option subnet mask 255 255 255 0 option broadcast address 192 168 1 255 allow bootp allows kernel download using tftp ddns update style ad hoc subnet 192 168 1 0 netmask 255 255 255 0 option routers 192 168 1 1 option subnet mask 255 255 0 0 option domain name local net option domain name servers ns local net host SPEAr hardware ethernet 00 11 22 33 44 55 fixed address 192 168 1 10 option host name SPEAR next server 192 168 1 1 filename uImage img kernel image filename in tftp path option root path opt STM STLinux 2 4 devkit armv7 target With this configuration the DHCP server replies to a request from a SPEAr evaluation board with Ethernet MAC address 00 1 1 22 33 44 55 just as in the example by passing the entire network configuration Doc ID 023036 Rev 1 17 39 Working with pre flashed software UM1535 2 9 2 9 1 18 39 The allow bootp and f
47. t for example on Fedora Linux systems you have usually to add your user to the dialout system group Minicom is one of the most commonly used terminal emulators for Linux Assuming a Fedora distribution for the host PC to check the availability of Minicom execute the following command rpm q minicom To install minicom if not found execute this command from a root shell yum install minicom To start minicom type the command minicom To enter the configuration menu for the first time press the key combination Ctrl A and then Z in sequence If there is no global configuration file minicom will not start You first need to create one by running the following command from a root shell minicom s and then follow the normal configuration procedure Doc ID 023036 Rev 1 ky UM1535 Working with pre flashed software 2 2 The serial connection information can be configured in the configure minicom submenu and then Serial port setup After that the configuration must be saved using the Save setup as option The serial device name to be entered must match the one used for the link to the SPEAr evaluation board For example the first serial port on Linux PC is named dev ttySO Select the serial speed as 115200 bps with 8 bit no parity and 1 stop bit 115200 8N1 and disable both hardware and software flow control Figure 3 Minicom serial port configuration Linux PC File Edit View Termin
48. th upon reasonable notice to enter Your s official premises in order to verify your compliance with this Restriction clause No warranty The Licensed Software is provided as is and with all faults without warranty of any kind expressed or implied ST and its licensors expressly disclaim all warranties expressed implied or otherwise including without limitation warranties of merchantability fitness for a particular purpose and non infringement of intellectual property rights ST does not warrant that the use in whole or in part of the Licensed Software will be interrupted or error free will meet your requirements or will operate with the combination of hardware and software selected by You Doc ID 023036 Rev 1 35 39 Software license agreement UM1535 9 7 36 39 You are responsible for determining whether the Licensed Software will be suitable for your intended use or application or will achieve your intended results ST has not authorized anyone to make any representation or warranty for the Licensed Software and any technical applications or design information or advice quality characterization reliability data or other services provided by ST shall not constitute any representation or warranty by ST or alter this disclaimer or warranty and in no additional obligations or liabilities shall arise from ST s providing such information or services ST does not assume or authorize any other person to assume for it any othe
49. tructure and change the options When all changes are done save the configuration and exit The new configuration is saved ina hidden config file If you like you can choose another name Rebuilding the kernel After the configuration step is finished the kernel can be rebuilt with a make command make ARCH arm CROSS_COMPILE armv7 linux ulImage If you configured some components as modules you also need a make ARCH arm CROSS_COMPILE armv7 linux modules command afterwards The time required for the build process is varies depending on the number of features you choose during the configuration step and your PC speed usually it takes some minutes When the build process is completed you can find the kernel images in the arch arm boot subdirectory of the kernel tree both as uncompressed Image and compressed zlmage ulmage kernel image Workflow models The kernel binary image is always generated on the development PC However there are many approaches workflows to make the kernel operating on the target evaluation board The main ones are described in the following subsections Booting the kernel on demand If the board can be connected to the development PC through an Ethernet LAN one solution is to load the kernel binary image file just after reset by configuring U Boot for automatic file transfer by TFTP protocol This approach is especially useful when frequently modifying the kernel for instance during
50. vided is extended with support for the required SPEAr specific hardware In addition to its role in the overall booting process U Boot also operates as a resident monitor To start the monitor function after power on stop U Boot execution before Linux is started U Boot is mainly in charge of loading and executing the Linux kernel This stage is configured in a special Flash partition known as U Boot Environment basically a collection of parameter value pairs When not interrupted after board power on U Boot loads the Linux kernel to DDR memory and then starts its execution The kernel after further preliminary initialization mounts the so called root file system This is the binary image containing all software and data that comprise the operating system complementing the kernel The root file system is the hierarchical file structure that end users see from the familiar Linux shell prompt For pre Doc ID 023036 Rev 1 ky UM1535 Working with pre flashed software 2 3 flashed software it contains a generic subset of initialization scripts system commands and runtime libraries There is a wide choice of file system standards for Flash memories in the Linux world for example CRAMFS JFFS2 YAFFS2 LogFS UBIFS The pre flashed software is based on the most commonly used standard namely JFFS2 The main advantage of JFFS2 is the built in support for compression It is also the most consolidated file system while generally n
51. xinetd daemon to force it to reload the new configuration Type the following command from the host PC prompt Service xinetd restart Stopping xinetd OK Starting xinetd OK Updating the kernel on Flash memory by U Boot You can use U Boot and TFTP transfer to write a new kernel image on Flash memory For example use the following procedure to update the kernel on serial NOR Flash for the SPEAR1300EVAL evaluation board 1 Press the space key to enter U Boot autoboot 2 Configure network parameters statically or with DHCP see relevant sections 3 Start the TFTP server on the host machine 4 Place the desired image in the host PC TFTP root directory for example tftpboot ulmage_new img 5 From the U Boot console download the image to RAM here we use address 0x0 with TFTP client gt tftp 0x0 ulImage_new img 6 Erase the specified kernel area on serial NOR gt erase 0 5 31 Write the image on serial NOR you need to know the image size In this example we copied 1663104 bytes 0x196080 in hexadecimal to the start of the kernel area on serial NOR OxF8050000 in hexadecimal gt cp b 0x0 OxF8050000 0x196080 7 Reboot the evaluation board Doc ID 023036 Rev 1 ky UM1535 Rebuilding the bootloaders 7 7 1 4 Rebuilding the bootloaders XLoader The default XLoader provided as pre flashed on all SPEAr evaluation boards as well as binary image on ST Web site for upgrades is built for serial NOR

Download Pdf Manuals

image

Related Search

Related Contents

CodeVisionAVR revision history  Bulletin Numismatique n° 146  ミニプロ ルビーレッド プラス - CLUB T-fal  MANUEL D`UTILISATION    ENA 9 One Touch L`arôme au maximum  BDP5010/F7 Philips Blu  

Copyright © All rights reserved.
Failed to retrieve file