Phytec Linux-Kit phyCARD-M Скачать руководство пользователя страница 12

phyCARD-M 

Quick Start Instructions 

2.2

 

Configuring the Host Platform 

In this passage you will learn how to configure the host platform. You will 
execute the following steps: 

 

Install additional software packages. These packages are necessary to 
accomplish the steps in the Quick Start Instructions. 

 

Set up the network configuration to use the host PC with your target. 

 

Disable the firewall. If the firewall is enabled, you will have problems 
with connecting to the target.  

 

Set up a TFTP server. You can use a TFTP server to download files 
(e.g. kernel and root file system images) to the target from within the 
target’s boot loader. 

2.2.1

 

Installing Software Packages 

To accomplish the steps in the Quick Start Instructions, you will have to 
install additional packages.

 

 

If you don’t install all of these packages, the setup may fail or 
some configuration steps won’t work correctly.

 

8

 

© 2010  PHYTEC Messtechnik GmbH     L-746e_1 

Содержание Linux-Kit phyCARD-M

Страница 1: ...YTEC Technology Holding company Quick Start Instructions Linux Kit phyCARD M Using Eclipse and the GNU Cross Development Tool Chain Note The PHYTEC Linux phyCARD M Disc includes the electronic version...

Страница 2: ...echnik GmbH offers no guarantee nor accepts any liability for damages arising from the improper usage or improper installation of the hardware or software PHYTEC Messtechnik GmbH further reserves the...

Страница 3: ...kages 8 35 min 2 2 2 Set Up Network Card Configuration 14 2 2 3 Disabling the Firewall 15 2 2 4 Set Up TFTP Server 16 2 3 Linux phyCARD M Kit Setup 18 2 3 1 Starting the Setup 20 2 4 Advanced Configur...

Страница 4: ...ng the Program when Booting the Target 74 Chapter 4 Debugging an Example Project 79 4 1 Starting the GDB Server on the Target 80 4 2 Configuring and Starting the Debugger in Eclipse 81 35 min 4 3 Sett...

Страница 5: ...cific information on board level features such as jumper configuration memory mapping and pin layout 1 1 Rapid Development Kit Documentation This Rapid Development Kit RDK includes the following elect...

Страница 6: ...Development Kit description as well as software installation advice and an example program enabling quick out of the box start up of the phyCARD M in conjunction with the Eclipse IDE and GCC C C softw...

Страница 7: ...or other text that should be typed literally by the user Pay attention to notes set apart from the text with the following icons At this part you might leave the path of this Quick Start This is a war...

Страница 8: ...hernet cross over cable and AC adapter supplying 12 VDC min 2 A PHYTEC Linux distribution based on OSELAS from Pengutronix An IBM compatible host PC 586 or higher CPU openSUSE 11 0 x86 and the KDE 3 5...

Страница 9: ...ins add a C C perspective to the Eclipse Workbench that can now support C C development with a number of views and wizards along with advanced editing and debugging support Due to its complexity the...

Страница 10: ...important concept when the target system doesn t have a native set of compilation tools or when the host system is faster and has greater resources The platform where the actual development takes plac...

Страница 11: ...USE 11 0 you can select KDE 3 5 as Desktop selection The default packages to use openSUSE 11 0 with your host PC will be selected automatically This default selection will suffice to pass the steps in...

Страница 12: ...ur target Disable the firewall If the firewall is enabled you will have problems with connecting to the target Set up a TFTP server You can use a TFTP server to download files e g kernel and root file...

Страница 13: ...ing Started Open the K menu from the lower left corner of the desktop and click on the tab Computer Open the Administrator Settings YaST Enter your root password and click OK 2010 PHYTEC Messtechnik G...

Страница 14: ...yCARD M Quick Start Instructions Open Software Management in Software Select the filter Search Type libxml2 devel and click the Search button Check libxml2 devel 10 2010 PHYTEC Messtechnik GmbH L 746e...

Страница 15: ...M Getting Started Type python devel and click the Search button Check python devel Type tftp and click the Search button Check the packages tftp and yast2 tftp server 2010 PHYTEC Messtechnik GmbH L 74...

Страница 16: ...rt Instructions Type qt3 devel and click the Search button Check qt3 devel Select the filter Patterns Select Basis Development C C Development and Tcl Tk Development Click Accept 12 2010 PHYTEC Messte...

Страница 17: ...will be selected automatically to resolve any dependencies If problems occur while resolving dependencies we re commend going back to a default configuration Click Continue to install the packages Cli...

Страница 18: ...the IP address of your host We recommend disconnecting your host from any other network If you change the host s IP chances are that problems may occur with other hosts in the network Open the YaST Co...

Страница 19: ...e Network Card Setup Choose Static address setup Enter IP address 192 168 3 10 and subnet mask 255 255 255 0 2 2 3 Disabling the Firewall To ensure that there are no problems with connections to the t...

Страница 20: ...e firewall is now disabled for this network card 2 2 4 Set Up TFTP Server Later in this Quick Start you will learn how to write a new kernel image into the flash memory of the target To download the k...

Страница 21: ...If the TFTP Server icon does not exist restart the YaST Control Center Switch the selection to Enable The path of the boot image directory should be tftpboot If there is a different path change it to...

Страница 22: ...y a graphical interface At the end of the setup you will find all programs to develop applications for the target on your host PC The setup will install the following programs GNU C C cross developmen...

Страница 23: ...am on the target There will be some additional configuration steps performed on your PC The setup program will create desktop links to the installed programs The setup will also create desktop links t...

Страница 24: ...structions 2 3 1 Starting the Setup To start with the Linux PowerPC Kit Setup enter your PHYTEC Linux PowerPC Disc into your CD ROM drive The following dialog may appear Click Cancel 20 2010 PHYTEC Me...

Страница 25: ...tting Started From the K menu select the Applications tab Select System Terminal Terminal Program Konsole Type cd media SO 482 Enter install sh to launch the setup program 2010 PHYTEC Messtechnik GmbH...

Страница 26: ...mount point in the directory media The mount points can be shown with the command ls media Change to the accordant directory if no directory SO 482 should exist Enter the root password Click Yes to p...

Страница 27: ...phyCARD M Getting Started Click Next to continue Click Next 2010 PHYTEC Messtechnik GmbH L 746e_1 23...

Страница 28: ...ements within this Quick Start manual are based on the assumption that you accept the default installation paths If you decide to individually choose different paths you must consider this for all fur...

Страница 29: ...ogram mkimage will be installed to usr local bin All other programs and examples will be installed to the selected destination directory After the files have been copied a dialog box for the Eclipse i...

Страница 30: ...tions We recommend installing Eclipse even if you already have installed Eclipse on your system The version of Eclipse provided on the setup CD ROM includes additional plug ins Click Next 26 2010 PHYT...

Страница 31: ...phyCARD M Getting Started Click Finish to exit the setup Close the terminal window Now you will have to restart the KDE desktop 2010 PHYTEC Messtechnik GmbH L 746e_1 27...

Страница 32: ...nd password to restart the KDE desktop You have successfully installed the software for the Linux phyCARD M Kit You can now use the programs you need to develop your own applications for the target on...

Страница 33: ...start the cross compiler directly from every location of the system the directory of the cross compiler was added to the PATH environment variable You can manually add the directory of the cross compi...

Страница 34: ...rocom as well as via a Telnet session using a peer to peer network connection Connect the serial cable with the UART1 connector P1 port on the target and the first serial interface on your host Ensure...

Страница 35: ...he power supply first the boot loader Barebox is loaded from the flash memory Then the boot loader is uncompressing and booting the Linux kernel from the flash The kernel will then mount the root file...

Страница 36: ...ring a file system s content without requiring outside intervention regardless of power failures Troubleshooting If you don t see any output in the Microcom window check the serial connection between...

Страница 37: ...group membership to take effect Now you can test the network connection to the target Click the Telnet for Target icon on your desktop A new window with a connection to the target opens If you can see...

Страница 38: ...ou do not see the login you may not have set up the right IP address of your host You can check the settings of your network card by opening YaST In the YaST Control Center you can select Network Sett...

Страница 39: ...ou will execute the example on the target At the end of this passage you can find some information on how to copy and execute a file on the target using the command line 2 6 1 Copying a Program to the...

Страница 40: ...can use these two windows to copy files per drag and drop from the host to the target and vice versa Select the window that lists HelloWorld program on your hard disk Click the HelloWorld program and...

Страница 41: ...he Target Click the Telnet for Target icon on your KDE desktop Enter root as login and press Enter Enter HelloWorld and press Enter The program starts and you should see the following output Welcome t...

Страница 42: ...e the user logs in from is listed in etc hosts equiv on the remote machine and the user name is the same on both sides the user is allowed to log in On the target the file etc hosts equiv has the foll...

Страница 43: ...security is a concern Click the SSH for Target icon on the desktop A new window opens In this window you can see that the authenticity of the phyCARD M can t be established This is normal if you want...

Страница 44: ...rget s prompt We expect that you haven t changed the SSH configuration file on your host If you change this file the authentication may not work Now you are logged in you can execute programs on the t...

Страница 45: ...tion to the target by typing ftp u ftp root root 192 168 3 11 HelloWorld Be sure to enter a slash followed by a space after the IP address 2 7 2 Executing a Program on the Target Open a Telnet session...

Страница 46: ...e At the end of this chapter you will execute the program as an external application out of Eclipse Additionally you will add your application to the startup configuration of the target so it is autom...

Страница 47: ...nloadable from our ftp server Please create a temporary directory within your home directory for example local and copy the files into it Now open a new terminal if not already open and install PTXdis...

Страница 48: ...ngutronix de If any tool that is necessary for PTXdist is missing script will abort with an error In this case you need to install the missing tool from your linux distribution After that please resta...

Страница 49: ...form protocol address port PTXdist will store downloaded source packages locally Thus if you work with more than one project every project would download its own sources even if they are the same tha...

Страница 50: ...S Toolchain 1 99 3 arm 1136jfs linux gnueabi gcc 4 3 2 glibc 2 8 binutils 2 19 kernel 2 6 27 sanitized bin Otherwise you need to choose the toolchain manually ptxdist toolchain opt OSELAS Toolchain 1...

Страница 51: ...nd a needed source package please tell us via support phytec de Sometimes it even might happen that ptxdist can download a file that is claimed to be an archive but then cannot decompress it Reason is...

Страница 52: ...he default configuration you will find four partitions on the target The first partition contains the boot loader the second is used to store the boot loader settings the third partition stores the Li...

Страница 53: ...images to the tftpboot directory and exit cd platform phyCARD M images cp linuximage tftpboot cp root jffs2 tftpboot exit Open Microcom and press the RESET button on the target You will see the output...

Страница 54: ...the configuration file eth0 ipaddr 192 168 3 11 eth0 netmask 255 255 0 0 eth0 serverip 192 168 3 10 Type CTRL D to save the settings to the file If you made any changes to the Barebox environment type...

Страница 55: ...new kernel The target will boot the newly created kernel Close Microcom when the target has successfully finished with booting the kernel and mounting the root file system Troubleshooting If any probl...

Страница 56: ...started with the new images 3 2 Opening an Existing Project In this section you will import an existing Eclipse project into your workspace The imported example project will be compiled with the cros...

Страница 57: ...Close the Konqueror file browser 3 2 2 Starting Eclipse and Importing the Example Project Click the Eclipse icon to start the application You can find this icon on your desktop Confirm the Workspace d...

Страница 58: ...phyCARD M Quick Start Instructions Select File Import from the menu bar Select Existing Projects into Workspace Click Next 54 2010 PHYTEC Messtechnik GmbH L 746e_1...

Страница 59: ...phyCARD M Getting More Involved Select Browse Double click the HelloWorld directory in your home directory Click OK 2010 PHYTEC Messtechnik GmbH L 746e_1 55...

Страница 60: ...phyCARD M Quick Start Instructions Select Finish to import the project Close the Welcome screen 56 2010 PHYTEC Messtechnik GmbH L 746e_1...

Страница 61: ...me to the World of the phyCARD M message in the Console window Select the Console tab You will see the following content in the Console window If the project is not built automatically you will have t...

Страница 62: ...ate a new project with Eclipse and how to configure the project for use with the GNU C C cross development toolchain Open Eclipse if it isn t already opened Select File New Project from the menu bar A...

Страница 63: ...phyCARD M Getting More Involved Enter the project name myHelloWorld and click Next Click Next 2010 PHYTEC Messtechnik GmbH L 746e_1 59...

Страница 64: ...phyCARD M Quick Start Instructions Click Finish Select Yes to open the C C perspective You will see the C C IDE with the myHelloWorld project 60 2010 PHYTEC Messtechnik GmbH L 746e_1...

Страница 65: ...phyCARD M Getting More Involved Right click on HelloWorld c in the HelloWorld project which we have worked with previously Select Copy 2010 PHYTEC Messtechnik GmbH L 746e_1 61...

Страница 66: ...ow be compiled and created with the standard GCC C C compiler suitable for your host machine You will find the executable file which can only be run on your host system in the workspace myHelloWorld D...

Страница 67: ...phyCARD M Getting More Involved Select C C Build Enter arm 1136jfs linux gnueabi gcc into the Command input field 2010 PHYTEC Messtechnik GmbH L 746e_1 63...

Страница 68: ...phyCARD M Quick Start Instructions Select GCC C Linker Enter arm 1136jfs linux gnueabi gcc into the Command input field 64 2010 PHYTEC Messtechnik GmbH L 746e_1...

Страница 69: ...phyCARD M Getting More Involved Select GCC Assembler In the Command input field change the default as to arm 1136jfs linux gnueabi as Click Apply 2010 PHYTEC Messtechnik GmbH L 746e_1 65...

Страница 70: ...eld ftp u ftp root root 192 168 3 11 myHelloWorld ssh root 192 168 3 11 myHelloWorld Be sure to enter the semicolon between myHelloWorld and ssh Be sure the file myHelloWorld on the target will have e...

Страница 71: ...rebuilt Select the Console tab If no errors occur while building the project you will see the following output You have successfully created your first own project with the Eclipse IDE You have config...

Страница 72: ...ude the following two additional header files include unistd h include fcntl h Then add the function write_tty which writes n bytes to the first serial interface which on the phyCARD M is connected to...

Страница 73: ...phyCARD M Getting More Involved Save your program after changing the code The application will be compiled built copied to the target and executed 2010 PHYTEC Messtechnik GmbH L 746e_1 69...

Страница 74: ...u can t see this line in an SSH session because you are connected over a TCP IP connection to the target With Microcom however you have direct access to serial interface so you can also see the line t...

Страница 75: ...program is copied to the target and directly executed A program can also be executed on the target without compiling a project In the following section you will learn how to start a program on the ta...

Страница 76: ...phyCARD M Quick Start Instructions Select Program Select New 72 2010 PHYTEC Messtechnik GmbH L 746e_1...

Страница 77: ...nter usr bin ssh in the Location input field Enter root 192 168 3 11 myHelloWorld into the Arguments field Select Apply Select Run If you want to execute the program the next time you can use the Run...

Страница 78: ...irectly or indirectly by sbin init the father of all processes The configuration of sbin init is placed in etc inittab After system startup sbin init will switch to the default run level as configured...

Страница 79: ...just click OK no password is required In the directory etc init d you can see the existing scripts Right click in the opened window and select Create New Text File Enter myHelloWorld Click OK Right cl...

Страница 80: ...tor KWrite starts with an empty document Enter the following two lines bin sh home myHelloWorld Select File Save Close the KWrite window Close the FTP window Click the Telnet for Target icon on your d...

Страница 81: ...c init d The scripts are started in alphabetic order The script udev is the first script started because the link starts with S00 whereas S99zzz_PHYTEC_BSP_version_startup_script will be started last...

Страница 82: ...tarts with S99 you should see myHelloWorld s output near the output of the two other scripts that start with S99 which print all sorts of version information Close Microcom Now you can add your own pr...

Страница 83: ...he Debug view allows you to manage the debugging and running of a program in the Workbench Using the Debug view you will be able to set breakpoints watchpoints in the code and trace variables and regi...

Страница 84: ...myHelloWorld program To debug a program with GDB the program needs extended debugging symbols This has already been added while building the program Open Microcom Type root and press Enter Start the G...

Страница 85: ...ger After the configuration of your project settings the GNU debugger will start and connect to the GDB server on the target Start Eclipse if the application is not started yet Select myHelloWorld in...

Страница 86: ...phyCARD M Quick Start Instructions Select the Search Project button Click OK 82 2010 PHYTEC Messtechnik GmbH L 746e_1...

Страница 87: ...beside the GDB debugger input field A new dialog opens to choose the GDB executable Click on File System Navigate to the directory opt OSELAS Toolchain 1 99 3 arm 1136jfs linux gnueabi gcc 4 3 2 glibc...

Страница 88: ...box select TCP Enter 192 168 3 11 the target s IP address in the Host name input field The host s GDB will connect to this IP address to communicate with the target s GDB server Click Apply Click Deb...

Страница 89: ...s at the first line automatically The host s GDB is now connected to the GDB server on the target You have configured your project for remote debugging You have started the GNU debugger in Eclipse and...

Страница 90: ...breakpoint will be set on the last line of the function main If you resume the application the debugger will stop on this line Select the last line in main Right click into the small grey border on th...

Страница 91: ...h the example project with the debugger You will also learn how to watch the content of a variable Expand buf in the Variables window Click the Step Over button in the Debug window to step to the next...

Страница 92: ...function write_tty The debugger stops in write_tty You will see the following variable window Click on the variable buffer You will probably see a different address at the buffer pointer Remember wha...

Страница 93: ...Values In this section you will change the value of a variable At the end of this part you will see the effect of this change Select the count variable in the Variables window Right click on count and...

Страница 94: ...ck the Step Over button two times Change to Microcom You will see the output Welcome in the Microcom window This means that due to changing the counter variable s value instead of printing the full We...

Страница 95: ...on of this chapter you will use the memory monitor to watch the content at a memory address Select the Memory tab Click Add Memory Monitor Enter the address of buffer and click OK Remember that the va...

Страница 96: ...phyCARD M Quick Start Instructions Change the window size Click Add Rendering Select ASCII and click OK 92 2010 PHYTEC Messtechnik GmbH L 746e_1...

Страница 97: ...ugger stops at the breakpoint in the last line of main Click the Resume button to end the application You have successfully passed the debugging chapter You are now able to configure and use Eclipse f...

Страница 98: ...host to provide a basis for working with your target platform You installed the Rapid Development Kit software and learned how to copy and run a program on the target In the Getting More Involved sect...

Страница 99: ...Insert your PHYTEC Linux phyCARD M Disc navigate to the PHYTEC PCA101 phyCARD M Linux Kit Software Tools ADS_Toolkit directory and execute Setup exe to install the AdvancedToolKit There are three addi...

Страница 100: ...s Choose i MX35 from the i MX CPU drop down box Select DDR2 as initial device memory Select the Serial Port which the phyCARD M is connected to Click Next In the next window select Flash Tool Click Go...

Страница 101: ...p down box In the Operating settings section set Address to 00000000 and Size to 40000 A size of 40000 will delete the Barebox flash partition only If you also want to delete the Barebox environment p...

Страница 102: ...ck the Browse button in the Image section to select the Barebox image you want to write to the target Navigate to the directory PHYTEC PCA101 phyCARD M Linux Kit BSP Barebox bin on your setup CD ROM a...

Страница 103: ...phyCARD M Installing Linux on the phyCARD M When finished power down the baseboard Configure JP1 by closing PIN 1 2 to boot with NAND Flash 2010 PHYTEC Messtechnik GmbH L 746e_1 99...

Страница 104: ...tor P1 on the target and the first serial interface on your host Connect the cross over Ethernet cable with the connector X27 on the target and the right network card of your host Click the Microcom i...

Страница 105: ...phyCARD M Installing Linux on the phyCARD M Press any key to stop autoboot Type edit env config to check and edit the configuration file 2010 PHYTEC Messtechnik GmbH L 746e_1 101...

Страница 106: ...et netmask eth0 serverip server IP address Type CTRL D to save the settings to the file Type save to write the settings to the target s flash Press the RESET button on your board The target will resta...

Страница 107: ...x Kit BSP Images on your setup CD ROM you can find a file called uImage pca101 this file is the Linux kernel image There is another file root pca101 jffs2 this file contains the Linux root file system...

Страница 108: ...save to write these changes to the target s flash Then press the RESET button on the target The board reboots with the new settings applied Then again press any key to stop autoboot Type update_kerne...

Страница 109: ...hyCARD M with Linux Quick Start Instructions Document Number L 746e_1 July 2010 How would you improve this manual Did you find any mistakes in this manual page Submitted by Customer number Name Compan...

Страница 110: ...Published by 2010 PHYTEC Messtechnik GmbH Ordering No L 746e_1 Printed in Germany...

Отзывы: