VersaLogic Zebra VL-EPC-2701 User Manual Download Page 28

Creating a Simple Application 

 

28 

Zebra (VL-EPC-2701) Yocto Linux User Guide 

 

BB= " ${BSPDIR}/sources/meta-openembedded/meta-python " 

BB= " ${BSPDIR}/sources/meta-openembedded/meta-filesystems 

BB= " ${BSPDIR}/sources/meta-qt5 " 

BB_NUMBER_THREADS = "8" 

4.  We also need to tell 

bitbake

 to include 

helloworld

 in the new Linux image by 

modifying 

conf/local.conf 

to include the line highlighted. 

MACHINE ??= 'imx6zebra' 

DISTRO ?= 'fsl-imx-x11' 

PACKAGE_CLASSES ?= "package_rpm" 

EXTRA_IMAGE_FEATURES ?= "debug-tweaks" 

USER_CLASSES ?= "buildstats image-mklibs" 

PATCHRESOLVE = "noop" 

BB_DISKMON_DIRS = "\ 

    STOPTASKS,${TMPDIR},1G,100K \ 

    STOPTASKS,${DL_DIR},1G,100K \ 

    STOPTASKS,${SSTATE_DIR},1G,100K \ 

    STOPTASKS,/tmp,100M,100K \ 

    ABORT,${TMPDIR},100M,1K \ 

    ABORT,${DL_DIR},100M,1K \ 

    ABORT,${SSTATE_DIR},100M,1K \ 

    ABORT,/tmp,10M,1K" 

PACKAGECONFIG_append_pn-qemu-native = " sdl" 

PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" 

CONF_VERSION = "1" 

IMAGE_INSTALL_append = " helloworld" 

 

DL_DIR ?= "${BSPDIR}/downloads/" 

ACCEPT_FSL_EULA = "1" 

5.  Now it is time to build the Linux image again. 

$ bitbake fsl-image-validation-imx 

Once the new image is built, deploy it to the Zebra using one of the methods already discussed. 
On the Zebra, run the application by typing the name of the executable.  

root@imx6zebra:~# helloworld 

Hello World! 

Thank you for choosing VersaLogic!

Summary of Contents for Zebra VL-EPC-2701

Page 1: ...Yocto Linux User Guide REV April 2018 Zebra VL EPC 2701 Arm i MX6 Single Board Computer with Gigabit Ethernet Video USB SATA Serial I O Digital I O CAN Bus SPI and I2C...

Page 2: ...to ensure this document is error free VersaLogic makes no representations or warranties with respect to this product and specifically disclaims any implied warranties of merchantability or fitness for...

Page 3: ...om Repair Service If your product requires service you must obtain a Returned Material Authorization RMA number by calling 503 747 2261 Be ready to provide the following information Your name the name...

Page 4: ...s 13 Setting up the Repo Utility 14 Yocto Project Setup 15 Building the Zebra Image 17 Setting up the Build Configurations 17 Patching the Build Configuration 18 Creating the Target Image 19 Deploying...

Page 5: ...ents and Connectors 7 Figure 2 Booting the System 8 Figure 3 Login 9 Figure 3 X11 Desktop 9 Figure 5 Opening a Terminal 11 Figure 6 Alsamixer 11 Figure 7 Stopping Auto Boot 21 Figure 8 Printenv 22 Fig...

Page 6: ...cto Linux development environment and to build the OS image develop a simple application and deploy the OS and applications to the Zebra for execution However this guide is not intended to provide sig...

Page 7: ...components of a Zebra Figure 1 Major Components and Connectors Setting up Zebra for the First Time At a minimum the following ports and devices should be connected before booting up Zebra for the fir...

Page 8: ...all other connections and jumper changes have been made J16 COM1 connect the VL CBR 0504 cable adapter for RS 232 serial port and then connect serial cable to a PC COM port Use a terminal emulator su...

Page 9: ...ck Start Zebra VL EPC 2701 Yocto Linux User Guide 9 Figure 3 Login If a monitor is connected to the HDMI port then a basic X11 Desktop as shown below will be displayed on the monitor Figure 4 X11 Desk...

Page 10: ...industry standard click boards which can provide expandability to support additional on board I O including I 2 C SPI and serial lines See the Zebra Hardware Reference Manual for socket pin support in...

Page 11: ...rminal window and adjust the headphone volume in the GUI using up or down arrow keys sh 4 3 alsamixer Figure 6 Alsamixer Audio Recording To record audio on the Zebra first connect a microphone or head...

Page 12: ...s and Commands 12 Zebra VL EPC 2701 Yocto Linux User Guide Note Audio recording and playback are also possible through the J13 User IO connector but a break out cable is required in order to access li...

Page 13: ...G Internet access to download additional required software 2 Operating System the recommended OS for the host PC is Ubuntu 14 04 which is the version currently supported for Zebra and has been verifi...

Page 14: ...which do not need to be on the same server Repo complements very well the layered nature of the Yocto Project making it easier for users to add their own layers to the BSP To install the repo utility...

Page 15: ...t for the base and for i MX ARM reference boards meta freescale 3rdparty provides support for 3rd party and partner boards meta freescale distro additional items to aid in development and exercise boa...

Page 16: ...is checked out into the directory fsl release bsp sources You can perform repo synchronization periodically with the command repo sync to update to the latest code If errors occur during repo initial...

Page 17: ...pported o fsl imx fb Frame Buffer graphics no X11 or Wayland machine name specifies the name of the target machine For the Zebra this should be imx6zebra build dir specifies the name of the build dire...

Page 18: ...salogic BB_NUMBER_THREADS 8 The resulting file should look like this cat bblayers conf POKY_BBLAYERS_CONF_VERSION 2 BBPATH TOPDIR BSPDIR os path abspath os path dirname d getVar FILE True BBFILES BBLA...

Page 19: ...with console environment no GUI interface meta freescale distro fsl image validation imx Builds an i MX image with a GUI without any Qt content meta fsl bsp release imx meta sdk fsl image validation...

Page 20: ...ed in the Quick Start section of this guide Booting from the Network Another method to deploy the image is through the network The Zebra will download the kernel image and DTB file via TFTP protocol t...

Page 21: ...o_subtree_check 4 Restart these services so new configurations can take effect sudo chmod R 777 tftpboot sudo etc init d xinetd restart sudo etc init d nfs kernel server restart Configuring U Boot Env...

Page 22: ...3 In order to instruct the system to boot from the network use the following commands to update the U Boot environment variables setenv serverip Host PC IP setenv nfsroot tftpboot rootfs setenv image...

Page 23: ...un netboot Figure 9 Netboot Deploying to eMMC Some Zebra boards may come with an eMMC installed In this case the Linux image can be deployed to the eMMC as the boot device There are several options fo...

Page 24: ...on the Zebra board 3 Write the image to the eMMC with the following command root imx6zebra dd if fsl image validation imx imx6zebra sdcard of dev mmcblk3 bs 1M sync 4 Reboot Zebra and stop in U Boot 5...

Page 25: ...ample fsl imx x11 glibc x86_64 meta toolchain cortexa9hf neon toolchain 4 9 11 1 0 0 sh 3 When prompted choose default or Y as response to all questions At the end of the installation you should see t...

Page 26: ...it is deployed along with the OS so there will be no need to copy it separately The procedure for integrating an application into the Linux image is quite different from building a standalone executab...

Page 27: ...meta helloworld to the file conf bblayers conf in the build directory The file should now look similar to the following example cat conf bblayers conf POKY_BBLAYERS_CONF_VERSION 2 BBPATH TOPDIR BSPDI...

Page 28: ...s PATCHRESOLVE noop BB_DISKMON_DIRS STOPTASKS TMPDIR 1G 100K STOPTASKS DL_DIR 1G 100K STOPTASKS SSTATE_DIR 1G 100K STOPTASKS tmp 100M 100K ABORT TMPDIR 100M 1K ABORT DL_DIR 100M 1K ABORT SSTATE_DIR 10...

Page 29: ...CORE_IMAGE_EXTRA_INSTALL firefox 2 In the source code directory edit the file sources meta browser recipes mozilla firefox firefox_38 8 0esr bb and comment out the last line if it exists PNBLACKLIST...

Page 30: ...th understanding of the Linux kernel the details of which are beyond the scope of this guide However as an introduction here is an example on how to add a device driver to the Linux kernel 1 In the bu...

Page 31: ...uide 31 2 Look for Device Drivers in the list Figure 12 Device Drivers 3 Press Return to enter the Device Drivers submenu and find Sony MemoryStick card support Highlight the item and type y Now an is...

Page 32: ...I 6 Rebuild the Linux kernel with the following command bitbake c compile linux versalogic f bitbake c deploy linux versalogic 7 If needed rebuild the SD card image as discussed previously The new ima...

Page 33: ...mx6solozebra_config sdcard UBOOT_CONFIG sata mx6solozebra_sata_config UBOOT_CONFIG mfgtool mx6solozebra_config UBOOT_CONFIG spinor mx6dlzebra_config UBOOT_CONFIG sd mx6dlzebra_config sdcard UBOOT_CONF...

Page 34: ...e nor Eraseblock size 4096 bytes 4 0 KiB Amount of eraseblocks 512 2097152 bytes 2 0 MiB Minimum input output unit size 1 byte Sub page size 1 byte Character device major minor 90 2 Bad blocks are all...

Page 35: ...f y 2 0x1C 0x05B 0x03 acc_sens 0 244 nominal sensitivity for 2g accelerometer mode mag_sens 0 1 nominal sensitivity for magnetometer echo Accelerometer and magnetometer real time measurement echo X Y...

Page 36: ...2768 then mag_y echo 65536 mag_y 1 bc l fi if mag_z gt 32768 then mag_z echo 65536 mag_z 1 bc l fi convert values acc_x echo acc_x acc_sens bc l acc_y echo acc_y acc_sens bc l acc_z echo acc_z acc_sen...

Page 37: ...0 overruns 0 carrier 0 collisions 0 txqueuelen 10 RX bytes 0 0 0 B TX bytes 0 0 0 B Interrupt 33 The user is able to configure the CAN interfaces like setting the bit timing parameters using the comma...

Page 38: ...2 For each bus 0 1 2 scan the bus for device with the command i2cdetect y bus sh 4 3 i2cdetect y 2 0 1 2 3 4 5 6 7 8 9 a b c d e f 00 UU UU 10 20 30 30 37 3a 40 4a 4b 50 UU 60 70 3 Use the i2cdump com...

Page 39: ...g a pin make sure its GPIO number has been exported to the sys class gpio export file The IO direction for a pin is set in the sys class gpio gpio direction file Only valid values are in or out Once t...

Page 40: ...o project qs yocto project qs html The Freescale Yocto Project main page can be found at https community nxp com docs DOC 1616 Information on the NXP i MX6 ARM Cortex A9 Quad processor is available at...

Page 41: ...is caused by systemd being used for initialization instead of the sysvinit method used in the previous Yocto versions A new image can be built fsl image validation imx imx6zebra 20180406200450 rootfs...

Reviews: