Page 1
® phyFLEX -i.MX 6 Quickstart Instructions Document No.: L-781e_7 Release No.: SO-525v9 Edition: September 2015 A product of a PHYTEC Technology Holding company...
Page 2
GmbH neither gives any guarantee nor accepts any liability whatsoever for consequential damages resulting from the use of this manual or its associated product. PHYTEC Messtechnik GmbH reserves the right to alter the information contained herein without prior notification and accepts no responsibility for any damages that might result.
Installation of Software Packages ............64 6.1.3 Set the Git Configuration ..............65 6.1.4 Build the Board Support Package and Install the SDK .......65 6.1.5 Set up Eclipse and Integrate Plug-ins ............67 6.1.6 Install and Setup Qt Creator ..............69 PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 4
® phyFLEX -i.MX 6 6.1.7 Setting up a TFTP server ..............75 6.1.8 Optional Settings ................76 PHYTEC Messtechnik GmbH 2015 L-781e_7...
Text in italic indicates proper names of development tools and corresponding controls (windows, tabs, commands etc.) used within the development tool, no interaction takes place. White Text on black background shows the result of any user interaction (command, program execution, etc.) PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 6
At the beginning of each chapter you can find information about the time required to read the following chapter. You have successfully completed an important part of this Application Guide. You can find information to solve problems. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Introduction 1 Introduction In this QuickStart Instructions Manual you will find general information about the PHYTEC phyFLEX-i.MX6-Kit and instructions how to start-up with the phyFLEX-i.MX6. You will learn how to... … use the prepared virtual machine hard disk image.
The following items will be needed to complete this Quickstart successfully: The PHYTEC phyFLEX-i.MX6 The PHYTEC Development Board with the included DB-9 serial cable, Ethernet crossover cable and AC adapter supplying 12 VDC (min. 2 A) SO-525v9 The PHYTEC virtual machine hard disk image ( ...
The Yocto Project is an open source collaboration to create custom Linux-based systems for embedded products regardless of the hardware architecture. We use the Yocto Project to create the Board Support Package (BSP) for our hardware. PHYTEC Messtechnik GmbH 2015 L-781e_7...
In order to avoid any conflicts we recommend to have only the Ethernet adapter in the virtual machine which will be used for the peer to-peer connection between your PC and the phyFLEX-i.MX6. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Linux from the flash memory on the target and you will be able to log in with the serial communication progr am Microcom as well as via a SSH session using a peer-to-peer etwork connection. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Connect the AC adapter to the power supply connector X12 (12V) on your board. After connecting the board to the power supply, the target starts booting. When the target has finished loading the system, you should see a screen similar to the following: PHYTEC Messtechnik GmbH 2015 L-781e_7...
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 PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 14
You are ready to test the Ethernet network connection. Click on the SSH for Target icon on your desktop. A console window will open and you will see an authentication question. Type and press Enter. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 15
, click on the icon and check the settings for the physical interface to which you have connected the Ethernet cable. You have successfully set up all configurations to access your phyFLEX- i.MX6 from your host. PHYTEC Messtechnik GmbH 2015 L-781e_7...
3.1.1 Work with the Demo Project Click the Eclipse icon to start the application. You can find this icon on your desktop. Change the workspace directory to if necessary and /opt/prj_workspace/Eclipse confirm with OK. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 17
Quickstart Instructions 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 2015 L-781e_7...
Page 18
® phyFLEX -i.MX 6 Select Browse. Double-click the HelloWorld directory under /opt/prj_workspace/Eclipse/. Click OK. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 19
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 the target, the program is executed on the target using SSH. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 20
You have successfully passed the first steps with the Eclipse IDE. You are now able to import existing projects into the Eclipse workspace. You can compile an existing project and execute the program on the target. PHYTEC Messtechnik GmbH 2015 L-781e_7...
GNU C/C++ cross development toolchain. Open Eclipse if it is not already opened. Select File ► New ► Project from the menu bar. A new dialog opens. Select C Project and click Next. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 22
® phyFLEX -i.MX 6 Enter the project name and click Next. myHelloWorld Click Finish. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 23
To compile your project for phyFLEX-i.MX6 instead, you will have to use the GNU C/C++ cross compiler. Right-click the myHelloWorld project and choose Properties. The Properties dialog appears. Select C/C++ Build ► Settings. Select GCC C Compiler. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 24
-i.MX 6 Enter into the Command input field. ${CC} Select GCC C Linker. Enter into the Command input field and add in the Command line ${CC} ${LDFLAGS} pattern after ${COMMAND}. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 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...
Page 26
Be sure to enter the semicolon before the ssh command. Ensure that the file myHelloWorld on the target will have execution rights, because otherwise ssh will fail. Click Apply. Click OK. Select Project ► Clean from the menu bar. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 27
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 create an application for your target platform. PHYTEC Messtechnik GmbH 2015 L-781e_7...
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 [] = { "Welcome to the World of PHYTEC! (serial)\n" }, write_tty(buf, sizeof (buf) ‐ 1), In the next screenshot you can see the complete program. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 29
Quickstart 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-781e_7...
Page 30
Type . to start the application. /myHelloWorld You will see the following output: .Welcome to the World of PHYTEC! (serial). .Welcome to the World of PHYTEC!... Close Microcom. When you start the application via an SSH session, you only see one output line. When you execute the program with Microcom, you see two output lines.
Select Run ► External Tools ► External Tools Configurations from the menu bar. Double-Click Program a new program configuration will be opened. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 32
® phyFLEX -i.MX 6 In the Name input field, enter: myHelloWorld Target Enter in the Location input field. /usr/bin/ssh Enter into the Arguments field. root@192.168.3.11 ./myHelloWorld Select Apply. PHYTEC Messtechnik GmbH 2015 L-781e_7...
GDB client and GDB server can communicate over a TCP/IP network connection as well as via a serial interface. In this Application Guide we will only describe debugging via TCP/IP. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Start Eclipse if the application is not started yet. Right-click on the myHelloWorld project in the Navigator window. Select Debug As ► Debug Configurations. A dialog to create, manage and run applications appears. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 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...
Page 36
® phyFLEX -i.MX 6 Select gdbserver Debugger from the Debugger drop-down box. Enter in the GDB Debugger field ${GDB} Keep the GDB command file field empty. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 37
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 appears. •Select Yes to switch to the Debug perspective. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 38
You have configured your project for remote debugging. You have started the GNU debugger in Eclipse and connected the host's GDB with the target's GDB server. You can now start to debug the project. PHYTEC Messtechnik GmbH 2015 L-781e_7...
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 left-hand side and select Toggle Breakpoint to set a new breakpoint. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Expand buf in the Variables window. Click the Step Over button in the Debug window to step to the next line. You will see the content of the buf variable in the Variables window. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 41
Quickstart Instructions 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 2015 L-781e_7...
Go back to Eclipse. Click the Step Over button twice. Switch to Microcom. Because we changed the count variable to 7 only the first seven characters (Welcome) are displayed in the Microcom console. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Click + Add Memory Monitor. Enter the address of the buffer and click OK. Remember that the variable's address might be different on your system. Change the size of the window. Click Add Rendering. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 44
0xbef9ec47 (or at the specific ddress used on your system). Now click the Resume button from the menu bar. The debugger stops at the breakpoint in the last line of main(). PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 45
Eclipse for remote debugging. You can step through a project, watch and change the content of variables, and you can use the memory monitor to view the content at a memory address. PHYTEC Messtechnik GmbH 2015 L-781e_7...
If you want to remove the qt5demo from the autostart enter the following command: systemctl disable qt5demo 4.2 Importing the Demo Application We start with opening the Qt Creator in a terminal, because otherwise the correct environment of the toolchain is not set. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 47
Enter the following command in the 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_workspace/Qt is set automatically. PHYTEC Messtechnik GmbH 2015 L-781e_7...
The HelloWidget project is now imported into your Qt Creator workspace. 4.3 Work with the Demo Application Our example project is a simple Qt Widget Application. First we take a look at the user interface of our example: PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 49
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 buttons including one with the PHYTEC logo inside. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 50
® phyFLEX -i.MX 6 Right-click the “Hide Logo” button and select Go to slot … from the context menu. PHYTEC Messtechnik GmbH 2015 L-781e_7...
You see that clicking this button changes the status of the btn_Logo button from visible to hidden. Next we build and run the example. 4.4 Compile and Run the Demo Application on the Target PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 52
With only one click the project will be built, deployed to the target and executed. Click the green filled triangle near the bottom of the gray bar on the left. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 53
On the connected display you will see the HelloWidget appl ication. Click the big button with he PHYTEC logo to enable and disable the Welcome label. To see the d ifferent build steps click Compile output which can be found in the bottom menu bar.
To change the target for downloading and running the application do following steps: In the gray bar on the left click the button with the small phyFLEX-i.MX6 picture. In the opened context menu select Desktop as Kit and Release as Build. PHYTEC Messtechnik GmbH 2015 L-781e_7...
To make use of the QDebug functions QDebug is already included in the header of the file mainwindow.cpp. In this file you will also see two out-commented lines in the function on_btn_showLogo_clicked() which start with a qDebug() command. This is an example how to make use of qDebug(). PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 56
Now the logo was hidden before we pressed the Show Logo button again and we see the appropriate message from qDebug() in the Application Output. QDebug is a simple way to generate debug information. In the next chapter we use the debugger integrated in Qt Creator. PHYTEC Messtechnik GmbH 2015 L-781e_7...
The next step is to change the build configuration from Release to Debug. In the gray bar on the left click the button with the small Desktop icon. In the opened context menu select phyFLEX-i.MX6 as Kit and Debug as Build. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 58
The debugger starts and Qt Creator changes his view to the Debug mode. The demo application is shown on the connected display. In the running demo application click on the Hide Logo button. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 59
You can now watch the stack or the Locals and Expressions. Step into the setVisible function by pressing the Step Into button. Now the definition of this function is opened. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 60
Continue the stopped application by clicking on Continue. Now the demo application is continued and waiting for user interactions. Stop the Debugger by pressing Stop Debugger. You have successfully finished our short introduction to the Debugger from Qt Creator. PHYTEC Messtechnik GmbH 2015 L-781e_7...
In this chapter of the Quickstart we describe only the basic Yocto usage. For in-depth explanations refer to the Yocto Reference Manual. In this part you will learn how to use the Yocto Project and the PHYTEC BSP. 5.1 Add new packages to the Root Filesystem You can find the pre-build BSP in the virtual machine under /opt/PHYTEC_BSPs/phyFLEX- i.MX6/.
Page 62
Before we add the package we check if the right configuration is set. Open the configuration file with any editor, e.g. VI, with the following command: vi conf/local.conf Check the MACHINE variable in this file. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 63
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 changes and close the file with :x and Enter. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 64
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 a failure please check our ftp-server at ftp://ftp.phytec.de/pub/BSP_PACKAGES/EXTERNALS, and...
Copy the root filesystem to the folder /tftpboot: cp phytec‐qt5demo‐image‐phyflex‐imx6‐2.ubifs /tftpboot/ Open Microcom and press the RESET button on the target. You will see the output .Hit any key to stop autoboot.. Press any key to stop autoboot. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 66
Now we flash the root filesystem. T ype: ubiformat /dev/nand0.root ubiattach /dev/nand0.root ubimkvol /dev/ubi0 root 0 cp /mnt/tftp/phytec‐qt5demo‐image‐phyflex‐imx6‐2.ubifs /dev/ubi0.root Enter to boot the phyFLEX-i.MX6 with the new kernel and root file system. boot After the target has successfully finished booting, type to log in. root PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 67
BSP Manual. In this section you learned how to prepare the partition of the root filesystem and how to download the root filesystem from a TFTP server into the flash of the target. PHYTEC Messtechnik GmbH 2015 L-781e_7...
We recommend to have at least 80 GB of free disk space available. Download Ubuntu 14.04.3 LTS from www.ubuntu.com and create a bootable medium. Boot Ubuntu from your created boot medium. Select Install Ubuntu in the first Welcome window. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 69
Quickstart Instructions 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 2015 L-781e_7...
The first preparations are completed. In the next sections you will proceed with building the Board Support Package installation of Eclipse and Qt Creator and the set up of the TFTP server. PHYTEC Messtechnik GmbH 2015 L-781e_7...
The phyLinux script is a basic management tool for PHYTEC Yocto BSP releases. It is mainly a tool to get started with the BSP structure. You can get all the BSP sources without the need of interacting with repo or git.
Page 72
The current working directory of the shell should change to build/ and you are now 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 recommended default directory: deploy/sdk/yogurt‐glibc‐*.sh PHYTEC Messtechnik GmbH 2015 L-781e_7...
Enter following line before #!/bin/sh: . /opt/yogurt/iMX6‐PD15.1.1/environment‐setup‐cortexa9hf‐vfp‐neon‐ phytec‐linux‐gnueabi Afterwards open Eclipse and insert the path to the created workspace in the pop-up window: eclipse Enter the path to the created workspace: /opt/prj_workspace/Eclipse PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 74
The available plug-ins appear in the selection area below now. Expand Programming Languages and check C/C++ Development Tools. Click Next. Now the system displays an overview of the installation details. Click Next to proceed. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Set execute priviliges: sudo chmod +x qt‐opensource‐linux‐x64‐5.3.2.run Run the Qt Creator installation routine ./qt‐opensource‐linux‐x64‐5.3.2.run This opens a window for the installation. Step trough the installation and if you are asked set following installation directory: /opt/x64_Qt5.3.2 PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 76
After the 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 /usr/bin/qtcreator.sh Enter following line before #!/bin/sh: . /opt/yogurt/iMX6‐PD15.1.1/environment‐setup‐cortexa9hf‐vfp‐neon‐ phytec‐linux‐gnueabi PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 77
Tools --> Options --> Devices --> Add --> Generic Linux Device: Name: phyFLEX-i.MX6 192.168.3.11 Username: root Keep the password empty Set the project directory and build directory Tools --> Options --> Build & Run --> General. Projects Directory --> Directory: /opt/prj_workspace/Qt PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 78
Change the beginning of the entry in the Default 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/usr/bin/qt5/qmake PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 79
Quickstart Instructions Select tab Compilers and click on Add select GCC arm‐gcc mpiler Path: /opt/yogurt/iMX6‐PD15.1.1/sysroots/x86_64‐yogurtsdk‐ linux/usr/bin/arm‐phytec‐linux‐gnueabi/arm‐phytec‐linux‐gnueabi‐gcc Select tab Debuggers an click on Add arm‐gdb Path: /opt/yogurt/iMX6‐PD15.1.1/sysroots/x86_64‐yogurtsdk‐ linux/usr/bin/arm‐phytec‐linux‐gnueabi/arm‐phytec‐linux‐gnueabi‐gdb PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 80
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. Enter following command in the Addition Startup Commands: set auto‐load safe‐path / PHYTEC Messtechnik GmbH 2015 L-781e_7...
First change the file /etc/default/tftp-hpa as follows: TFTP_USERNAME="tftp" TFTP_DIRECTORY="/tftpboot" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="‐‐secure" Then create a folder called /tftpboot. The TFTP server will access this folder later. mkdir /tftpboot Finally we have to set the right permissions: chmod 777 /tftpboot PHYTEC Messtechnik GmbH 2015 L-781e_7...
Also there are some scripts that will be executed at the first start after the installation. These scripts ensure that the right permissions are set for the created user. Congratulations! You have successfully configured your Ubuntu to work with. PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 83
Change ptxdist to Yocto Update for working with Ubuntu 14.04.3 Update for working with PD15.1.1 Update for working with SO-525v9 Add Programming with Qt Creator Remove chapter Updating the Software (now in BSP Manual) PHYTEC Messtechnik GmbH 2015 L-781e_7...
Page 84
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 Messtechnik GmbH Postfach 100403 D-55135 Mainz, Germany Fax : +49 (6131) 9221-33 PHYTEC Messtechnik GmbH 2015 L-781e_7...
Need help?
Do you have a question about the phyFLEX-i.MX 6 and is the answer not in the manual?
Questions and answers