Home

phyBOARD-Wega AM335x Application Manual

image

Contents

1. D O gt N x a 2 egg Define subsystem information O LRN ok WwW 2 M v E Configuration Properties 3 stdio h v 2 Local Files dstore shells Property Value 7 unistd h gt gt My Home v ssh shells a fcntl h gt Root 48 main int Y gt Local Shells 4 write_tty char int void E 4 Available Services Generic shell service v 84 SSH Connector Service Ed SSH Settings T 2 1 Description erminal from the context menu Work with shells and commands on remote systems using the Secure Shell ssh 4 protocol lt Back sl s gt J conei MEERE Create a new resource B select ssh terminals and finish Untitled window File Edit Source Refactor S 99 Navigate Search Run Project Window Help e BL vrXr o New Connection Ed Ssh Terminals Q BY Bac c H Define subsystem information s t giRemot X O mB wer Ir 2 mit Configuration Properties v amp ssh terminals Property Value gt h Local Files Z gt Local Shells Available Services P 4 SSH Terminal Service v SSH Connector Service Ed SSH Settings Description a Work with terminals and commands on remote systems using the Secure Shell ssh protocol 4 amp 9 lt Back iia Camel j Finish ER mE n c F um Create a new resource PHYTEC Embedded Pvt Ltd 2014 20 Now we successfully create the connection B Click on the Wega Board Sftp Files My Home trimmedwi
2. Remote Systems and ok PHYTEC Embedded Pvt Ltd 2014 16 C C Eclipse File Edit Source Refactor Navigate Search Project Run Window Help LEXGUGUNCES Ea Ga RECA RCRA RO RI NC Rs XX Q ES C Remote X EH JA myHelloworld n FOX Em 2n em gt g myHellow a a a a includessi B axe Y include 4 zn v u LE amp Profiling u stdio h gt 2 Local Files Sint main V amp Remote Systems u unistd h 44 Remote Monitor f gt Local Shells chart x serial w 4 fentl h v Rana Board write ti Remote Scratchpad main int gt 2 Sftp Files abad FY Remote Search write tty char int void gt R Shell Processes Rt Remote Shell T Ssh Shells gt 28 Ssh Terminals 4A Remote System Details int out out open ih write out 49 Terminals close out amp SystemTap i vi Ta als amp YA Rana Board X root RANA AM335X P MSH myHelloworld root RANA AM335x myHelloWorld Hello World root RANA AM335x Writable Smart Insert 9 19 le Search Project Run Windo iti Sv Av an Di v vSvi v6v Er DO Er Av N BJ a se Q EY BRc Ce amp 5 Project Explorer X zm myHelloworld c 23 2 H n O X g amp myHelloworld c a S e ds include lt stdio h gt SR ax v myHelloworld finclude lt unistd h gt gt UP Binari include lt fcntl h gt BORD Y stdio h gt ih Includes int main u unistd h gt Debug Jy f
3. gt c C C Application C C Application gt c C C Attach to Application Debug myHelloworld c C C Postmortem Debugger uie Variables Search Project Browse v c C C Remote Application GI myHelloworld Debug Project Launch Group myHelloworld Browse Build if required before launching Build configuration N amp Select configuration using C C Application Enable auto build Disable auto build Use workspace settings Configure Workspace Settings Using GDB DSF Manual Remote Filter matched 8 of 8 items Debugging Launcher Select other Note Make sure that on the bottom of the Debug configuration Window it says Using GDB DSF Manual Remote Debugging Launcher If it does not then click on the Select Other and select this option PHYTEC Embedded Pvt Ltd 2014 24 B Select the Debugger tab Click the Browse button right beside the GDB debugger input field Navigate to the directory Path of the Toolchain gt bin arm cortexa8 linux gnueabihf gdb B Click OK Debug Configurations Create manage and run configurations 9 X 80i Name myHelloworld Debug x Debugger t Source EJ Common gt c C C Application amp Stop onstartup at main gt E C C Attach to Application c C C Postmortem Debugger v C C Remote Application Main Shared Libraries Connection EI myHelloworld Debug GDB debugger home shammi toolchain arm cortexa8 l
4. C C Remote Application adb B Click the Resume button to end the application PHYTEC Embedded Pvt Ltd 2014 32 Pardes Get the dialog going and stay in touch India PHYTEC Embedded Pvt Ltd 16 9C 3rd Floor 3rd Main 8th Block Opp Police Station Koramangala Bangalore 560095 www phytec in Germany PHYTEC Messtechnik GmbH Robert Koch Stra e 39 D 55129 Mainz Tel 49 6131 9221 32 Fax 49 6131 9221 33 www phytec de www phytec eu America PHYTEC America LLC 203 Parfitt Way SW Suite G100 Bainbridge Island WA 98110 Tel 1 206 780 9047 Fax 1 206 780 9135 www phytec com France PHYTEC France SARL 17 place St Etienne F 72140 Sille le Guillaume Tel 33 2 43 29 22 33 Fax 33 2 43 29 22 34 www phytec fr We are looking forward to hearing from you PHYTEC Embedded Pvt Ltd 2014 33
5. Ey eee ay esr ami myHelloworld c 14 2 note previous implicit declaration of write tty was here Finished building myHelloWorld c X Writable Smart Insert 13 59 B Save your program after changing the code B Select Project Build project from the menu bar The project will be build The application will be compiled build copied to the target and executed C C myHelloWorld myHelloWorld c Eclipse File Edit Source Refactor Navigate Search Project Run Window Help EF EC Ea A CC GT Oe ETF Q BS Bc c roject Explorer myHelloworld c nt amp Project Expl 23 M myHelloworld c amp SAR E i o im 44 v myHelloworld c ja B es include lt stdio h gt E ax v 4 5 myHelloworld include lt unistd h gt gt uP Rinari include lt fcntl h gt Misa u stdio h eg int main J unistd h gt Debug 2 fcntlh gt myHelloworld c char buf Welcome to the World of the phyBOARD WEGA AM335x serial n fcnti write tty buf sizeof buf 1 4 main int printf Hello World 49 write tty char int return O0 ovoid write tty char buffer int count 4 int out out open dev console 666 write out buffer count close out i e EJ Console X es i ts LB BB CDT Build Console myHelloworld Building target myHelloWorld Invoking Cross GCC Linker arm cortexa8 linux gnueabihf gcc o myHelloworld myHelloWorld o Fi
6. Includes return 0 e main int gt amp Debug gt myHelloworld c A A 7 EJ Console X es i ae 9 amp BER r EB ri n CDT Build Console myHelloworld 29 03 1U DZ 1 4U D4 UT 40 3U Te 33 Z0 3U T5 9M Please contact your system administrator Add correct host key in home shammi ssh known hosts to get rid of this message ee CO ae ene ee ice ee Se a ee RU DMARD Weis Writable Smart Insert 14 1 PHYTEC Embedded Pvt Ltd 2014 11 To compile your project for the phyBOARD WEGA AM335x instead you will have to use the GNU C C cross compiler Modify Post build steps B Right click the myHelloWorld project and chose Properties The Properties dialog appears B Select C C Build Setting Select the Build Steps tab Enter the following command in the Post build steps Command input field scp myHelloWorld root 192 168 1 11 home ssh root 192 168 1 11 myHelloWorld Settings ci S Tool Settings Build Steps Build Artifact Binary Parsers amp Error Parsers Pre build steps Command Description Post build steps Command scp myHelloworld root 192 168 1 11 home ssh root 192 168 1 11 myHelloworld Description ni un SED PHYTEC Embedded Pvt Ltd 2014 12 Note First login manually using ssh as shown in snapshot below Otherwise we will not be able to login in target because it requires secure connection 1 d 2 92 naveen Linux S ssh root
7. Ne 7 INS SPA lean SNOW BIO sa a ee TT 8 1 3 3 Open new C Source El RENE 10 1 3 4 Write simple Hello Application ccccccccsssossssessscccccccccassessscccccesccaasescesaescesaeess 11 Me eT NS POLO OC ONERE UNE 13 1 4 Changing the Demo Application cccccccccccccccccsceeeessssssesseseeeccccceeeseeeseuaaeeassssesceseeeess 14 1 4 1 Open Target Board using MiniCOM sssseseecccccceceeeeseeaeeeessssssesceseeasescseeeaeees 16 1 5 Remote System Access using EclipSe sssssssccssccccccccccccceessnsssssssssseeseecceceusesceeees 16 Bor YA TINO WAS ner VUE phe een 16 FO N c E C 16 1 5 1 Create New Connection for Remote System login eeeeeeeeeeessss 18 La2 Set the H st aime andl IP ee ee re nen 18 1 6 Debugging an example Project ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssesseees 23 1 6 1 Starting the GDB Server on the target sssssssseeeeccccccecceecceaeeesescesaeseeceeseaesees 23 1 6 2 Configuring and starting the debugger in ECLipSe ssssssesssssssssseeeeeeeeaaeeees 24 1 0 3 5e 111 Gl AK n oet EE E ONU DD MEME IM TID MEE MEN 27 1 6 4 Stepping and Watching Variable Contents cessere 28 1 6 5 Stepping and Watching Variable Contents ssssseeeccccccccceaeeeeecceeeeesecesaeusses 30 1 6 6 Using the Memory M
8. SSH Connector Service Ed SSH Settings i Description 1 a Work with files on remote systems using the Secure Shell ssh protocol prminal from the context menu HAR us IU lt Back Next gt Cancel Finish x Create a new resource B select processes shell linux and next C C Eclipse File Edit Source Refactor lt Create a new resource Navigate Search Project 19T E Run Window Help ty HG Br Qe wie my Sv Gy Ev Er Ove vrQrieag 9v u ES Gac c New Connection A Remote X H BON 9M E ECCE Processes N a J 2 Bs Define subsystem information AR Awe X Vv v ve Configuration Properties 24 stdio h v 5 Local Files dstore processes Property Value y unistd h gt 2b My Home v processes shell linux a 2 fentl h gt gt Root i 4 main int f Local Shells 49 write tty char int void j Available Services Shell Process Service Mene e Description This configuration allows you to work with processes on remote linux systems using any prminal from the context menu i contributed Shell subsystem EMO STE aD O lt Back Next Cancel Finish PHYTEC Embedded Pvt Ltd 2014 19 B select ssh shells and next C C Eclipse gt 99 gt File Edit Source Refactor Navigate Search Project Run Window Help nu Ss zu ww ir Gy G vix Over Qvi 0 y v oot i E EB c ce New Connection R E o El BON 9M 4B Remote
9. out out open dev console 666 write out buffer count close out Enter the following two lines in the main function to declare the buffer and call the write_tty function char buf 1 Welcome to the World of the phyBOARD WEGA AM335x serial n Y write tty buf sizeof buf 1 In the screenshot next page you can see the complete program PHYTEC Embedded Pvt Ltd 2014 14 C C myHelloWorld myHelloWorld c Eclipse File Edit Source Refactor Navigate Search Project Run Window Help mes S BRR O14 Sr Er SriF Over Qreivieas Fr so gm T6 v 9o De Q Ej Fe C C Project Explorer X BE l myHelloworld c X a BON i gt 44 v myHelloWorld c Jg j 5 e du include lt stdio h gt BER v i myHelloworld include lt unistd h gt v gt P Binaries include lt fcntl h gt c x u stdio h gt includes int main sy unistd h gt amp Debug fcntLh gt myHelloworld c char buf Welcome to the World of the phyBOARD WEGA AM335x serial n I fcntl EL write tty buf sizeof buf 1 a main int printf Hello World write tty char int return 0 amp ovoid write tty char buffer int count int out out open dev console 666 write out buffer count JA C close out b v EJ Console amp i IS LB BB a DmilvVr n HU CDT Build Console myHelloworld I Vi img SRDS WSS SERS WAP WES tas a
10. reprint broadcast photomechanical or similar reproduction and storage or processing in computer systems in whole or in part are reserved No reproduction may be made without the explicit written consent from PHYTEC Embedded Pvt Ltd India Europe North America Address PHYTEC Embedded PHYTEC PHYTEC America LLC 203 Parfitt Pvt Ltd Technologie Holding Way SW Suite G100 Bainbridge 16 9C 3rd Floor AG Island WA 98110 USA 3rd Main 8th Block Robert Koch Str 39 Opp Police Station 55129 Mainz Koramangala GERMANY Bangalore 560095 INDIA Ordering 91 80 40867046 49 800 0749832 1 800 278 9913 Information Sales phvtec in order phytec de sales phytec com Web Site http www phytec in http www phytec de http www phytec com PHYTEC Embedded Pvt Ltd 2014 Table of Contents MVOC COM ERE e 4 1 Application development using Eclipse IDE eeeeeeeeeeeeeeeeeeeeeeeeeeee nennen 4 LLL GPe TD IBS alla OBI eder tte ee 4 1 2 Eclipse IDE Configuration for phhyBOARD WEGA AM93235x eene 5 1 2 1 MOSES CUI OR ETE LEM 5 POCA E E 5 OE NVON erre E EE ee E E N E 5 122 A Se T 6 1 3 Creating a New Project in Eclipse cccccccccssssnsnsssssssssssseeseccecccccccccceassecccceasesceceuaceceeses 6 13 1 Hw to open Gc DSB een dicti verbu mesd timi ee 6 POLL IN 6 FOL Hn c ee
11. we will also learn how to check the content of a variable Expand buf in the Variables window 69 Variables X e Breakpoints so Registers Bi Modules Name Y S buf buf O buf 1 buf 2 buf 3 69 buf 4 69 buf 5 69 buf 6 69 buf 7 69 buf 8 69 buF 9 buf 10 69 buf 11 63 buf 12 69 buf 13 t bufl14l Lu 1010 zt E Type char 60 char char char char char char char char char h char char char char char i char Ad 7 Value Oxbed3ec34 136 X210 233 amp 16 A020 LX 1 V001 0VO oo 0VO oo 0 VO oo 0 o 4 004 105 i 5 o05 B Click the Step Over button in the Debug window to step to the next line 3 PHYTEC Embedded Pvt Ltd 2014 20 we will see the content of the buf variable in the Variables window Variables Z3 e Breakpoints Registers BA Modules A sts A rb F Name Type Value v S buf char 60 2 Oxbeeb7c34 buF O char ed buF 1 char buf 2 char buF 3 char 2 99 c cJ buf 4 char 111 o ed buf 5 char 109 m buf 6 char 101 e buf 7 char 32 gt 69 buf 8 2 char 2 116 t buf 9 char 111 o buf 10 2 char 32 fs Aoi FTA 47 ehar P 44 amp F B Click on the variable buf B Then click the button Step into to enter the function write tty The debugger stops in
12. write tty we will see the following variable window 6 Variables 23 Se Breakpoints omw Registers Modules A sts mat F Name Type Value e buffer char Oxbeeb7c34 Welcome to count int 59 69 out int 1074753476 k B Click on the variable buffer as pointed in above Figure PHYTEC Embedded Pvt Ltd 2014 29 We will probably see a different address on the buffer pointer Remember what address is shown in our case we will need this address later 1 6 5 Stepping and Watching Variable Contents In this section we will change the value of a variable At the end of this part we will see the effect of this change B Select the count variable in the Variables window B Double click on value and Change Value to 7 t Variables X Breakpoints mi Registers Modules E st E Fm 7 Name Type Value buffer char Oxbeeb7c34 Welcome to 69 count int 7 69 out int 3 B Click the Step Overbutton two times Change to Minicom root phyBOARD WEGA AM335x gdbserver 192 168 1 10 10080 myHelloWorlad Process myHelloWorld created pid 8 Listening on port 10000 Remote debugging from host 192 168 1 18 Welcome We will see the output Welcome in the Minicom window This shows when changing the counter variable s value to 7 only the first seven characters of the buffer are output instead of the whole sentence PHYTEC Embedded Pvt Ltd 2014 30 1 6 6 Using the Memory Monitor In
13. 19 The authenticity of host 1 Warning Permanently added 192 168 1 11 root phyBOARD WEGA AM335x a Note If you are using windows so you have to use Winscp or directly copy the binary into target board using pen drive or sd card B Click Apply B Click OK 1 3 5 Build the project B Select Project Build project from the menu bar The project will be built B Select the Console tab if no errors occur while building the project you will see the following output C C myHelloWorld myHelloWorld c Eclipse dal 99 Ty D TueDec1010 15AM 2 SHAMMI i File Edit Source Refactor Navigate Search Project Run Window Help v m v c v 21 w ai v 65 v c v G v ts v Q v Q v Q v c eo wy v a eo Q ES B c ce amp Project Explorer 33 a f myHelloworld c X p Br O X E 4 v myHelloworld c ja E o silia include lt stdio h gt BD e Rx int main gt gt Binari je printf Hello World stdio h v in Includes return 0 e main int gt 8 home shammi toolchain arm coi gt home shammij toolchain arm co gt 8 home shammij toolchain arm co gt 8 home shammi toolchain arm coi gt amp Debug ti Problems Tasks El Console X Ei Properties it Call Graph e b af GE bE Ee ES EI PST Sao Y myHelloworld c CDT Build Console myHelloworld 2 stdio h 10 13 07 Incremental Build of configuration Debug for project myHelloworld make
14. Host name as 192 168 1 11 and connection name as WEGA Board gt 4 Binaries gt K Includes gt Debug gt c myHelloworld c trimmedwindow label eclipseSDK 5 41PM it File Edit Source Refactor Navigate Search New Connection zu ae i EL Jm D 4 O j Remote Linux System Connection cem t m Define connection information Q i E Be C C amp Project Explorer 23 m i EXT zox es J P Parent profile linux E AS HE Bl ade rt 15 myHelloworld Host name 192 168 1 11 Y Connection name WEGA Board stdio h u unistd h Description 48 main int amp Verify host name Confiqure proxy settings 4 ca 49 write tty char int Q Back Next Cancel LXX SSN STETS 9 Ssh Terminals Pa Open Properties Dialog PHYTEC Embedded Pvt Ltd 2014 18 B Select ssh files C C Eclipse File Edit Source Refactor Navigate Search Project Run Window 9 mw v B m B v amp m w iei v amp v Di S v pe Qv Q v a vi 9 0 x v LI IN ES BR c ce New Connection Remote X O A s o OX 9 gt g Files h j 2 gs Define subsystem information BPR wwe vw vv ae Configurati P ti ve onfiguration roperties u stdio h v 2 Local Files dstore files Property Value 3 unistd h gt gt My Home ftp files b de 1 fcntl h f gt Local Shells 49 main int 49 write tty char int void i Available Services Ssh Sftp File Service v
15. OMitol ccccccccccsssssssnssssssssssssecececccceceecececeeennsssssssssseeesceeees 31 PHYTEC Embedded Pvt Ltd 2014 Introduction This Reference Manual describes the phyBOARD WEGA AM335x for application development First chapter describes the installation of eclipse and how to develop an application on phyBOARD WEGA AM335x using Eclipse IDE Second chapter describes about how to write an application using console terminal After completing this manual you Will come to know how to use the Eclipse 1 Application development using Eclipse IDE During this chapter you will learn how to build your own C C applications for the target with the help of Eclipse We will start developing our own applications with the help of Eclipse First we will take a look on the C programming language At the end of this chapter we will explain how to execute your written programs automatically when booting the target 1 1 Eclipse IDE Installation Download the Eclipse IDE from the below links Note According to your system configuration and install For Linux B Install java using below command sudo apt get install openjdk 7 jdk openjdk 7 jre B Download eclipse from below link http www eclipse ora downloads packages eclipse ide cc developers junosr2 For windows B Download and install the java for windows using below link http www oracle com technetwork java javase downloads jre7 downloads 1880261 html B Download
16. all Building file myHelloWorld c Invoking Cross GCC Compiler arm cortexa8 linux gnueabihf gcc 00 g3 Wall c fmessage length 0 MMD MP MF myHelloworld d MT myHelloworld d o myHelloworld o myHelloworld c Finished building myHelloWorld c e main int A Building target myHelloWorld Invoking Cross GCC Linker arm cortexa8 linux gnueabihf gcc o myHelloworld myHelloWorld o Finished building target myHelloworld make no print directory post build N scp myHelloworld root 192 168 1 15 home ssh root 192 168 1 15 myHelloWorld Hello World 10 13 09 Build Finished took 1s 524ms IN ae AN E PHYTEC Embedded Pvt Ltd 2014 13 Note If you are using Window machine then you need the make utils using the below link ftp ftp equation com make 32 make exe 1 4 Changing the Demo Application Now we will extend the myHelloWorld application The extended myHelloWorld application will write an output to the first serial interface as well as to the standard output B Open Eclipse if it is not opened yet B Double click myHelloWorld c in the myHelloWorld project First include the following two additional header files include lt unistd h gt include lt fcntl h gt Then add the function write tty which writes n bytes to the first serial interface which on the phyBOARD WEGA AM33bx is connected to the system console dev console void write tty char buffer int count i int
17. cntl h myHelloworld c char buf Welcome to the World of the phyBOARD WEGA AM335x serial n cna l write_tty buf sizeof buf 1 48 main int printf Hello World j write tty char int return 0 m void write tty char buffer int count a int out out open dev console 666 write out buffer count close out i Problems Tasks El Console I Properties it Call Graph 4 Remote Systems Terminals X 9 WEGA Board X root phyBOARD WEGA AM335x ls myHelloWorld root phyBOARD WEGA AM335x PHYTEC Embedded Pvt Ltd 2014 17 1 5 1 Create New Connection for Remote System login B Right Click on Local select new connection select linux C C Eclipse 99 A TueDec 10 4 13PM 2 SHAMMI 4 File Edit Source Refactor Navigate Sr 5 ee x New Connection a Y E m m v c v Rr in to Y Select Remote System Type B 3 Any distribution of Linux ES BR c Ce A Remote X m zog c g ER System type A N 4 S 2 ex type filter text Gg BR awe k v v ae v amp General hnc Y E Ta FTP Only uU stdio h gt gt My Home Local b on fcntl h gt Root tg LTTng v2 0 4 main int Y gt Local Shells Cx SSH Only 49 write tty char int void Fz Cx Telnet Only Experimental Unix Unix d 4 amp Windows a T rminal from the context menu E 2 LE Create a new resource 1 5 2 Set the Host Name and IP Then write
18. e Pars BEEB7C40 of the BEEB7C50 phyB OAR RAN A AM BEEB7C60 335x s eria BEEB7C70 A e BEEB7C8O BEEB7C90 a BEEB7CAO Arge BEEB7CBO HEET BEEB7CCO REFR7CDO You can see the contents of the variable buffer at the address Oxbeeb7c34 or whatever address is used on your system B Now click the Resume button from the menu bar Ue The debugger stops at the breakpoint in the last line of main i e returnO TY E Window f p Ban a i a ErO Av 59 v Qv Q i E Ta C C Debug Debug X b V Variables X 9e Breakpoints t O ui aa v c lt terminated gt myHelloworld Debug C C Remote Application Name Type Value gi terminated exit value O gt gdb T myHelloworld c X li oz Outline 93 m ex myHelloworld c j S e v include lt stdio h gt ABR Ae include lt unistd h gt U stdio h include lt fcntl h gt 21 unistd h int main Fentl h e main int char buf Welcome to the World of the phyBOARD WEGA AM335x serial n e write tty char int void write tty buf sizeof buf 1 printf Hello World return 0 x void write tty char buffer int count 1 int out out open dev console 666 write out buffer count close out 3 EJ Console X Ta aR l l x Ee Be LB ee p E ri lmB terminated myHelloworld Debug
19. eclipse from below link http www eclipse org downloads packages eclipse ide cc developers junosr2 PHYTEC Embedded Pvt Ltd 2014 1 2 Eclipse IDE Configuration for phyBOARD WEGA AM335x 1 2 1 Host Setup Toolchain For Compiling the Application we need the toolchain which you can easily download from the below link For Linux ftp ftp phytec de pub Products India phyBOARD WEGA AM335x Linux PD14 0 0 tools toolchain arm cortexa8 linux gnueabihf tar bz2 B Setip Address ifconfig ethO 192 168 1 12 up m Set the gateway route add default gw 192 168 1 1 For Windows 2012 09 64 arm m none linux gnueabi exe B Click Start Control Panel open Network and Sharing Center From the Tasks menu on the left choose Manage Network Connections Find and Right click on the active Local Area Connection and choose Properties Double click on Internet Protocol Version 4 TCP IPv4 Click on Use the following IP address Enter a IP like 192 168 1 12 Press Tab and the Subnet Mask section will populate with default numbers Enter gateway 192 168 1 1 Hit Ok PHYTEC Embedded Pvt Ltd 2014 1 2 2 Target Setup Connect the power adaptor serial cable ethernet cable to the phyBOARD WEGA AM335x Board amp Boot the Board To see all the Communication interfaces present on the phyBOARD WEGA AM335x Board ifconfig a B Configure ethO ifconfig ethO 192 168 1 11 up where ethO is the LAN interface Check whet
20. ecutable Linux GCC Empty Project amp Hello World ANSI C Project gt Shared Library Static Library Makefile project amp show project types and toolchains only if they are supported on the platform Back Nextt Cancel Finish B Click Next C Project Select Configurations e Select platforms and configurations you wish to deploy on f Executable Cross GCC Project type Toolchains Configurations amp 5 Debug select all amp E 5 Release GN RUN I AG NR Deselect all Advanced settings Use Advanced settings button to edit project s properties Additional configurations can be added after project creation Use Manage configurations buttons either on toolbar or on property pages lt Back Ense Cancel Finish PHYTEC Embedded Pvt Ltd 2014 B Set Toolchain Prefix amp Path and Click Finish Select the Cross Compiler Prefix as arm cortexa8 linux gnueabihf and Cross Compiler Path as path of toolchain bin C Project Cross GCC Command gt Configure the Cross GCC path and prefix Cross compiler prefix arm cortexa8 linux gnueabihf Cross compiler path gcc 4 7 3 glibc 2 16 0 binutils 2 22 kernel 3 6 sanitized bin Browse Note For windows you have to select the arm none linux gnueabi and the appropriate path of the toolchain 1 3 3 Open new C source file B Right click on myHelloWorld project B Select F
21. her ethO is configured or not by using the below command ifconfig a Note 192 168 1 11 is not mandatory you can use any IP but it should be different from the server IP m Set the gateway route add default gw 192 168 1 1 To see the change in the gateway route 1 3 Creating a New Project in Eclipse In this section you will learn how to create a new project with Eclipse and how to configure the project for use with the GNU C C cross development toolchain Click the Eclipse icon to start the application You can find this icon where you have extracted the Eclipse IDE for C C Developers 1 3 1 How to open eclipse For Linux B Go to the Location where you have downloaded eclipse Extract it and run binary file eclipse B Confirm the workspace directory with OK PHYTEC Embedded Pvt Ltd 2014 For windows B Click the Eclipse icon to start the application You can find this icon on your desktop B Confirm the workspace directory with OK Select a workspace Eclipse SDK stores your projects in a folder called a workspace Choose a workspace folder to use for this session Workspace home ubuntu workspace Use this as the default and do not ask again x m Close the Welcome to Eclipse screen by clicking on the workbench button C C Eclipse File Edit Source Refactor Navigate Search Run roject e pa Welcome 23 ty E iu De Welcome to the Eclipse IDE for C C Develo
22. ile New Source file from the menu bar PHYTEC Embedded Pvt Ltd 2014 10 B n Source file write myHelloWorld c and click on Finish C C Eclipse a ES fy 4 TueDec1010 00AM 2 SHAMMI i File Edit Source Refactor Navigate Search Project Run Window Help RE Sr Ar Bix ay Gv Gy G i355 Ove r Qi o y Q E Fai C C j i B D Lao OM X New Source File y 44 v v eds Source File i C An outline is not available T Create a new source file e v iR Includes gt 9 home shammij toolchain arm co gt 9 home shammij toolchain arm co gt 9 home shammi toolchain arm cot Source file myHelloworld d gt 8 home shammij toolchain arm co Source folder myHelloworld Browse Template Default C source template Configure N ES TT JE SES CDT Build Console myHettowsortd BER wrt Brmvw Oo 1 BEL tS myHelloworld 1 3 4 Write simple Hello Application Write a simple Hello Application in C C C myHelloWorld myHelloworld c Eclipse 9996 Ty D MonDec1610 25AM 2 SHAMMI File Edit Source Refactor Navigate Search Run Project Window Help O Teen Se CCR ZI IE EZ II EEC CONE EID S e es Q Ej R c ce Project Explorer X e H myHelloworld c 23 m BORN 9 P amp v myHelloworld c ja 5 e ew include lt stdio h gt Bm ae int main v dw gt i Binaries l printf Hello World u stdio h gt inf
23. inux Browse Launch Group GDB command file gdbinit Browse Debugger Options Warning Some commands in this file may interfere with the startup operation of the debugger for example run N Non stop mode Note Requires non stop GDB Enable Reverse Debugging at startup Note Requires Reverse GDB _ Force thread list update on suspend Automatically debug Forked processes Note Requires Multi Process GDB Tr2cnnnink moda klarmnl Using GDB DSF Manual Remote Debugging Launcher Filter matched 8 of 8items Select other A p p y Re ver t B Select the Connection tab and select TCP in the drop down box Enter 192 168 1 11 the target s IP address in the Host name input field And port numer as 10000 PHYTEC Embedded Pvt Ltd 2014 25 C C Eclipse File Edit Source R Debug Configurations 9 LN Create manage and run configurations E Ec C C 5 Project Explorer X H Xx EH Name myHelloworld Debug M Te Main 35 Debugger Source Ci Common lz we vc ne C C Application amp Stop onstartup at main i 2 C C Attach to Applicatior TREAT RES stdio h ip includes c C C Postmortem Debugg nae unistd h gt 8 home naveel E C C Remote Application Main Shared Libraries Connection Fentl h gt 9 home naveei in i c myHelloworld Debu main int gt 8 home naveel i 9 Type MER Launch Gr
24. lloworld c 13 0x849c i 3 gdb myHelloworld c X e c Outline 23 m e myHelloWworld c ja S include lt stdio h gt Bw Rw e include lt unistd h gt u stdio h include lt fcntl h gt 3 unistd h 7 int main fcntLh 4 e main int char buf Welcome to the World of the phyBOARD WEGA AM335x serial n e write tty char int void write tty buf sizeof buf 1 printf Hello World return 0 EJ Console X 4j Tasks ii Problems Executables Memory o Em BH LB ele nL myHelloworld Debug C C Remote Application gdb The target endianness is set automatically currently little endian We have configured our project for Remote Debugging GNU debugger in Eclipse and connected the host s GDB with the target s GDB server Now we can debug the project 1 6 3 Setting a Breakpoint Now we will set a breakpoint in our program This breakpoint will be set on the last line of the function main If you resume the application the debugger will stop on this line p home ubuntu workspace mwyHelloWorld De nt B phy of 3 Console 2 A Tasks Ei Problems Execute PHYTEC Embedded Pvt Ltd 2014 27 Select the last line in main Right click into the small grey border on the left hand side and select Toggle Breakpoint to set a new breakpoint 1 6 4 Stepping and Watching Variable Contents In this part we will step through the example project with the debugger
25. loworld c X SE s O 8 G m A a em amp myHelloWorld c a j a m include lt stdio h gt E uw v include lt unistd h gt v Et u Y Ef Local Secure Storage 3 stdio h vn Local Files Please enter a new master password for the secure storage unistd h gt i MyHome m u fcntl h gt Root 48 main int f Local Shells write_tty char int void Password d v A Rana Board v Sftp Files v gt 4 Pending gt Root gt Es Shell Processes L EX Ssh Shells 49 Ssh Terminals Ca xel To open a terminal right click the Terminal subsystem under the target Then select Launch Terminal from the context menu Confirm password Show password a EMEI SIR II IUE x File filter My Home Fetching children of My Home 0 m PHYTEC Embedded Pvt Ltd 2014 21 1 5 3 Launch the Remote Terminal B Right click ssh Terminal Launch Terminal Now we can see all the contents of phyBOARD WEGA AM335x C C myHelloWorld myHelloWorld c Eclipse File Edit Source Refactor Navigate Search Project Run Window Help v amp v amp v au D rr Or BO EIN N BET or Q B R amp c ce s Project Explorer X A d myHelloworld c X a MEOS 6 2 m 4 v myHelloWorld d a j is es include lt stdio h gt BAX Y S myHelloworld finclude unistd h v gt UP Binari include fcntl h V Binaries eem int main Y unistd h gt amp Debug Y fcntl h D my
26. ndow label eclipseSDK File Edit Source Refactor Navigate B Type User ID as root leave password blank Then press OK Search Project Run Window Help TS SR OG Se Cv Gr BrOvrRerQriti SG Ve TE Q EY c Project Explorer X E d myHelloworld c X g foxe 48 amp v myHelloWorld c H a 3 o i EN include lt stdio h gt D Ax wrt 3 myHelloworld include lt unistd h gt 5 gt P Binaries include lt fcn Enter Password 7 ii stdio h ncludes 94 i l R ii b E main System type Linux unistd h ebug E gt 3 myHelloworld c char buf Hostname 192 168 1 11 RD WEGA AM335x serial n fcntl h i write tty Connectionname WEGA Board 48 main int printf Hi User ID root 49 write_tty char int return 0 B ovoid write ti Password optional P amp Save user ID int out out open write out but amp Save password close out Cancel ER em ate A Remote Systems X gg vn gt is Shell Processes 7 Ssh Shells 9 Ssh Terminals Y A WEGA Board vMSftp Files v My Home Pending gt i Root 2 File filter My Home i Fetching children of My Home 0 D C C Eclipse p File Edit Source Refactor Navigate Search Project Run Window Help v E lei m v c v Ind w e v 83 v Di v amp v i pel v Q v Q v Qa v e wy v fo dm v a Q E ac c A Remote X m Je myHel
27. nished building target myHelloWorld pm E ri 7H x JE 15 KR make no print directory post build scp myHelloworld root 192 168 1 11 home ssh root 192 168 1 11 myHelloworld Hello World Writable Smart Insert 13 59 PHYTEC Embedded Pvt Ltd 2014 15 1 4 1 Open Target Board using Minicom B Open the terminal using minicom m Enter user name as root and press Enter then type Is to see all the file Is Type myHelloWorld to start the application myHelloWorld Hello World Welcome to the World of the phyBOARD WEGA AM335x serial B close minicom In this section we had changed an existing application We also learned how to access the serial interface First we called the function open on the device dev console The return value of this function was a file descriptor with the file descriptor you called the function write to send n bytes to the device dev console After that the file descriptor was closed with the function close 1 5 Remote System Access using Eclipse For Windows You have to set the address manually connect ethernet cable Go to network connections right click on Local area connection properties under general tab double click on Internet Protocol TCP IP change the parameters For above settings refer section 1 2 1 For Linux You have to set the address manually for this refer section 1 2 1 B Left click the Window tab Show view other
28. ou gt 9 home naveei ees NN Port number 10000 gt fm myHelloworlt makefile myHellowork write_tty char int ES Host name or IP address 192 168 1 11 D HN fe Gil L objects mk sources mk L subdir mk J m v myHelloworld i 2 fcntl h 3 stdio h Filter matched 6 of 6 items u unistd h 48 main int Close Debug a write tty chaL Using GDB DSF Manual Remote Debugging Launcher Select other Apply Revert EM myHelloworld B Click Apply B Click Debug A new dialog appears B Select Yes to switch to the Debug perspective Confirm Perspective Switch This kind of launch is configured to open the Debug perspective when it ey suspends This Debug perspective is designed to support application debugging It incorporates views For displaying the debug stack variables and breakpoint management Do you want to open this perspective now Remember my decision oo ky PHYTEC Embedded Pvt Ltd 2014 26 The host s GDB is now connected to the GDB server on the target File Edit Source Refactor Navigate Search Project Run Window ae m oi a Mx d mow EO Av BEI v Q E c c Debug Debug X ij Y GB Variables X in BA E v c myHelloworld Debug C C Remote Application ot B F3 r4 nip coment Name Type Value v i 1 1 i 1 858 Suspended Breakpoint gt 9 buf char 60 oxbee07c24 main at myHe
29. pers M m e 4 I eo lt p l Overview Tutorials Samples What s New a Mia X em Workbench EE Get an overview of the features E PHYTEC Embedded Pvt Ltd 2014 Now you can see the Eclipse Workbench as below C C Eclipse ty ThuFeb21 1 03 21PM amp ashu i File Edit Source Refactor Window elp wo div Sv Ev Er Q 9 Qv N Se LS v Q Ef BR c ce t5 Project Explorer X ES c C fm H BE Outli X Bp v An outline is not available i Problems X 2 O items Description Resource Path Location Type 1 3 2 Creating a New Project In this section we will learn how to create a new project with Eclipse and how to configure the project for use with the GNU C C cross development toolchain B Select File amp New Project from the menu bar A new dialog will open B Select C Project and click Next New Project Select a wizard gt Create a new C project Wizards gt amp General ec cHh E C Project 3 Makefile Project with Existing Code gt amp CVS gt amp RPM gt amp Tracing e PHYTEC Embedded Pvt Ltd 2014 B Enter the project name myHelloWorld and Toolchain as Cross GCC then click Next C Project C Project lt gt Create C project of selected type Project name myHelloworld amp Use default location Location Browse Choose file system default Project type Toolchains GNU Autotools Cross GCC Ex
30. telloworld c char buf Welcome to the World of the phyBOARD WEGA AM335x serial n Fentl EL i write_tty buf sizeof buf 1 main int printf Hello World write_tty char int return 0 el amp void write tty char buffer int count F 4 int out out open dev console 666 write out buffer count close out i Problems Tasks El Console E Properties i CallGraph a Remote Systems Terminals X m KW WEGA Board X root phyBOARD WEGA AM335x ls myHelloWorld root amp phyBOARD WEGA AM335x PHYTEC Embedded Pvt Ltd 2014 22 1 6 Debugging an example project m In this section we will learn how to use the GNU debugger i e GDB on the host for remote debugging in conjunction with the GDB server on the target m First you will start the GDB server on the target Then you will configure the Eclipse platform and start the GNU debugger out of Eclipse using the Debug view m Ihe 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 registers m Ihe GDB client is running on the host and is used to control the GDB server on the target which in turn controls the application running on the target m GDB client and GDB server can communicate over a TCP IP network connection as well as via a serial interface In this Quickstart we
31. the last section of this chapter you will use the memory monitor to control the content at a memory address B Select the Memory tab B Click Add Memory Monitor Monitor Memory Enter address or expression to monitor Oxbeeb7c34 B Enter the address of buffer and click OK Remember that the variable s address might differ with your system You will see following output DEED CfDrO OO OU Om mi oo oom mum A De E 4 2 New Renderings Address 0 3 4 7 8 B C F BEEB7C30 50B60340 57656C63 6F6D6520 746F2074 R BEEB7C40 68652057 6F726C64 206F6620 74686520 BEEB7C50 70687942 4F415244 2D52414E 41204140 DD BEEB7C60 33333578 21202873 65726961 6C290A00 BEEB7C70 00000000 OCFE1040 00002240 C47DEBBE BEEB7C80 01000000 90840000 00000000 00000000 BEEB7C90 5C830000 00000000 00000000 00000000 BEEB7CAO 00700F40 00000000 787CEBBE C8FD1040 B Click New Rendering B Select ASCII and click Add Rendering s kende ri nis hs Oxbeeb7c34 Hex sb New Memory Monitor Oxbeeb7c34 OXBEEB7C34 Select rendering s to create Traditional Add Rendering s Hex Signed Integer Unsigned Integer PHYTEC Embedded Pvt Ltd 2014 31 You will see follwing output on your screen Oxbeeb7c34 lt Hex gt dr New Renderings Address O0 scce cio race AED on
32. vie phyBOARD WEGA AM335x Single Board Computer Application Development User Manual Product No PCL 051 PBA CD 02 SOM PCB No 1397 0 CB PCB No 1405 0 Edition Feb 26 2014 In this manual copyrighted products are not explicitly indicated The absence of the trademark and copyright symbols does not imply that a product is not protected Additionally registered patents and trademarks are similarly not expressly indicated in this manual The information in this document has been carefully checked and is believed to be entirely reliable However PHYTEC Embedded Pvt Ltd assumes no responsibility for any inaccuracies PHYTEC Embedded Pvt Ltd neither gives any guarantee nor accepts any liability whatsoever for consequential damages resulting from the use of this manual or its associated product PHYTEC Embedded Pvt Ltd reserves the right to alter the information contained herein without prior notification and accepts no responsibility for any damages that might result Additionally PHYTEC Embedded Pvt Ltd offers no guarantee nor accepts any liability for damages arising from the improper usage or improper installation of the hardware or software PHYTEC Embedded Pvt Ltd further reserves the right to alter the layout and or design of the hardware without prior notification and accepts no liability for doing so Copyright 2014 PHYTEC Embedded Pvt Ltd Koramangala Bangalore Rights including those of translation
33. will only describe debugging via TCP IP 1 6 1 Starting the GDB server on the target In this passage you will learn how to start the GDB server on the target The GDB server will be used to start and control the myHelloWorld program To debug a program with GDB the program needs extended debugging symbols This has already been added while building the program B Open Minicom sudo minicom D dev ttyUSBx Type User name root and press Enter Start the GDB server gdbserver 192 168 1 4 10000 myHelloWorld Note 192 168 1 4 is Host system IP PHYTEC Embedded Pvt Ltd 2014 23 You have started the GDB server on the target The GDB server is now waiting for connections on TCP port 10000 1 6 2 Configuring and starting the debugger in Eclipse In this passage we will learn how to configure our project settings to use Eclipse with the GNU debugger After the configuration of our project settings the GNU debugger will start and connect to the GDB server on the target B Start Eclipse if the application is not started yet B Right click on the myHelloWorld project in the Navigator window B Select Debug As Debug Configurations A dialog to create manage and run applications appears B Double click on C C Remote Application select myHelloWorld Debug Debug Configurations Create manage and run configurations S Geax usi Name myHelloworld Debug E Main Debugger amp Source E3 Common

Download Pdf Manuals

image

Related Search

Related Contents

ガス温水器 - 省エネルギーセンター  Netgear GA622T Reference Manual  Tecumseh TPA9421YXA Performance Data Sheet  説明書  202@^ Double Auto Reverse Cassette Deck  Konami Silent Hill: Downpour HD Collection  SCM 1090 E  PDFファイル  Operating Instructions - 4 Office Technical Support  資料5-1  

Copyright © All rights reserved.
Failed to retrieve file