background image

 

 

 

A product of a PHYTEC Technology Holding company 

phyFLEX

®

-i.MX 6 

Quickstart Instructions 

 Document 

No.: 

L-781e_7 

 Release 

No.: 

SO-525v9

 

 Edition: 

September 

2015 

Содержание phyFLEX-i.MX 6

Страница 1: ...A product of a PHYTEC Technology Holding company phyFLEX i MX 6 Quickstart Instructions Document No L 781e_7 Release No SO 525v9 Edition September 2015...

Страница 2: ...ight 2015 PHYTEC Messtechnik GmbH D 55129 Mainz Rights including those of translation reprint broadcast photomechanical or similar reproduction and storage or processing in computer systems in whole o...

Страница 3: ...ing the Debugger in Eclipse 3 2 3 33 Setting a Breakpoint 3 2 4 34 Stepping through and Watching Variable Contents 3 2 5 36 Stepping through and Changing Variable Contents 3 2 6 37 Using the Memory Mo...

Страница 4: ...phyFLEX i MX 6 ii PHYTEC Messtechnik GmbH 2015 L 781e_7 6 1 7 75 Setting up a TFTP server 6 1 8 76 Optional Settings...

Страница 5: ...r write 0 must be added to get the complete address byte E g given address in this manual 0x41 complete address byte 0x83 to read from the device and 0x82 to write to the device Tables which describe...

Страница 6: ...s You can find useful supplementary information about the topic At the beginning of each chapter you can find information about the time required to read the following chapter You have successfully co...

Страница 7: ...it RDK includes the following electronic documentation in the virtual machine hard disk under opt PHYTEC_Tools Documentation The PHYTEC phyFLEX i MX6 Hardware Manual Hardware schematics The Yocto Refe...

Страница 8: ...ystem into the target s flash The Setup your own Linux Host PC section explains how to setup your own Linux Host PC if you don t want to use our virtual machine hard disk image 1 4 System Requirements...

Страница 9: ...the Common Public License implemented purely in Java as a set of plug ins for the Eclipse SDK platform These plug ins add a C C perspective to the Eclipse Workbench that can now support C C developme...

Страница 10: ...15 GB and includes a virtual machine disk file vmdk which is suitable for most virtualization software and which can be mounted to an appropriate Linux machine tested with VMware Player and VirtualBox...

Страница 11: ...u Now you are ready to connect your PC with the phyFLEX i MX6 2 2 Starting the Hardware am Microcom as well as via a SSH session using a peer to peer etwork connection In this section you will learn h...

Страница 12: ...etwork card of your host which is passed on the virtual machine Click the Microcom_ttyS0 icon on your desktop if you have connected the target to your serial interface on your host If you have connect...

Страница 13: ...login name and press Enter As a good example and helpful for understanding the next step enter ifconfig You will get information about the configuration of the Ethernet interface on the phyFLEX i MX6...

Страница 14: ...n Click in the Command field and search for p dev ttyS0 Change it for example to dev ttyS1 and so on if you have more than one serial port If you are connecting the board via RS232 to USB change it to...

Страница 15: ...to connect the cable to the network card which you have configured with the IP address 192 168 3 10 If you do not see the login you may not have set up the right IP address for your host Open the Sys...

Страница 16: ...project into your workspace The imported example project will be compiled with the cross compiler After that you will copy and execute the newly created program on the target 3 1 1 Work with the Demo...

Страница 17: ...tions Now you can see the Eclipse workbench First we will import an existing project Select File Import from the menu bar Select Existing Projects into Workspace and click Next PHYTEC Messtechnik GmbH...

Страница 18: ...phyFLEX i MX 6 Select Browse Double click the HelloWorld directory under opt prj_workspace Eclipse Click OK 12 PHYTEC Messtechnik GmbH 2015 L 781e_7...

Страница 19: ...u bar The HelloWorld program will be compiled and the HelloWorld executable is built for the target Then the HelloWorld file is copied to the target using secure copy After the file has been copied to...

Страница 20: ...ed to your host and that the network has been configured as explained in this Quickstart You have successfully passed the first steps with the Eclipse IDE You are now able to import existing projects...

Страница 21: ...eate 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 is not already opened Select File New Project from the menu bar...

Страница 22: ...phyFLEX i MX 6 Enter the project name myHelloWorld and click Next Click Finish 16 PHYTEC Messtechnik GmbH 2015 L 781e_7...

Страница 23: ...ld project If Build Automatically from the Project menu is selected the HelloWorld application will now be compiled and created with the standard GCC C C compiler suitable for your host machine You wi...

Страница 24: ...EX i MX 6 Enter CC into the Command input field Select GCC C Linker Enter CC into the Command input field and add LDFLAGS in the Command line pattern after COMMAND 18 PHYTEC Messtechnik GmbH 2015 L 78...

Страница 25: ...Quickstart Instructions Select GCC Assembler Change the Command input field to AS Click Apply Select the Build Steps tab PHYTEC Messtechnik GmbH 2015 L 781e_7 19...

Страница 26: ...11 home root ssh root 192 168 3 11 home root myHelloWorld Be sure to enter the semicolon before the ssh command Ensure that the file myHelloWorld on the target will have execution rights because other...

Страница 27: ...le 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 configured the project to crea...

Страница 28: ...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 phyFLEX i MX6 is connected to th...

Страница 29: ...t Instructions Save your program after changing the code The application will be compiled built copied to the target and executed Click the Microcom icon on the desktop PHYTEC Messtechnik GmbH 2015 L...

Страница 30: ...nected over a TCP IP connection to the target With Microcom however you have direct access to the serial interface so you can also see the line that is written to the serial console In this section yo...

Страница 31: ...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...

Страница 32: ...6 In the Name input field enter myHelloWorld Target Enter usr bin ssh in the Location input field Enter root 192 168 3 11 myHelloWorld into the Arguments field 26 PHYTEC Messtechnik GmbH 2015 L 781e_7...

Страница 33: ...in conjunction with the GDB server on the target GDB is the symbolic debugger of the GNU project and is arguably the most important debugging tool for any Linux system F platform and start the GNU de...

Страница 34: ...ou have started the GDB server on the target The GDB server is now waiting for connections on TCP port 10000 3 2 2 Configuring and Starting the Debugger in Eclipse In this passage you will learn how t...

Страница 35: ...Quickstart Instructions Select myHelloWorld under C C Application to expand it double click on it Select the Debugger tab PHYTEC Messtechnik GmbH 2015 L 781e_7 29...

Страница 36: ...phyFLEX i MX 6 Select gdbserver Debugger from the Debugger drop down box Enter GDB in the GDB Debugger field Keep the GDB command file field empty 30 PHYTEC Messtechnik GmbH 2015 L 781e_7...

Страница 37: ...r 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 Debug A new dialog appe...

Страница 38: ...he 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 connected the host s GDB with the...

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

Страница 40: ...xample project with the debugger You will also learn how to check 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 line Y...

Страница 41: ...ructions Click on the variable buf Then click the button Step into to enter the function write_tty The debugger stops in write_tty You will see the following variable window PHYTEC Messtechnik GmbH 20...

Страница 42: ...le 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 select Change Value Change the value of count to 7 and clic...

Страница 43: ...l the content at a memory address Select the Memory tab in the frame where you can find the Console Click Add Memory Monitor Enter the address of the buffer and click OK Remember that the variable s a...

Страница 44: ...EC Messtechnik GmbH 2015 L 781e_7 e variable buffer at address 0xbef9ec47 or at the specific ddress used on your system Now click the Resume button from the menu bar The debugger stops at the breakpoi...

Страница 45: ...lly passed the debugging chapter You are now able to configure and use Eclipse for remote debugging You can step through a project watch and change the content of variables and you can use the memory...

Страница 46: ...ailable about this powerful cross platform GUI toolkit Some demos that show the capabilities of Qt version 5 3 2 are included in the BSP Before we start compiling and running our example project out o...

Страница 47: ...terminal to start Qt Creator usr bin qtcreator sh The user interface of Qt Creator appears Now we import the example project by clicking Open Project This opens a dialog in which the path to opt prj_...

Страница 48: ...o and click Open The HelloWidget project is now imported into your Qt Creator workspace 4 3 Work with the Demo Application 42 PHYTEC Messtechnik GmbH 2015 L 781e_7 Our example project is a simple Qt W...

Страница 49: ...de and double click mainwindow ui Qt Creator opens the design mode and you can see the design of our project which has a menu bar with an exit action under the menu item miniQT one label and three but...

Страница 50: ...phyFLEX i MX 6 Right click the Hide Logo button and select Go to slot from the context menu 44 PHYTEC Messtechnik GmbH 2015 L 781e_7...

Страница 51: ...o the mainwindow cpp where you can find the definition of the function on_btn_hideLogo_clicked You see that clicking this button changes the status of the btn_Logo button from visible to hidden Next w...

Страница 52: ...not already selected Now you can select different tabs to see the settings for the workspace compiler debugger Qt version and a lot other options Be sure that the target is connected via Ethernet and...

Страница 53: ...t from the phyFLEX i MX6 PHYTEC Messtechnik GmbH 2015 L 781e_7 47 ication Click the big button with he PHYTEC logo to enable and disable the Welcome label ifferent build steps click Compile output whi...

Страница 54: ...ation on the target For example if the phyFLEX i MX6 is not connected to the host or if you only changed some user interface relevant things and you do not want to copy the application and all the nec...

Страница 55: ...n 4 6 1 Using QDebug for simple Debugging Messages In our first debugging step we use the QDebug class This class provides an output stream for debugging information It is used whenever the developer...

Страница 56: ...application opens Press the Show Logo button The logo was visible before we pressed the button so we see the appropriate message from qDebug in the Application Output Press the Hide Logo button and t...

Страница 57: ...ront of line number 31 In the context menu click on Set Breakpoint at Line 31 to add a breakpoint You now see a red filled circle with a small sand glass in front of this line The next step is to chan...

Страница 58: ...by clicking on the green filled triangle with the small magnifier The debugger starts and Qt Creator changes his view to the Debug mode The demo application is shown on the connected display In the ru...

Страница 59: ...at the created breakpoint because the function is called You can now watch the stack or the Locals and Expressions Step into the setVisible function by pressing the Step Into button Now the definitio...

Страница 60: ...rame by clicking the X on the right side Continue the stopped application by clicking on Continue Now the demo application is continued and waiting for user interactions Stop the Debugger by pressing...

Страница 61: ...LEX i MX6 All necessary tools and programs are already pre installed to directly start with Yocto Open a new terminal if you have not already done and change to the directory of the pre installed BSP...

Страница 62: ...to building the image unless they are stored locally In the virtual machine the package for the nano editor is already pre downloaded and available locally Before we add the package we check if the ri...

Страница 63: ...correct MACHINE for the PFL A 02 13237E0 module In the same file we can add nano by adding the following line at the end of the file as shown in the previous picture IMAGE_INSTALL_append nano Save the...

Страница 64: ...image Because of dead links it is possible that an attempt to download a source package fails PHYTEC cannot guarantee the accessibility of all the web pages that are needed to build a BSP In case of...

Страница 65: ...on is erased you will not be able to start your target anymore In such a case refer to our BSP Manual The versions of the Barebox and the Linux kernel must match Therefore the following steps should o...

Страница 66: ...h0 edit the settings save them by leaving the editor with Strg D then type saveenv and reboot the board Now we flash the root filesystem T ype ubiformat dev nand0 root ubiattach dev nand0 root ubimkvo...

Страница 67: ...following directory of the virtual machine opt PHYTEC_BSPs phyFLEX iMX6 build deploy images phyflex imx6 2 phytec qt5demo image phyflex imx6 2 20150915092725 rootfs ubifs All files are also downloadab...

Страница 68: ...tep instruction of the essential changes in order to modify your own distribution We can not guarantee that the presented changes are compatible to other distributions or versions If you want to use a...

Страница 69: ...ructions The Preparing to install Ubuntu window appears From Ubuntu it is advised that you select Download updates while installing and Install this third party software now PHYTEC Messtechnik GmbH 20...

Страница 70: ...ction now and connect the phyFLEX i MX6 6 1 2 Installation of Software Packages First of all various software packages that are required must be installed using the package manager APT To gain a bette...

Страница 71: ...ds sudo mkdir p opt PHYTEC_BSPs phyFLEX i MX6 sudo chmod R 777 opt PHYTEC_BSPs cd opt PHYTEC_BSPs phyFLEX i MX6 Download the phyLinux script and set execution privileges wget ftp ftp phytec de pub Sof...

Страница 72: ...w ready to build your first images Build the BSP bitbake phytec qt5demo image Generate the SDK needed for Eclipse and Qt Creator bitbake phytec qt5demo image c populate_sdk Install the SDK into the re...

Страница 73: ...te the workspace in the opt directory as it is in the virtual machine mkdir p opt prj_workspace Eclipse sudo chmod R 777 opt prj_workspace Before we start Eclipse we must set the correct environment t...

Страница 74: ...he drop down menu Work with select Indigo http download eclipse org releases indigo The available plug ins appear in the selection area below now Expand Programming Languages and check C C Development...

Страница 75: ...ll and setup the Qt Creator 6 1 6 Install and Setup Qt Creator Because we want the same qmake version as in our BSP we install Qt Creator manually Download Qt Creator with following command wget http...

Страница 76: ...installation is finished make a symbolic link to easily start Qt Creator sudo ln s opt x64_Qt5 3 2 Tools QtCreator bin qtcreator sh usr bin qtcreator sh Set the correct environment to our SDK sudo vi...

Страница 77: ...creator sh Add the phyFLEX i MX6 as device with following inputs by opening Tools Options Devices Add Generic Linux Device Name phyFLEX i MX6 IP 192 168 3 11 Username root Keep the password empty Set...

Страница 78: ...efault build directory field build CurrentProject Name Select tab Qt Versions and click Add to add a new one Name iMX6_Qt5 3 2 qmake Location opt yogurt iMX6 PD15 1 1 sysroots x86_64 yogurtsdk linux u...

Страница 79: ..._64 yogurtsdk linux usr bin arm phytec linux gnueabi arm phytec linux gnueabi gcc Select tab Compilers and click on Add select GCC e arm gcc Co Nam Path opt yogurt iMX6 PD15 1 1 sysroots x86_64 yogurt...

Страница 80: ...t iMX6 PD15 1 1 sysroots cortexa9hf vfp neon phytec linux gnueabi Compiler arm gcc Debugger arm gdb Qt version iMX6_Qt5 3 2 Select Debugger on the left side of the window and click on the GDB tab Ente...

Страница 81: ...are packages you have installed the required packagesto set up a TFTP server Nowwe have to change someshort settings First change the file etc default tftp hpa as follows TFTP_USERNAME tftp TFTP_DIREC...

Страница 82: ...is Application Guide Theyonly simplify the handling and the look of the system For this reason we show the modifications without bigexplanation vim the improved vi editor is installed Desktop icons fo...

Страница 83: ...ox handling Fixed some issues 29 01 2014 L 781e_5 Update Quickstart for working with PD13 2 2 Fixed some issues 11 03 2014 L 781e_6 Change description for updating the bootloader 17 09 2015 L 781e_7 M...

Страница 84: ...X i MX6 Document number L 7816e_7 September 2015 How would you improve this manual Did you find any mistakes in this manual page Submitted by Customer number Name Company Address Return to PHYTEC Mess...

Страница 85: ...79...

Отзывы: