i.MX Processors Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX Processors Knowledge Base

Discussions

You can power on/off i.MX31 PDK LEDs using U-Boot: u-boot> mw.b B6020000 FF Where B6020000 is the CPLD LED address and FF is the 8 bits hexadecimal value which will be displayed on LEDs.
View full article
Changing Freescale's BSP U-boot using LTIB This quick recipe demonstrates how to compile U-boot using Freescale BSP. 0. After installing i.MX51 BSP: 1. Extract u-boot source: ./ltib -m prep -p u-boot 2. (optional) If you wish to apply changes to the code, the source is located at: <ltib path>/rpm/BUILD/u-boot-2009.08 3. Compile u-boot for the i.MX51 EVK ./ltib -m scbuilb -p u-boot 4. Copy the compiled file to a SD card on your host machine, insert the SD card and: $ sudo dd if=rpm/BUILD/u-boot-2009.08/u-boot.bin of=/dev/mmcblk0 bs=512 /dev/mmcblk0 should replaced according to your host, use "dmesg" after inserting the SD to find out where is the SD on your host. Unmount it before issuing the dd command.   5. Insert the SD on the i.MX 51 EVK, set the switches for SD Card boot and power on the board.
View full article
Introduction The "smart" package management system is available in  Yocto Project for managing  packages on a target machine. A host is configured as a server for the packages and on the target the "package-management" feature is enabled for working with the packages. The steps for setup and usage are described below. Resources The Yocto Project package management system will work with many hosts and targets. The following were used for creating this document: Host: Ubuntu 14.04 64-bit Target: MCIMX6Q-SDP Freescale Yocto Project Release Documentation: Linux 3.14.38_6ul BSP & Multimedia Codecs Documentation (fsl-yocto-L3.14.38_6ul-ga.tar.gz) Host You have successfully installed a Freescale Yocto Project release. (Refer to Freescale Yocto Project Release Documentation). There are two steps for adding package management and then building: 1. Modify conf/local.conf EXTRA_IMAGE_FEATURES = "debug-tweaks package-management" ‍ 2. Build the image: bitbake core - image - minimal ‍ The core-image-minimal recipe provides an image enabling the target board to boot and support a serial console. 3. Create SDCARD: $ cd < build > / tmp / deploy / images / imx6qsabresd $ sudo dd if = core - image - minimal - imx6qsabresd . sdcard of = / dev / sdb bs = 4M & & sync ‍ ‍ Note - verify location of SDCARD on your host, /dev/sdb in this example. Examine 'cat /proc/partitions' 4. Setup web server and add link to rpm packages A web server, lighttpd, is installed. $ sudo apt - get install lighttpd ‍ Provide user write capability in /var/www $ sudo chmod 777 / var / www ‍ Create a soft link in the default web server directory to the rpm directory from the build. Note: Please update $HOME/<build> to your actual location: $ ln - s $HOME / < build > / tmp / deploy / rpm / var / www / imx6qsd ‍ ‍ ‍ Target Insert the SDCARD created from step 3 above, connect power and console cable  and power on the MCIMX6Q-SDP. Login using the "root" id, no password required. The /usr/bin/smart application is now used to setup the channels and perform package commands. For all smart options: smart - - help ‍ 1. Add channels To add the packages from the host to your target, the smart  channel --add is used: Please enter the IP adress of your server, replacing SERVERIP below: smart channel - - add all type = rpm - md name = all baseurl = http : // SERVERIP / imx6qsd / all smart channel - - add cortexa9hf_vfp_neon type = rpm - md name = cortexa9hf_vfp_neon baseurl = http : // SERVERIP / imx6qsd / cortexa9hf_vfp_neon smart channel - - add imx6qsabresd type = rpm - md name = imx6qsabresd baseurl = http : // SERVERIP / imx6qsd / imx6qsabresd ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Check  the added channels: root@imx6qsabresd : ~ # smart channel --list all imx6qsabresd rpmsys cortexa9hf_vfp_neon ‍ ‍ ‍ ‍ ‍ 2. Update  local package cache Once the chanels have been added, the local package cache is updated. Note  SERVERIP below will be the host IP address in your network. root@imx6qsabresd:~# smart update Loading cache... Updating cache...               ######################################## [100%] Fetching information for 'all'...                                           -> http://SERVERIP/imx6qsd/all/repodata/repomd.xml                           repomd.xml                      ######################################## [ 16%]                                                                             Fetching information for 'imx6qsabresd'... -> http://SERVERIP/imx6qsd/imx6qsabresd/repodata/repomd.xml                  repomd.xml                      ######################################## [ 41%]                                                                             Fetching information for 'cortexa9hf_vfp_neon'... -> http://SERVERIP/imx6qsd/cortexa9hf_vfp_neon/repodata/repomd.xml           repomd.xml                      ######################################## [ 66%] Updating cache...               ######################################## [100%] Channels have no new packages. 3. Searching for packages Let us look at all packages containing the string client root@imx6qsabresd : ~ # smart search client* Loading cache . . . Updating cache . . .                ######################################## [100%] libice - dbg - ICE : Inter - Client Exchange library - Debugging files libice - dev - ICE : Inter - Client Exchange library - Development files libice - doc - ICE : Inter - Client Exchange library - Documentation files libice - staticdev - ICE : Inter - Client Exchange library - Development files ( Static Libraries ) libice6 - ICE : Inter - Client Exchange library libsm - dbg - SM : Session Management library - Debugging files libsm - dev - SM : Session Management library - Development files libsm - doc - SM : Session Management library - Documentation files libsm - staticdev - SM : Session Management library - Development files ( Static Libraries ) libsm6 - SM : Session Management library libx11 -6 - Xlib : C Language X Interface library libx11 - dbg - Xlib : C Language X Interface library - Debugging files libx11 - dev - Xlib : C Language X Interface library - Development files libx11 - doc - Xlib : C Language X Interface library - Documentation files libx11 - locale - Xlib : C Language X Interface library libx11 - staticdev - Xlib : C Language X Interface library - Development files ( Static Libraries ) libx11 - xcb1 - Xlib : C Language X Interface library libxau - dbg - Xau : X Authority Database library - Debugging files libxau - dev - Xau : X Authority Database library - Development files libxau - doc - Xau : X Authority Database library - Documentation files libxau - staticdev - Xau : X Authority Database library - Development files ( Static Libraries ) libxau6 - Xau : X Authority Database library python - netclient - Python Internet Protocol clients xtrans - dbg - XTrans : X Transport library - Debugging files xtrans - dev - XTrans : X Transport library - Development files xtrans - doc - XTrans : X Transport library - Documentation files ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Adding openssh client to core-image minimal The core-image-minimal does not provide openssh client applications like ssh or scp. Let's add them on the host then update the target cache of packages and then install. Host Run bitbake to exercise all the tasks for packagegroup-core-ssh-openssh $ bitbake packagegroup - core - ssh - openssh ‍ After building a package individually, always update the package-index $ bitbake package - index ‍ Target Run smart to update the local cache which will pickup the new packages from the bake above. root@imx6qsabresd : ~ # smart update Loading cache . . . Updating cache . . .                ######################################## [100%] Fetching information for 'all' . . .                                               - > http : // SERVERIP / imx6qsd / all / repodata / repomd . xml                           repomd . xml                      ######################################## [ 16%] - > http : // SERVERIP / imx6qsd / all / repodata / primary . xml . gz                       primary . xml . gz                  ######################################## [ 25%] - > http : // SERVERIP / imx6qsd / all / repodata / filelists . xml . gz                     filelists . xml . gz                ######################################## [ 33%]                                                                                Fetching information for 'imx6qsabresd' . . . - > http : // SERVERIP / imx6qsd / imx6qsabresd / repodata / repomd . xml                  repomd . xml                      ######################################## [ 50%] - > http : // SERVERIP / imx6qsd / imx6qsabresd / repodata / primary . xml . gz              - > http : // SERVERIP / imx6qsd / imx6qsabresd / repodata / filelists . xml . gz            filelists . xml . gz                ######################################## [ 58%] primary . xml . gz                  ######################################## [ 66%]                                                                                Fetching information for 'cortexa9hf_vfp_neon' . . . - > http : // SERVERIP / imx6qsd / cortexa9hf_vfp_neon / repodata / repomd . xml           repomd . xml                      ######################################## [ 83%] - > http : // SERVERIP / imx6qsd / cortexa9hf_vfp_neon / repodata / primary . xml . gz       primary . xml . gz                  ######################################## [ 91%] - > http : // SERVERIP / imx6qsd / cortexa9hf_vfp_neon / repodata / filelists . xml . gz     filelists . xml . gz                ######################################## [100%] Updating cache . . .                ######################################## [100%] Channels have 15 new packages . Saving cache . . . ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Examine information about local cache: root@imx6qsabresd : ~ # smart stats Loading cache . . . Updating cache . . .                ######################################## [100%] Installed Packages : 80 Total Packages : 3586 Total Provides : 6580 Total Requires : 1611 Total Upgrades : 3565 Total Conflicts : 25 ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ See what ssh packages are now available: root@imx6qsabresd : ~ # smart search *ssh* Loading cache . . . Updating cache . . .                ######################################## [100%] openssh - Secure rlogin / rsh / rcp / telnet replacement openssh - dbg - Secure rlogin / rsh / rcp / telnet replacement - Debugging files openssh - dev - Secure rlogin / rsh / rcp / telnet replacement - Development files openssh - doc - Secure rlogin / rsh / rcp / telnet replacement - Documentation files openssh - keygen - Secure rlogin / rsh / rcp / telnet replacement openssh - misc - Secure rlogin / rsh / rcp / telnet replacement openssh - ptest - Secure rlogin / rsh / rcp / telnet replacement - Package test files openssh - scp - Secure rlogin / rsh / rcp / telnet replacement openssh - sftp - Secure rlogin / rsh / rcp / telnet replacement openssh - sftp - server - Secure rlogin / rsh / rcp / telnet replacement openssh - ssh - Secure rlogin / rsh / rcp / telnet replacement openssh - sshd - Secure rlogin / rsh / rcp / telnet replacement packagegroup - core - ssh - openssh - OpenSSH SSH client / server packagegroup - core - ssh - openssh - dbg - OpenSSH SSH client / server - Debugging files packagegroup - core - ssh - openssh - dev - OpenSSH SSH client / server - Development files ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Install openssh root@imx6qsabresd : ~ # smart install openssh Loading cache . . . Updating cache . . .                ######################################## [100%] Computing transaction . . . Installing packages ( 9 ) :   openssh -6. 7p1 - r0@cortexa9hf_vfp_neon                                            openssh - keygen -6. 7p1 - r0@cortexa9hf_vfp_neon                                     openssh - scp -6. 7p1 - r0@cortexa9hf_vfp_neon                                        openssh - ssh -6. 7p1 - r0@cortexa9hf_vfp_neon                                        openssh - sshd -6. 7p1 - r0@cortexa9hf_vfp_neon                                       shadow -4.2 . 1 - r0@cortexa9hf_vfp_neon                                             shadow - base -4.2 . 1 - r0@cortexa9hf_vfp_neon                                        shadow - securetty -4.2 . 1 - r3@imx6qsabresd                                          util - linux - sulogin -2.25 . 2 - r1@cortexa9hf_vfp_neon                              1. 4MB of package files are needed . 3. 2MB will be used . Confirm changes? ( Y / n ) : y Fetching packages . . .                                                            - > http : // SERVERIP / imx6qsd / . . . / openssh -6. 7p1 - r0 . cortexa9hf_vfp_neon . rpm      - > http : // SERVERIP / imx6qsd / . . . / shadow - securetty -4.2 . 1 - r3 . imx6qsabresd . rpm    shadow - securetty -4.2 . 1 - r3 . imx . . ######################################## [ 11%] - > http : // SERVERIP / imx6qsd / . . . / openssh - scp -6. 7p1 - r0 . cortexa9hf_vfp_neon . rpm openssh - scp -6. 7p1 - r0 . cortexa9 . . ######################################## [ 22%] openssh -6. 7p1 - r0 . cortexa9hf_v . . ######################################## [ 33%] - > http : // SERVERIP / imx6qsd / . . . / openssh - sshd -6. 7p1 - r0 . cortexa9hf_vfp_neon . rpm openssh - sshd -6. 7p1 - r0 . cortexa . . ######################################## [ 44%] - > http : // SERVERIP / imx6qsd / . . . / shadow -4.2 . 1 - r0 . cortexa9hf_vfp_neon . rpm       - > http : // SERVERIP / imx6qsd / . . . / openssh - ssh -6. 7p1 - r0 . cortexa9hf_vfp_neon . rpm openssh - ssh -6. 7p1 - r0 . cortexa9 . . ######################################## [ 55%] - > http : // SERVERIP / imx6qsd / . . . / shadow - base -4.2 . 1 - r0 . cortexa9hf_vfp_neon . rpm shadow - base -4.2 . 1 - r0 . cortexa9 . . ######################################## [ 66%] shadow -4.2 . 1 - r0 . cortexa9hf_vf . . ######################################## [ 77%] - > http : // SERVERIP / . . . / util - linux - sulogin -2.25 . 2 - r1 . cortexa9hf_vfp_neon . rpm util - linux - sulogin -2.25 . 2 - r1 . . . ######################################## [ 88%] - > http : // SERVERIP / . . . / openssh - keygen -6. 7p1 - r0 . cortexa9hf_vfp_neon . rpm       openssh - keygen -6. 7p1 - r0 . corte . . ######################################## [100%]                                                                                Committing transaction . . . Preparing . . .                     ######################################## [  0%]    1 : Installing openssh - ssh     ######################################## [ 11%] Output from openssh - ssh -6. 7p1 - r0@cortexa9hf_vfp_neon :                           update - alternatives : Linking / usr / bin / ssh to / usr / bin / ssh . openssh                 2 : Installing openssh - scp     ######################################## [ 22%] Output from openssh - scp -6. 7p1 - r0@cortexa9hf_vfp_neon :                           update - alternatives : Linking / usr / bin / scp to / usr / bin / scp . openssh                 3 : Installing shadow - secure . . ######################################## [ 33%]    4 : Installing shadow - base     ######################################## [ 44%] Output from shadow - base -4.2 . 1 - r0@cortexa9hf_vfp_neon :                           update - alternatives : Linking / usr / bin / newgrp to / usr / bin / newgrp . shadow         update - alternatives : Linking / usr / bin / groups to / usr / bin / groups . shadow update - alternatives : Linking / bin / login to / bin / login . shadow update - alternatives : Linking / bin / su to / bin / su . shadow    5 : Installing util - linux - su . . ######################################## [ 55%] Output from util - linux - sulogin -2.25 . 2 - r1@cortexa9hf_vfp_neon :                   update - alternatives : Linking / sbin / sulogin to / sbin / sulogin . util - linux            6 : Installing openssh - keygen  ######################################## [ 66%]    7 : Installing shadow          ######################################## [ 77%] Output from shadow -4.2 . 1 - r0@cortexa9hf_vfp_neon :                                update - alternatives : Linking / usr / bin / passwd to / usr / bin / passwd . shadow         update - alternatives : Linking / usr / bin / chfn to / usr / bin / chfn . shadow update - alternatives : Linking / usr / bin / chsh to / usr / bin / chsh . shadow update - alternatives : Linking / usr / sbin / chpasswd to / usr / sbin / chpasswd . shadow update - alternatives : Linking / sbin / vipw to / sbin / vipw . shadow update - alternatives : Linking / sbin / vigr to / sbin / vigr . shadow Output from openssh - sshd -6. 7p1 - r0@cortexa9hf_vfp_neon :                          Removing any system startup links for sshd . . .                                 Running useradd commands . . . NOTE : Performing useradd with [ - - system - - no - create - home - - home - dir / var / run / sshd - - shell / bin / false - - user - group sshd ] and 10 times of retry    8 : Installing openssh - sshd    ######################################## [ 88%] Adding system startup for / etc / init . d / sshd .                                    Starting OpenBSD Secure Shell server : sshd   generating ssh RSA key . . .   generating ssh ECDSA key . . .   generating ssh DSA key . . .   generating ssh ED25519 key . . . done .    9 : Installing openssh         ######################################## [100%] ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Check for the scp command: root@imx6qsabresd : ~ # which scp / usr / bin / scp ‍ ‍ Summary To add a new package on the server host, run bitbake <recipe> then bitbake package-index to update the rpm tracking information. On the target board, run smart update and then smart install <package>. Use smart search <regular expression string> to hunt for a package to install.
View full article
Recipes to include Amazon's Alexa Voice Services in your applications. Step 1 : Get iMX Yocto AVS setup environment Review the steps under Chapter 3 of the   i.MX_Yocto_Project_User'sGuide.pdf   on the   L4.X LINUX_DOCS   to prepare your host machine. Including at least the following essential Yocto packages $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \ gcc-multilib build-essential chrpath socat libsdl1.2-dev u-boot-tools Install the i.MX NXP AVS repo Create/Move to a directory where you want to install the AVS yocto build enviroment. Let's call this as <yocto_dir> $ cd <yocto_dir> $ repo init -u https://source.codeaurora.org/external/imxsupport/meta-avs-demos -b master -m imx-alexa-sdk-4.9.51-8mq_ga.xml Download the AVS BSP build environment: $ repo sync Step 2: Setup yocto for Alexa_SDK image with AVS-SETUP-DEMO script: Run the avs-setup-demo script as follows to setup your environment for the imx8mqevk board: $ MACHINE=imx8mqevk DISTRO=fsl-imx-xwayland source avs-setup-demo.sh -b <build_sdk_8M> Where <build_sdk> is the name you will give to your build folder. After acepting the EULA the script will prompt if you want to enable: Sound Card selection The following Sound Cards are supported on the build: 2-Mic Synaptics/Conexant 2-Mic TechNexion Voice Hat (with DSPConcepts SW) The script will prompt to select the soundcard you will be using: Which Sound Card are you going to use? Synaptics/Conexant .................... 1 VoiceHat (for DSPConcepts SW) ......... 2 Type the number of your selection and press Enter... Install Alexa SDK Next option is to select if you want to pre-install the AVS SDK software on the image. Do you want to build/include the AVS_SDK package on this image(Y/N)? If you select   YES , then your image will contain the AVS SDK ready to use (after authentication). Note this AVS_SDK will not have WakeWord detection support, but it can be added on runtime. If your selection was   NO , then you can always manually fetch and build the AVS_SDK on runtime. All the packages dependencies will be already there, so only fetching the AVS_SDK source code and building it is required. Finish avs-image configuration At the end you will see a text according with the configuration you select for your image build. Next is an example for a Preinstalled AVS_SDK with Synaptics Sound Card support ============================================================ AVS configuration is now ready at conf/local.conf - Sound Card = Synaptics - Alexa SDK 1.7 pre-installed - Wifi supported You are ready to bitbake your AVS demo image now:   bitbake avs-image If you want to use QT5DisplayCards, use then:   bitbake avs-image-qt5 ============================================================ Step 3: Build the AVS image Go to your <build_sdk> directory and start the build of the avs-image There are 2 options Regular Build: $ cd  <yocto_dir>/<build_sdk>   $ bitbake avs-image With QT5 support included: $ cd  <yocto_dir>/<build_sdk>   $ bitbake avs-image-qt5 The image with QT5 is useful if you want to add some GUI for example to render DisplayCards. Step 4 : Deploying the built images to SD/MMC card to boot on target board. After a build has succesfully completed, the created image resides at <build_sdk>/tmp/deploy/images/imx8mqevk/ In this directory, you will find   imx8mqevk-avs--.sdcard   image or   imx8mqevk-avs-qt5--.sdcard , depending on the build you chose on Step3. To Flash the .sdcard image into an SD Card follow the next steps: Extract and copy the .sdcard file to your SD Card $ cd <build_sdk>/tmp/deploy/images/imx8mqevk/ $ cp -v imx8mqevk-avs-synaptics-1.7.sdcard.bz2 <workdir> $ cd <workdir> $ sudo bzip2 -d imx8mqevk-avs-synaptics-1.7.sdcard.bz2 $ sudo dd if=imx8mqevk-avs-synaptics-1.7.sdcard.bz2 of=/dev/sd<part> bs=1M && sync $ sync Properly eject the SD Card: $ sudo eject /dev/sd<part> Insert the flashed SD Card on the 8M EVK and boot. Follow the instructions at startup to setup your AVS and run the SampleApp. NXP Documentation For a more comprehensive understanding of Yocto, its features and setup; more image build and deployment options and customization, please take a look at the   i.MX_Yocto_Project_User's_Guide.pdf   document from the Linux documents bundle mentioned at the beginning of this document. For a more detailed description of the Linux BSP, u-boot use and configuration, please take a look at the   i.MX_Linux_User's_Guide.pdf   document from the Linux documents bundle mentioned at the beginning of this document.
View full article
In order to create this Ogg Theora encoder example you need to add libogg, libvorbis and libtheora to your system. Download these libs from http://www.theora.org/downloads/ : libogg-1.1.3, libvorbis-1.2.0 and libtheora-1.0.tar.bz2 Copy them to /opt/ltib/pkgs Create the directories ltib/dist/lfs-5.1/libogg, ltib/dist/lfs-5.1/libvorbis, ltib/dist-5.1/lfs/libtheora. Copy these spec files to its respective directories: File:Libogg.gz File:Libvorbis.gz File:Libtheora.gz Execute this sequence to compile and install these libs: $ ./ltib -p libogg.spec -m prep $ ./ltib -p libogg.spec -m scbuild $ ./ltib -p libogg.spec -m scdeploy $ ./ltib -p libvorbis.spec -m prep $ ./ltib -p libvorbis.spec -m scbuild $ ./ltib -p libvorbis.spec -m scdeploy $ ./ltib -p libtheora.spec -m prep $ ./ltib -p libtheora.spec -m scbuild $ ./ltib -p libtheora.spec -m scdeploy Now download and compile yuv2theora.c encoder example: File:Yuv2theora.gz $ ./ltib -m shell LTIB> gcc yuv2theora.c -o yuv2theora `pkg-config --libs --cflags theora` In this example we used a video sample (YUV420) on CIF format: http://140.116.72.80/~jhlin5/ns2/yuv_to_avi/paris_cif.yuv Update: All these libraries were added on LTIB Savannah CVS, then you just need to use them and compile the above code.
View full article
Overview i.MX28EVK Setup Build Yocto Project image Create a SDCARD from the Linux Host Boot i.MX28EVK Create file system on USB Create Mount Point and Mount the USB device Create 250 MB File Create Exports File Restart NFS Server Ubuntu Linux Host Setup Create Mount Directory Mount i.MX28EVK Exported Directory Access the NFS mounted directory Overview This document describes the steps for configuring a NFS Server running on an i.MX Application Processor - in this case the evaluation board i.MX28 EVK. Once the NFS server is running, an Ubuntu 12.04 Linux host is then configured to NFS mount the i.MX28EVK exported directory. The Ethernet interface is used for the connection transport. A block diagram of the connection setup is shown below: An Ethernet switch provided the Ethernet connection between the Linux Host and the i.MX28EVK. A thumb drive was connected to the USB port on the i.MX28EVK which was used for the exported directory. i.MX28EVK Setup Build Yocto Project image Use core-image-minimal and add packages to conf/local.conf to support NFS MACHINE=imx28evk source setup-environment mx28-evk echo "CORE_IMAGE_EXTRA_INSTALL += \"bash kernel-modules nfs-utils\" " >> conf/local.conf bitbake core-image-minimal When bitbake finishes the images are found in tmp/deploy/images/imx28evk Create a SDCARD from the Linux Host sudo dd if=/tmp/deploy/images/imx28evk/core-image-minimal-imx28evk.sdcard of=/dev/sdc bs=4M && sync Boot i.MX28EVK Insert the SDCARD into slot 0 on the bottom side of the i.MX28EVK and connect the serial console. Power-on and push the POWER button on the lower conner to turn on. The Login credentials are User Name: root      There is no password configured by default. Create file system on USB The USB drive had one partition which was formatted with vfat file system: mkfs.vfat /dev/sdb1 Create Mount Point and Mount the USB device mkdir /mnt/usb mount /dev/sdb1 /mnt/usb Create 250 MB File dd if=/dev/zero of=/mnt/usb/file1.txt bs=512K count=500 Create Exports File echo "/mnt/usb *(rw,sync,no_root_squash,no_subtree_check)" > /etc/exports Restart NFS Server /etc/init.d/nfsserver stop /etc/init.d/nfsserver start Ubuntu Linux Host Setup Create Mount Directory sudo mkdir /mnt/remote Mount i.MX28EVK Exported Directory sudo mount -t nfs 10.85.1.10:/mnt/usb /mnt/remote Access the NFS mounted directory ls /mnt/remote
View full article
In every i.MX BSP you will find a pre-compiled binary to flash on your board, but if you need to recompile, this tutorial will be useful. Redboot source code and pre-built images for many platforms are available on Linux Board Support Package (BSP). As an example, let's compile redboot version 2009_10 that comes with Freescale Linux BSP.   For detailed information about Redboot, check <redboot_folder>/doc Locate the file ecostools.tar.gz and decompress it on /opt directory. (Create this folder if it is not there) $ cd /opt $ sudo tar zxvf <redboot_folder>/tools/ecos_config_tools.tar.gz $ sudo tar zxvf <redboot_folder>/tools/arm-2008q1.tar.gz This creates /opt/ecostools directory with two subdirectories: arm-2008q1 -- GNU tools for compiling, linking, etc. tools -- mainly to have ecosconfig utility program Add /opt/arm-2008q1/bin and /opt/tools/bin to your environment PATH variable. $ export PATH=$PATH:/opt/arm-2008q1/bin:/opt/tools/bin Generating RedBoot Image Decompress the ecos-trunk-080727.tar.bz2 base line source code into <redboot_folder>/src. There should be a 'packages' directory under <redboot_folder>/src/ecos if it is done correctly. $ tar xjvf ecos-trunk-080727.tar.bz2 Go to ecos subdirectory and apply the patches; $ cd ecos $ bunzip2 -c patch-redboot-200910-base.bz2 | patch -p1 The above command assumes the patch file is under the same directory as the <redboot_folder>/src/ecos. Specify the path name for the patch file if necessary. Apply the patch for specific platform. In this case, the used patch is: patch-redboot-200834-mx3.bz2 $ patch-redboot-200910-mx3.bz2 | patch -p1 Define the ECOS_REPOSITORY. On <redboot_folder>, put the entire (absolute) path to redboot folder. I.e. ~/<redboot_folder>/src/ecos/packages $ export ECOS_REPOSITORY=<redboot_folder>/src/ecos/packages To build redboot (for i.MX31 in this example), create a new folder in order to have a clean build: $ mkdir new_redboot $ cd new_redboot $ ecosconfig new mx31_3stack redboot $ ecosconfig import $ECOS_REPOSITORY/hal/arm/mx31/3stack/current/misc/redboot_ROMRAM.ecm $ ecosconfig tree $ make This creates the Redboot image (redboot.bin) under install/bin directory. This image can run from either SDRAM or flash. Note: You can change the board MACH-TYPE at this file: src/ecos/packages/hal/arm/mx27/ads/current/cdl/hal_arm_board.cdl
View full article
The ARD has the VGA output hw multiplexed with the on board Eth controlling, on jumpers J14 and J16. If using the VGA out one option for network is to use an USB/Eth adapter. To enable this (tested on BSP 11.05 - 2.6.35): 1. Find out the driver for the adapter you are using. You can connect it to your Linux host for that. $ lsusb ... Bus 002 Device 017: ID 0b95:772a ASIX Electronics Corp. ... $ dmesg | tail ... [3799653.662846] eth2: register 'asix' at usb-0000:00:1d.7-2, ASIX AX88772 USB 2.0 Ethernet, 00:60:6e:00:02:7a ... 2. Enable the driver on the target's kernel: - ./ltib -c - On Ltib menu, select "[*] Configure the Kernel" - On the kernel menuconfig select the driver, in this case: CONFIG_USB_NET_AX8817X located at: -> Device Drivers                                                       -> Network device support (NETDEVICES [=y])         -> USB Network Adapters             -> Multi-purpose USB Networking Framework (USB_USBNET [=y]) 3. Program the kernel to SD: sudo dd if=rootfs/boot/uImage of=/dev/sdd bs=512 seek=2k 4. Set U-boot to load the kernel from the SD and NFS: MX53-ARD-DDR3 U-Boot > set bootcmd 'run bootcmd_sd_nfs' MX53-ARD-DDR3 U-Boot > set bootcmd_sd_nfs 'run bootargs_nfs;run load_kernel;bootm' MX53-ARD-DDR3 U-Boot > set load_kernel 'mmc read 0 ${loadaddr} 0x800 0x1f00' Here you may change the ip from "dhcp" to a fixed address if you are connected directly to host. MX53-ARD-DDR3 U-Boot > set bootargs_nfs 'set bootargs console=ttymxc0,115200 root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp' MX53-ARD-DDR3 U-Boot > set serverip 192.168.2.100 MX53-ARD-DDR3 U-Boot > set nfsroot '/tftpboot/rootfs_ard' MX53-ARD-DDR3 U-Boot > save Saving Environment to MMC... Writing to MMC(0)... done 5. Connect the USB/Eth adapter to the USB port (USB1-J30 or USB2-J31). Instructions to setup the host for NFS can be found on the following page: All Boards NFS.
View full article
NOTE: Always de-power the target board and the aggregator when plugging or unplugging smart sensors from the aggregator. NOTE: See this link to instrument a board with a Smart Sensor. This page documents the triple-range "smart" current sensor that's part of a larger system for profiling power on application boards. The smart sensor features a Kinetis KL05Z with three current sense amplifiers. It allows measurement currents in three ranges. Four assembly options allow measurement of rail voltages 0-3.3V (two overall current ranges), 0-6.6V, and 12V. It connects to an aggregator, which powers, controls and aggregates data from a number of smart sensor boards. One of the biggest improvements over the older dual-range measurement system is that the on-sensor microcontroller allows near-simultaneous measurement of all instrumented rails on a board. The dual range profiler can only make one measurement at a time.  These are intended to be used with a microncontroller board to act as a trigger and data aggregator. This aggregator could also be used to reprogram the sensors.  The series resistance added by the smart sensor when in run mode (highest current range) is under 11 milliOhms as measured with 4-point probes and a Keysight B2902B SMU.  A "power oscilloscope" can be made by triggering measurements at regular intervals and presenting the results graphically.... Schematic: Board Layout, Top: Board Layout, Bottom: Here's a photo of two with a nickel is included to show scale. The board measures about 0.5 by 1.3 inches. Connections: The smart sensor header connections are: 5V: powers the 3.3V regulator, which in turn powers everything else on the sensor board 12V: all the gates of all the switching FETs are pulled pulled up to 12V GND: ground connection SCL/TX: I2C clock line  SDA/RX:  I2C data line  SWD_CLK:  line for triggering smart sensors to make measurements RESET_B:  line for resetting the smart sensor board SWD_IO: select line for the smart sensor Theory of operation: Three shunts and current sense amplifiers are used to measure current in three ranges. One shunt/sense amp pair has a 0.002 Ω shunt integrated into the IC package (U1, INA250). The other two sense amps (U2 and U3, INA212) require an external shunt.  FETs Q1, Q2,  and Q3 are used to switch the two lower range shunt/sense amp pairs in and out of circuit. In normal run operation (highest current range), Q1 (FDMC012N03, with Rds(on) under 1.5m Ω ) is turned on, which shorts leaves only U1 in circuit. FETs Q4, Q5 and Q6 translate the voltages to 3.3V so that GPIO on U4 (MCU KL05Z) can control them.  Rail voltage measurement is facilitated via resistors R3, R4, and R12 and Q7. Not all of these are populated in every assembly option. For measuring rail voltages 0-3.3V, R12 is populated. To measure 0-6.6V, R3, R4,and Q7 are populated. When turned on Q7 enables the voltage divider. All of the assembly option population info can be found in the schematic (attached). Regulator U5 (AP2210N) provides the 3.3V supply for all of the components on the board. This 1% tolerance regulator is used to provide a good reference for the ADC in U4.  Microcontroller U4 detects the assembly population option of the board via resistors R9, R10, and R11 so that the same application code can be used across all variations of the sensor boards. GPIO control the FETs and four ADC channels are used to measure the sense amplifier outputs and the rail voltage. Having a microcontroller on the sensor board allows the user to do extra credit things like count coulombs as well as allowing all similarly instrumented rails to measure at the same time via trigger line SWD_CLK. Data communication can be via I2C or UART, since these two pins can do both.  But if multiple sensor boards are to be used with an aggregator, communication needs to be over I2C. Application Code: The latest application code for the KL05Z on the smart sensor resides here: https://os.mbed.com/users/r14793/code/30847-SMRTSNSR-KL05Z/. The latest binary is attached below. In order to re-flash a smart sensor, the modification detailed in the aggregator page needs to be made. Once the modification is completed, leave the aggregator unpowered while pluging the SWD debugger into J5 and the smart sensor to be programmed into JP15. Very old UART-based application code for the KL05Z, built in the on-line MBED compiler (note that it requires the modified mbed library for internal oscillator). This code was used while testing the first smart sensor prototypes. It has since been abandoned. It's published here in the event that a user wants to use a single sensor plugged into JP15 with UART breakout connector J6. /****************************************************************************** * * MIT License (https://spdx.org/licenses/MIT.html) * Copyright 2017-2018 NXP * * MBED code for KL05Z-based "smart" current sensor board, basic testing * of functions via UART (connected via FRDM board and OpenSDA USB virtual * COM port). * * Eventual goal is to have each smart sensor communicate over I2C to an * aggregator board (FRDM board with a custom shield), allowing 1-10 power * supply rails to be instrumented. Extra credit effort is to support * sensors and aggregator with sigrok... * * Because there is no crystal on the board, need to edit source mbed-dev library * to use internal oscillator with pound-define: * change to "#define CLOCK_SETUP 0" in file: * mbed-dev/targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL05Z/device/system_MKL05Z4.c * ******************************************************************************/ #include "mbed.h" // These will be GPIO for programming I2C address... // not yet implemented, using as test pins... DigitalOut addr0 ( PTA3 ) ; DigitalOut addr1 ( PTA4 ) ; DigitalOut addr2 ( PTA5 ) ; DigitalOut addr3 ( PTA6 ) ; // configure pins for measurements... // analog inputs from sense amps and rail voltage divider... AnalogIn HIGH_ADC ( PTB10 ) ; AnalogIn VRAIL_ADC ( PTB11 ) ; AnalogIn LOW1_ADC ( PTA9 ) ; AnalogIn LOW2_ADC ( PTA8 ) ; // outputs which control switching FETs... DigitalOut VRAIL_MEAS ( PTA7 ) ; // turns on Q7, connecting voltage divider DigitalOut LOW_ENABLE ( PTB0 ) ; // turns on Q4, turning off Q1, enabling low measurement DigitalOut LOW1 ( PTB2 ) ; // turns on Q5, turning off Q2, disconnecting shunt R1 DigitalOut LOW2 ( PTB1 ) ; // turns on Q6, turning off Q3, disconnecting shunt R2 // input used for triggering measurement... // will eventually need to be set up as an interrupt so it minimizes delay before measurement InterruptIn trigger ( PTA0 ) ; // use as a trigger to make measurement... // PTB3/4 can be used as UART or I2C... // For easier development with one smart sensor, we are using UART here... Serial uart ( PTB3 , PTB4 ) ; // tx, rx long int count = 0 ; int n = 25 ; // global number of averages for each measurement int i , temp ; bool repeat = true ; // flag indicating whether measurements should repeat or not const float vref = 3.3 ; // set vref for use in calculations... float delay = 0.25 ; // default delay between measurement bool gui = false ; // flag for controlling human vs machine readable output bool statistics = false ; // flag for outputting min and max along with average (GUI mode only) void enableHighRange ( ) { LOW_ENABLE = 0 ; // short both low current shunts, close Q1 wait_us ( 5 ) ; // delay for FET to settle... (make before break) LOW1 = 0 ; LOW2 = 0 ; // connect both shunts to make lower series resistance VRAIL_MEAS = 0 ; // disconnect rail voltage divider wait_us ( 250 ) ; // wait for B2902A settling... } void enableLow1Range ( ) { LOW1 = 0 ; LOW2 = 1 ; // disconnect LOW2 shunt so LOW1 can measure wait_us ( 5 ) ; // delay for FET to settle... (make before break) LOW_ENABLE = 1 ; // unshort low current shunts, open Q1 VRAIL_MEAS = 0 ; // disconnect rail voltage divider wait_us ( 250 ) ; // wait for B2902A settling... } void enableLow2Range ( ) { LOW1 = 1 ; LOW2 = 0 ; // disconnect LOW1 shunt so LOW2 can measure wait_us ( 5 ) ; // delay for FET to settle... (make before break) LOW_ENABLE = 1 ; // unshort low current shunts, open Q1 VRAIL_MEAS = 0 ; // disconnect rail voltage divider wait_us ( 500 ) ; // wait for B2902A settling... } void enableRailV ( ) { VRAIL_MEAS = 1 ; // turn on Q7, to enable R3-R4 voltage divider wait_us ( 125 ) ; // wait for divider to settle... // Compensation cap can be used to make // voltage at ADC a "square wave" but it is // rail voltage and FET dependent. Cap will // need tuning if this wait time is to be // removed/reduced. // // So, as it turns out, this settling time and // compensation capacitance are voltage dependent // because of the depletion region changes in the // FET. Reminiscent of grad school and DLTS. // Gotta love device physics... } void disableRailV ( ) { VRAIL_MEAS = 0 ; // turn off Q7, disabling R3-R4 voltage divider } // this function measures current, autoranging as necessary // to get the best measurement... void measureAuto ( ) { Timer t ; float itemp ; float tempI = 0 ; float imin = 1.0 ; // used to keep track of the minimum... float imax = 0 ; // used to keep track of the maximum... t . start ( ) ; // use timer to see how long things take... enableHighRange ( ) ; // this should already be the case, but do it anyway... for ( i = 0 ; i < n ; i ++ ) { itemp = HIGH_ADC ; // read HIGH range sense amp output if ( statistics && itemp > imax ) imax = itemp ; // update max if necessary if ( statistics && itemp < imin ) imin = itemp ; // update min if necessary tempI + = itemp ; // add current sample to running sum } tempI = tempI / n * vref / 0.8 ; // compute average we just took... if ( gui ) uart . printf ( "=> %5.3f " , tempI ) ; if ( statistics && gui ) uart . printf ( "[%5.3f/%5.3f] " , imin * vref / 0.8 , imax * vref / 0.8 ) ; // if current is below this threshold, use LOW1 to measure... if ( tempI < 0.060 ) { if ( ! gui ) uart . printf ( "... too Low: %f A, switching to low1 ==>\r\n" , tempI ) ; tempI = 0 ; enableLow1Range ( ) ; // change FETs to enable LOW1 measurement... imin = 1.0 ; imax = 0 ; for ( i = 0 ; i < n ; i ++ ) { itemp = LOW1_ADC ; // read LOW1 sense amp output if ( statistics && itemp > imax ) imax = itemp ; // update max if necessary if ( statistics && itemp < imin ) imin = itemp ; // update min if necessary tempI + = itemp ; // add current sample to running sum } tempI = tempI / n * vref / 0.05 / 1000 ; // compute average we just took... if ( gui ) uart . printf ( "%6.4f " , tempI ) ; if ( statistics && gui ) uart . printf ( "[%6.4f/%6.4f] " , imin * vref / 0.05 / 1000 , imax * vref / 0.05 / 1000 ) ; // if current is below this threshold, use LOW2 to measure... if ( tempI < 0.0009 ) { if ( ! gui ) uart . printf ( "... too Low: %f A, switching to low2 ==>\r\n" , tempI ) ; tempI = 0 ; enableLow2Range ( ) ; // change FETs to enable LOW1 measurement... imin = 1.0 ; imax = 0 ; for ( i = 0 ; i < n ; i ++ ) { itemp = LOW2_ADC ; // read LOW2 sense amp output if ( statistics && itemp > imax ) imax = itemp ; // update max if necessary if ( statistics && itemp < imin ) imin = itemp ; // update min if necessary tempI + = itemp ; // add current sample to running sum } tempI = tempI / n * vref / 2 / 1000 ; // compute average we just took... if ( gui ) uart . printf ( "%8.6f " , tempI ) ; if ( statistics && gui ) uart . printf ( "[%8.6f/%8.6f] " , imin * vref / 2 / 1000 , imax * vref / 2 / 1000 ) ; } } t . stop ( ) ; // stop the timer to see how long it took do do this... enableHighRange ( ) ; if ( ! gui ) uart . printf ( "\r\nCurrent = %f A Current Measure Time = %f sec\r\n" , tempI , t . read ( ) ) ; } // the autoranging should really be done with functions that return values, as should the // functions below... This would make for shorter and more elegant code, but the author // is a bit of a pasta programmer... void measureHigh ( ) { float highI = 0 ; enableHighRange ( ) ; for ( i = 0 ; i < n ; i ++ ) { highI + = HIGH_ADC ; } highI = highI / n ; uart . printf ( "HIghI = %f A\r\n" , vref * highI / 0.8 ) ; } void measureLow1 ( ) { float low1I = 0 ; enableLow1Range ( ) ; for ( i = 0 ; i < n ; i ++ ) { low1I + = LOW1_ADC ; } enableHighRange ( ) ; low1I = low1I / n ; uart . printf ( "low1I = %f A\r\n" , vref * low1I / 0.05 / 1000 ) ; } void measureLow2 ( ) { float low2I = 0 ; enableLow2Range ( ) ; for ( i = 0 ; i < n ; i ++ ) { low2I + = LOW2_ADC ; } enableHighRange ( ) ; low2I = low2I / n ; uart . printf ( "low2I = %f A\r\n" , vref * low2I / 2 / 1000 ) ; } // measure the rail voltage, default being with // a divide by 2 resistor divider // It has to be switched out when not in use or it will // add to the measured current, at least in the low ranges... void measureRailV ( ) { float railv = 0 ; float mult = vref * 2 ; // since divide by 2, we can measure up to 6.6V... float vmin = 5 ; float vmax = 0 ; float vtemp ; enableRailV ( ) ; // switch FETs so divider is connected... for ( i = 0 ; i < n ; i ++ ) { vtemp = VRAIL_ADC ; // read voltage at divider output... if ( statistics && vtemp > vmax ) vmax = vtemp ; // update max if necessary if ( statistics && vtemp < vmin ) vmin = vtemp ; // update min if necessary railv + = vtemp ; // add current sample to running sum } disableRailV ( ) ; // now disconnect the voltage divider railv = railv / n ; // compute average (note this is in normalized ADC [0..1]) // Convert to voltage by multiplying by "mult" if ( ! gui ) uart . printf ( "RailV = %5.3f V " , mult * railv ) ; if ( gui ) uart . printf ( "%5.3f " , mult * railv ) ; if ( statistics && gui ) uart . printf ( "[%5.3f/%5.3f] " , mult * vmin , mult * vmax ) ; uart . printf ( "\r\n" ) ; } // not sure how useful this function is... void measureAll ( ) { measureHigh ( ) ; measureLow1 ( ) ; measureLow2 ( ) ; measureRailV ( ) ; } // test function to see if trigger pin is being hit... // intended for use later to do timed triggering of measurements... void triggerIn ( ) { uart . printf ( "You're triggering me! \r\n" ) ; measureAll ( ) ; } // main... int main ( ) { // set up basic conditions... Timer m ; uart . baud ( 115200 ) ; enableHighRange ( ) ; // default state - only HIGH sense amp in circuit, no divider // signal that we're alive... uart . printf ( "Hello World!\r\n" ) ; // configure the trigger interrupt... trigger . rise ( & triggerIn ) ; while ( true ) { count ++ ; wait ( delay ) ; if ( repeat ) { // if repeat flag is set, keep making measurements... m . reset ( ) ; // reset and start timer... m . start ( ) ; measureAuto ( ) ; // measuring current using auto-ranging... measureRailV ( ) ; // measure rail voltage... m . stop ( ) ; // stop the timer. if ( ! gui ) uart . printf ( " Total Measure Time = %f sec" , m . read ( ) ) ; if ( ! gui ) uart . printf ( "\r\n\r\n" ) ; } // see if there are any characters in the receive buffer... // this is how we change things on the fly... // Commands (single keystroke... it's easier) // t = one shot automeasure // v = measure volt // h = one shot high measure // k = one shot LOW1 measure // l = one shot LOW2 measure (letter l) // r = toggle repeat // R = turn off repeat // + = faster repeat rate // - = slower repeat rate // = = set repeat rate to 0.25 sec // g = use human readable text output // G = use compressed text format for GUI // s = turn statistics output off // S = turn statistics output on (only in GUI mode) // n = decrease number of averages for each measurement // N = increase number of averages for each measurement // // these were for testing FET switching... // 1 = LOW_ENABLE = 0 (the number 1) // 2 = LOW1 = 0 // 3 = LOW2 = 0 // 4 = VRAIL_MEAS = 0 // ! = LOW_ENABLE = 1 // @ = LOW1 = 1 // # = LOW2 = 1 // $ = VRAIL_MEAS = 1 if ( uart . readable ( ) ) { temp = uart . getc ( ) ; if ( temp == ( int ) 't' ) { if ( ! gui ) uart . printf ( "Keyboard trigger: " ) ; measureAuto ( ) ; measureRailV ( ) ; //measureAll(); } if ( temp == ( int ) 'v' ) { uart . printf ( "Keyboard trigger: " ) ; measureRailV ( ) ; } if ( temp == ( int ) 'h' ) { uart . printf ( "Keyboard trigger: " ) ; measureHigh ( ) ; } if ( temp == ( int ) 'k' ) { uart . printf ( "Keyboard trigger: " ) ; measureLow1 ( ) ; } if ( temp == ( int ) 'l' ) { uart . printf ( "Keyboard trigger: " ) ; measureLow2 ( ) ; } if ( temp == ( int ) '1' ) { LOW_ENABLE = 0 ; uart . printf ( "Keyboard trigger: LowEnable = %d\r\n" , 0 ) ; } if ( temp == ( int ) '2' ) { LOW1 = 0 ; uart . printf ( "Keyboard trigger: LOW1 = %d\r\n" , 0 ) ; } if ( temp == ( int ) '3' ) { LOW2 = 0 ; uart . printf ( "Keyboard trigger: LOW2 = %d\r\n" , 0 ) ; } if ( temp == ( int ) '4' ) { VRAIL_MEAS = 0 ; uart . printf ( "Keyboard trigger: VRAILMEAS = %d\r\n" , 0 ) ; } if ( temp == ( int ) '!' ) { LOW_ENABLE = 1 ; uart . printf ( "Keyboard trigger: LowEnable = %d\r\n" , 1 ) ; } if ( temp == ( int ) '@' ) { LOW1 = 1 ; uart . printf ( "Keyboard trigger: LOW1 = %d\r\n" , 1 ) ; } if ( temp == ( int ) '#' ) { LOW2 = 1 ; uart . printf ( "Keyboard trigger: LOW2 = %d\r\n" , 1 ) ; } if ( temp == ( int ) '$' ) { VRAIL_MEAS = 1 ; uart . printf ( "Keyboard trigger: VRAILMEAS = %d\r\n" , 1 ) ; } if ( temp == ( int ) 'r' ) { repeat = ! repeat ; uart . printf ( "Keyboard trigger: repeat toggle: %s \r\n" , repeat ? "true" : "false" ) ; } if ( temp == ( int ) 'R' ) repeat = false ; if ( temp == ( int ) '+' ) { delay - = 0.05 ; if ( delay < 0.05 ) delay = 0.05 ; } if ( temp == ( int ) '-' ) { delay + = 0.05 ; if ( delay > 1 ) delay = 1 ; } if ( temp == ( int ) '=' ) delay = 0.25 ; if ( temp == ( int ) 'g' ) gui = false ; if ( temp == ( int ) 'G' ) gui = true ; if ( temp == ( int ) 's' ) statistics = false ; if ( temp == ( int ) 'S' ) statistics = true ; if ( temp == ( int ) 'n' ) { n - = 25 ; if ( n < 25 ) n = 25 ; } if ( temp == ( int ) 'N' ) { n + = 25 ; if ( n > 1000 ) n = 1000 ; } if ( temp == ( int ) 'N' || temp == ( int ) 'n' ) uart . printf ( "/r/n/r/n Averages = %d \r\n\r\b" , n ) ; } } } ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍
View full article
Using the FEC on U-boot 1 - Start by programming U-boot into the SD or NAND, click here for SD or here for NAND. 2 - Boot the image programed on Step 1, for the SD Card: Personality Board settings:                   12345678 SW22 -> 00000000 SW21 -> 11000000  Debug Board settings:   SW5,6,7,8,9,10 -> OFF                    12345678   SW4 -> 10000001 For NAND:                              12345678   SW22 -> 00100000   SW21 -> 10011000  Debug Board settings:   SW5,6,7,8,9,10 -> OFF                      12345678     SW4 -> 10000001 Stop at u-boot prompt: MX25 U-Boot > 3 - Configure u-boot networking variables, replace the values according to your network configuration: MX25 U-Boot > setenv serverip 192.168.1.1 MX25 U-Boot > setenv ipaddr 192.168.1.2 MX25 U-Boot > setenv eth1addr 00:04:9f:00:3b:33 Update "ethact" var to enable the FEC. MX25 U-Boot > setenv ethact FEC0 4 - With the Ethernet cable connected, start a tftp transfer: MX25 U-Boot > tftpboot 0x80800000 uImage_mx25 FEC: enable RMII gasket Using FEC0 device TFTP from server 192.168.1.1; our IP address is 192.168.1.2 Filename 'uImage_mx25'. Load address: 0x80800000 Loading: #################################################################              #################################################################              #################################################################              #################################################################              #################################################################              #################################################################              ##### done Bytes transferred = 2022396 (1edbfc hex) 5 - If you transfered the kernel image, you can boot it (Don't forget to update bootargs): MX25 U-Boot > bootm 0x80800000
View full article
Network File System (NFS) Setting the host 1 - Install NFS Service on host typing: your slackware linux probably already have a version of nfs-utils installed, but if it doesn't you can get it downloading the nfs-utils from:  [1] then as root:  #installpkg nfs-utils-1.0.7-i386-1.tgz 2 - Setup exports typing: $sudo kedit /etc/exports and add the following line: /tftpboot/ltib/ *(rw,no_root_squash,async) 3 - Reestart the NFS server: $sudo /etc/rc.d/rc.rpc restart $sudo /etc/rc.d/rc.nfsd restart Now the host is ready to use NFS. Setting Target Linux Image to use NFS 1 - Run LTIB configuration typing: $./ltib -c 2 - On first page menu, go to "Target Image Generation -> Options" as in the picture below. 3 - Select the option NFS only and exit LTIB configuration to compile with the new configuration. 4 - LTIB should start new compiling and create a new Linux image on /<ltib instalation folder>/rootfs/boot/zImage 5 - Copy the created image on /<ltib instalation folder>/rootfs/boot/zImage to /tftpboot/zImage 6 - The system is ready to run with NFS. The root file system on target will be located on host on /<ltib instalation folder>/rootfs/
View full article
You can create GTK applications manually—this is just like creating Graphics Java Applications. It uses a similar layout idea! Copy this example and save as helloworld.c: /* example-start helloworld helloworld.c */ #include <gtk/gtk.h> /* This is a callback function. The data arguments are ignored * in this example. More on callbacks below. */ void hello( GtkWidget *widget, gpointer   data ) {    g_print ("Hello World\n"); } gint delete_event( GtkWidget *widget, GdkEvent  *event,  gpointer   data ) {    /* If you return FALSE in the "delete_event" signal handler,     * GTK will emit the "destroy" signal. Returning TRUE means     * you don't want the window to be destroyed.     * This is useful for popping up 'are you sure you want to quit?'     * type dialogs. */    g_print ("delete event occurred\n");    /* Change TRUE to FALSE and the main window will be destroyed with     * a "delete_event". */    return(TRUE); } /* Another callback */ void destroy( GtkWidget *widget, gpointer   data ) {    gtk_main_quit(); } int main( int   argc, char *argv[] ) {    /* GtkWidget is the storage type for widgets */    GtkWidget *window;    GtkWidget *button;       /* This is called in all GTK applications. Arguments are parsed     * from the command line and are returned to the application. */    gtk_init(&argc, &argv);       /* create a new window */    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);       /* When the window is given the "delete_event" signal (this is given     * by the window manager, usually by the "close" option, or on the     * titlebar), we ask it to call the delete_event () function     * as defined above. The data passed to the callback     * function is NULL and is ignored in the callback function. */    gtk_signal_connect (GTK_OBJECT (window), "delete_event",                        GTK_SIGNAL_FUNC (delete_event), NULL);       /* Here we connect the "destroy" event to a signal handler.      * This event occurs when we call gtk_widget_destroy() on the window,     * or if we return FALSE in the "delete_event" callback. */    gtk_signal_connect (GTK_OBJECT (window), "destroy",                        GTK_SIGNAL_FUNC (destroy), NULL);       /* Sets the border width of the window. */    gtk_container_set_border_width (GTK_CONTAINER (window), 10);       /* Creates a new button with the label "Hello World". */    button = gtk_button_new_with_label ("Hello World");       /* When the button receives the "clicked" signal, it will call the     * function hello() passing it NULL as its argument.  The hello()     * function is defined above. */    gtk_signal_connect (GTK_OBJECT (button), "clicked",                        GTK_SIGNAL_FUNC (hello), NULL);       /* This will cause the window to be destroyed by calling     * gtk_widget_destroy(window) when "clicked".  Again, the destroy     * signal could come from here, or the window manager. */    gtk_signal_connect_object (GTK_OBJECT (button), "clicked",                               GTK_SIGNAL_FUNC (gtk_widget_destroy),                               GTK_OBJECT (window));       /* This packs the button into the window (a gtk container). */    gtk_container_add (GTK_CONTAINER (window), button);       /* The final step is to display this newly created widget. */    gtk_widget_show (button);       /* and the window */    gtk_widget_show (window);       /* All GTK applications must have a gtk_main(). Control ends here     * and waits for an event to occur (like a key press or     * mouse event). */    gtk_main ();       return(0); } /* example-end */
View full article
Setting the host          1 - Install NFS Service on host typing: your slackware linux probably already have a version of nfs"utils installed, but if it doesn't you can get it downloading the nfs-utils from:  [1] then as root:  #installpkg nfs-utils-1.0.7-i386-1.tgz 2 - Setup exports typing: $sudo kedit /etc/exports          and add the following line: /tftpboot/ltib/ *(rw,no_root_squash,async)          3 - Restart the NFS server: $sudo /etc/rc.d/rc.rpc restart $sudo /etc/rc.d/rc.nfsd restart          Now the host is ready to use NFS.      Setting Target Linux Image to use NFS          1 - Run LTIB configuration typing: $./ltib -c 2 - On first page menu, go to "Target Image Generation -> Options".                3 - Select the option NFS only and exit LTIB configuration to compile with the new configuration.          4 - LTIB should start new compiling and create a new Linux image on /<ltib instalation folder>/rootfs/boot/zImage          5 - Copy the created image on /<ltib instalation folder>/rootfs/boot/zImage to /tftpboot/zImage 6 - The system is ready to run with NFS. The root file system on target will be located on host on /<ltib instalation folder>/rootfs/                           
View full article
Video Streaming over Ethernet This section shows how to stream a video over Ethernet using UDP and RTP. Be sure to have the newest gst-plugin-good installed to ensure the best streaming quality. Define the environment variable HOST with the ip address of the receiver machine (that one that will show the video). $ export HOST=XX.XX.XX.XX Do you know how to get caps? i.MX 27 Video GST Caps H264 (MX->PC) in i.MX27: gst-launch-0.10 -v mfw_v4lsrc capture-width=640 capture-height=480 ! mfw_vpuencoder width=640 height=480  /     codec-type=std_avc ! rtph264pay ! udpsink host=$HOST port=5000 in PC: gst-launch-0.10 -v --gst-debug=2 udpsrc port=5000 /   caps ="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, /   profile-level-id=(string)42001e, sprop-parameter-sets=(string)Z0IAHqaAoD2Q, payload=(int)96, /   ssrc=(guint)3296222373, clock-base=(guint)2921390826, seqnum-base=(guint)35161" ! /   rtph264depay  ! ffdec_h264 ! autovideosink MPEG4 (MX->PC) in i.MX27 gst-launch-0.10 -v mfw_v4lsrc capture-width=352 capture-height=288 ! mfw_vpuencoder width=352 height=255 bitrate=64 codec-type=std_mpeg4 ! rtpmp4vpay send-config=true / ! udpsink host=10.29.244.32 port=5000 Set send-config to true to send configuration with the video. Ensures better deconding PC gst-launch-0.10 -v --gst-debug=2 udpsrc port=5000 caps ="application/x-rtp, media=(string)video, clock-rate=(int)90000, / encoding-name=(string)MP4V-ES, profile-level-id=(string)2, config=(string)000001b002000001b59113000001000000012000c888800f50b042414103, / payload=(int)96, ssrc=(guint)4006671474, clock-base=(guint)3714140954, seqnum-base=(guint)29742" / ! rtpmp4vdepay ! ffdec_mpeg4 ! autovideosink MPEG4 (MX->MX) Sender gst-launch-0.10 -v mfw_v4lsrc capture-width=640 capture-height=480 ! mfw_vpuencoder width=640 height=480  codec-type=std_mpeg4 ! rtpmp4vpay send-config=true ! udpsink host=$HOST port=5000 Receiver gst-launch-0.10 -v udpsrc port=5000 caps= "application/x-rtp, media=(string)video, clock-rate=(int)90000, / encoding-name=(string)MP4V-ES, profile-level-id=(string)4, config=(string)000001b004000001b59113000001000000012000c888800f514043c14103, / payload=(int)96, ssrc=(guint)907905085, clock-base=(guint)2029414707, seqnum-base=(guint)22207" ! rtpmp4vdepay ! / mfw_vpudecoder codec-type= std_mpeg4 min_latency=true ! mfw_v4lsink sync=false   Setting min_latency true gives the better latency for the streaming H264 (MX->MX) Sender gst-launch-0.10 -v mfw_v4lsrc capture-width=640 capture-height=480 ! mfw_vpuencoder width=640 height=480  codec-type=std_avc ! rtph264pay ! udpsink host=10.29.240.51 port=5000 Receiver gst-launch-0.10 -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000" ! rtph264depay ! mfw_vpudecodr codec-type=std_avc ! mfw_v4lsink sync=false
View full article
NFS After LTIB installation, follow the instructions below to configure and build Linux Image and Root File System. TIP: Type: $./ltib --help to get more information on ltib In the folder where LTIB were installed, execute the file: $./ltib It should take some minutes to complete the installation. Configure the ltib to select the options and packages to be defined and installed in Linux Image and Root File System. $./ltib -c     or     $./ltib -m config The menu configuration should appear: To configure for use the system with NFS, go to: Target Image Generation -> Target Image -> NFS Only For basic compilation, exit LTIB. It will compile and add some pre-built packages to make the target file system.
View full article
Video Unit Test The BSP provides a package that allows testing of several i.MX 31 peripherals on the PDK. The name of this package is 'imx-test'.   The name of the package may vary according to SDK release, at the time of the writing SDK 1.4 was used, on SDK 1.2 the name of a similar package was 'mxc-misc'   For more information on the imx-test package refer to the SDK 1.4 manual, imx31_Linux_RM.pdf, chapter 49 - Unit Tests. This file is available on BSP tarball Testing To test the image sensor and the display on the PDK follow the steps below: Enable imx-test and util-linux packages: $ ./ltib -c Once "ltib" finishes boot the system. On the target board: $ modprobe mxc_v4l2_capture Check if /dev/video0 was created $ ll /dev/video* lrwxrwxrwx  1 root root            6 Jan 1 20:47 /dev/video -> video0 crw-rw----     1 root root    81,   0 Jan 1 20:47 /dev/video0 crw-rw----     1 root root    81, 16 Jan 1 20:46 /dev/video16 Now run the unit tests: $./mxc_v4l2_overlay.out -iw 640 -ih 480 -ow 480 -oh 640 -r 4 -fr 30 -t 10 - capture images with the sensor and display on the LCD $./mxc_v4l2_capture.out -w 640 -h 480 -r 0 -c 150 -fr 30 test3.yuv - capture images and save on /unit-tests/test3.yuv $./mxc_v4l2_output.out -iw 640 -ih 480 -ow 480 -oh 640 -d 4 -fr 60 test3.yuv - capture images and save on /unit-tests/test3.yuv   For usage syntax type: command -help. ./mxc_v4l2_output.out -help Source Code If you want to check the source code, on the host machine "ltib" install path type: $./ltib -m prep -p imx-tests Then, go to <ltib install path>/rpm/BUILD/imx-test-2.3.2/test/mxc_v4l2_test
View full article
This steps are basically the same used to boot Linux mainline on i.MX 31 ADS, just replacing Network Driver cs89x0 by i.MX 27 internal FEC. Download Linux kernel 2.6.30: $ wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.bz2 Extract this: $ tar jxvf linux-2.6.30.tar.bz2 Export CROSS_COMPILE environmet: $ export PATH="$PATH:/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/" $ export CROSS_COMPILE=arm-none-linux-gnueabi- Unselect all no essentials features: $ make ARCH=arm allnoconfig Start the configuration menu: $ make ARCH=arm menuconfig Change/Select the kernel options below. Select the MXC/iMX platform and iMX27ADS board: System Type ->             ARM system type -> (X) Freescale MXC/iMX-based             Freescale MXC Implementations  ->                            MXC/iMX Base Type -> (X) MX2-based                            MX2 Options  -> [*] Support MX27ADS platforms (NEW) Select ARM EABI standard to compile the kernel: Kernel Features  --->           [*] Use the ARM EABI to compile the kernel Add support to Linux Binary Format ELF: Userspace binary formats ->              [*] Kernel support for ELF binaries Add support to Network (TCP/IP): [*] Networking support  ->          Networking options  ->                           [*] Packet socket                           [*] Unix domain sockets                           [*] PF_KEY sockets                           [*] TCP/IP networking                                    [*] IP: kernel level autoconfiguration                                    [*]     IP: DHCP support Select network driver (FEC), serial driver and unselect VGA console: Device Drivers  ->                      [*] Network device support  --->                                       [*]   Ethernet (10 or 100Mbit)  --->                                              [*]   FEC ethernet controller (of ColdFire CPUs)                      Character devices  ->                              Serial drivers  --->                                       [*] IMX serial port support                                       [*]   Console on IMX serial port                      Graphics support  ->                              Console display driver support  --->                                         [ ] VGA text console Add support to NFS and support to use it as root file system: File systems  ->                           [*] Network File Systems (NEW)  ->                                    [*]   NFS client support                                    [*]     Root file system on NFS Compile the kernel: $ make ARCH=arm Copy the created zImage to tftp directory: $ cp arch/arm/boot/zImage /tftpboot/ Configure your RedBoot to boots with this kernel: load -r -b 0x100000 /tftpboot/zImage exec -b 0x100000 -l 0x200000 -c "noinitrd console=ttymxc0,115200 root=/dev/nfs nfsroot=10.29.240.191:/tftpboot/rootfs ip=dhcp" Change the default network device on RedBoot to internal FEC: Default network device: mxc_fec Connect the network cable on FEC connector (connector T3). Notes: We are using rootfs from LTIB then select to get parameters from DHCP: "Target System Configuration" Options  --->               [*] start networking                      Network setup  --->                            [*]   get network parameters using dhcp
View full article
This is a simple document  explaining the basics of creating a new layer within a Yocto BSP. We will be using the latest i.MX6 Linux BSP as reference, but the same logics apply to any Yocto Project BSP including the Community BSP. If you are new to Yocto it is recommended to go through the following very informative Training which is focused on the FSL Community BSP but covers the basics of Yocto step-by-step in a very clear and concise manner. Yocto Training - HOME Requirements - L4.1.15 BSP Release for the i.MX6 family of processors installed on the host. For more information on requirements for the Host please refer to the Yocto User’s Guide available as part of the Linux BSP Document Bundle (available on the link below) http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-applications-processors/embedded-linux-for-i.mx-applications-processors:IMXLINUX?code=IMXLINUX -tree tool for the host, to see the directory format of the different layers. You may install it with the following command: sudo apt-get install tree - We will work with the bitbake environment so this needs to be initialized in our terminal. Introduction to layers in Yocto Layers in Yocto allow us to organize the long list of providers and to easily customize for our target hardware while reusing a lot of tools already available. It also makes it easy to distribute our customizable source code trough a unique layer. Once your environment is setup you can see the layers that compose the BSP using the command: bitbake-layers show-layers The layers that constitute out BSP will be displayed along with the path and priority of each. Layer Priority: Each layer has a priority, which is used by bitbake to decide which layer takes precedence if there are recipe files with the same name in multiple layers. A higher numeric value represents a higher priority. We can see that the poky and open embedded layers have a lower priority than those than the BSP and SDK layers as the later sit on top of the former. The general layout of a BSP is shown on the image below. If you would like to have a better look at the distinctive Layers that make up the Yocto BSP Release and the FSL Community Release please look at the Yocto Project Layers Mind Map available on the following link: YOCTO PROJECT LAYERS MIND MAP Adding an empty layer and a new recipe There are a couple of scripts available as part of the Open embedded tools that allows for easy creation of a new layer and recipe. Layers are basically a group of directories and meta data in configuration and recipe files (which contains metadata as text), so you may create these directories and meta data files by hand. However, it’s always easier to use the new layer script in order to create the required structure and then fill in with our customized configuration. cd <BSP_DIR>/sources ./poky/scripts/yocto-layer create <NEW_LAYER_NAME> We’ll name the new layer “new-layer” as shown below: ./poky/scripts/yocto-layer create new-layer We’ll be asked to enter le layer priority, we’ll keep the default 6 but you may want a higher priority depending on your application. You may opt for an example recipe to be created on your new layer.  We’ll leave this example recipe with the default settings. You may see the structure of the new layer by using the following command: tree -L 4 ./meta-new-layer Basic requirements of a layer - It is not a must but it’s strongly recommended to have the name of the layer start with “meta-“, the Poky new layer script uses this naming convention. - A README with information regarding what’s contained in the layer and any dependencies - A COPYING file with the copyright and use notice for the hardware in the new layer. - A conf folder which contains the layer’s configuration (.conf) files. Adding the layer to our BSP Once the layer has been created it’s necessary to add it to the list of Layers that make up the BSP so Bitbake can locate it and parse the metadata contained within it, in other words, you must make the build system aware of your new layer. In order to enable your layer you need to add the layer’s path to the BBLAYERS variable in the conf/bblayers.conf file which is found on the build directory. Please note that you will need to add your layer to each build directory in which you want to use it. We can add the following line to add our new layer. BBLAYERS += " ${BSPDIR}/sources/meta-new-layer " After doing so we’ll see that our layer is now listed when we run show-layers in bitbake-layers. bitbake-layers show-layers Adding a new recipe The new layer script also creates a basic recipe. It is recommended to look for recipes similar to what we need and use them as a template or starting point, as part of the benefits of Yocto is to be able to reuse a lot of open sourced code and resources. If there are many versions of the same recipe the default behavior is to use the recipe contained in the highest priority layer even if it’s not the higher version of the recipe. If you would want to force bitbake to use a certain version you may use the following variable on the local.conf file. PREFERRED_VERSION_recipename Main requirements of a recipe: SRC_URI which points to the location of the source code SRC_REV if applicable it would correspond to a particular commit or branch from the source code repository LICENSE a variable that defines the type of license to bitbake LIC_FILES_CHKSUM should point to a file within the source tree that corresponds to the md5 check-sum of the license file so it can be verified. Adding an append to a recipe You may also select the option to have the script create an append file. The append files allow us to change an existing recipe. The name of the file must be the same as the original recipe plus the append suffix (.bbappend) and should be located on the same path as the original recipe but in our own layer. The append file can be described as a piece of code or metadata that is added to the end of the original recipe. If there are more than one append files for a particular recipe all of them will be joined in reverse priority, that is, the highest priority layer’s bbappend will be added last. Appendix. Useful References FSL Community BSP Yocto Training - HOME Yocto Project Board Support Package Developer's Guide
View full article
This example is useful  if you have your device connected to a host machine using a USB cable, and you want your host machine to be able to update your device using a protocol ready to go. Information you need prior to using this example Fastboot is a protocol used to update firmware in Android devices from a host over USB; Freescale implements fastboot as a uboot driver for the device and the implementation is available from patches applied to uboot source code; By default, fastboot is only enabled when building uboot to use with an Android BSP; To run fastboot at the device in default implementation you need to call it from uboot command line (using the debug serial port of the slave device, for example); The host fastboot application is available as source code from Google. You can build your own fastboot(.exe) binary (which is not in the scope of this howto), or you can find a binary ready for you to go searching the web; You are required to be familiar with Linux BSP and have i.MX53 BSP version 11.05 installed. With this information in mind, what do you get from this example? Patch for uboot to enable fastboot driver for iMX53 Quick Start Board with a new spec file; A command line application that set a flag in iMX53 to automatically start fastboot after a reset, either if it is a SOFT or a HARD reset. How to prepare the example Copy uboot patch file (attached) to /opt/freescale/pkgs; Replace your uboot spec file (u-boot.spec.in attached) in <bsp_root>/ltib/config/platform/imx/; Build a system image for iMX53 Quick Start Board with the packages you need; Build the command line application (setbootmode.c attached) using ltib shell; Prepare an SD card copy the command line application /usr/sbin in your SD card system partition. See attachment to this page. How to test the example Boot the Quick Start Board with the SD card you prepared; Login as root using a serial cable and a terminal application; Run setbootmode application as follows: $ setbootmode 1 Reboot the system: $ reboot After rebooting, the device will automatically run fastboot from uboot and will wait for a connection from the host machine. You can test the connection using a fastboot binary at the host machine (not provided here). Even if you HARD reset your hardware, your device will keep running fastboot at startup. If you want to go back to a regular boot operation, you need to cut power supply to your board. How does the magic happen? The setbootmode application sets the LSB in the Low Power General Register (LPGR) of the Secure Real Time Clock (SRTC) module to true. The patched version o uboot tests for this bit as a flag to run fastboot or not. The magic is that the LPGR is persistent, even during reset. Additional tips You can run setbootmode with no arguments to see its options; You need to set the boot mode to 0 after a successful update to avoid entering fastboot mode again after a new reboot; Partitioning of the device seen by fastboot is not implemented; Besides using setbootmode, you can read/set LPGR using either md.l / nm.l in uboot or devmem2 at command line: uboot-> md.l 0x53fa401c 1 - displays LPGR; uboot-> nm.l 0x53fa401c - presents a prompt for you to change LPGR; linux shell-> devmem2 0x53fa401c w - displays LPGR; linux shell-> devmem2 0x53fa401c w <value> - changes LPGR; devmem2 has issues that you need to fix so that you can use it to change LPGR: include "volatile" in all writing instruction; uncomment 'w' write instruction.
View full article
Check new updated version for with Morty here Step 1 : Get iMX Yocto AVS setup environment Review the steps under Chapter 3 of the   i.MX_Yocto_Project_User'sGuide.pdf   on the   L4.X LINUX_DOCS   to prepare your host machine. Including at least the following essential Yocto packages $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \   gcc-multilib build-essential chrpath socat libsdl1.2-dev u-boot-tools Install the i.MX NXP AVS repo Create/Move to a directory where you want to install the AVS yocto build enviroment. Let's call this as <yocto_dir> $ cd <yocto_dir> $ repo init -u https://source.codeaurora.org/external/imxsupport/meta-avs-demos -b master -m imx7d-pico-avs-sdk_4.1.15-1.0.0.xml Download the AVS BSP build environment: $ repo sync Step 2: Setup yocto for Alexa_SDK image with AVS-SETUP-DEMO script: Run the avs-setup-demo script as follows to setup your environment for the imx7d-pico board: $ MACHINE=imx7d-pico DISTRO=fsl-imx-x11 source avs-setup-demo.sh -b <build_sdk> Where <build_sdk> is the name you will give to your build folder. After acepting the EULA the script will prompt if you want to enable: Sound Card selection The following Sound Cards are supported on the build: SGTL (In-board Audio Codec for PicoPi) 2-Mic Conexant The script will prompt if you are going to use the Conexant Card. If not then SGTL will be assumed as your selection Are you going to use Conexant Sound Card [Y/N]? Install Alexa SDK Next option is to select if you want to pre-install the AVS SDK software on the image. Do you want to build/include the AVS_SDK package on this image(Y/N)? If you select   YES, then your image will contain the AVS SDK ready to use (after authentication). Note this AVS_SDK will not have WakeWord detection support, but it can be added on runtime. If your selection was   NO, then you can always manually fetch and build the AVS_SDK on runtime. All the packages dependencies will be already there, so only fetching the AVS_SDK source code and building it is required. Finish avs-image configuration At the end you will see a text according with the configuration you select for your image build. Next is an example for a Preinstalled AVS_SDK with Conxant Sound Card support and WiFi/BT not enabled. ==========================================================   AVS configuration is now ready at conf/local.conf             - Sound Card = Conexant                                     - AVS_SDK pre-installed                                       You are ready to bitbake your AVS demo image now:               bitbake avs-image                                        ========================================================== Step 3: Build the AVS image Go to your <build_sdk> directory and start the build of the avs-image There are 2 options Regular Build: $ cd <yocto_dir>/<build_sdk> $ bitbake avs-image With QT5 support included: $ cd <yocto_dir>/<build_sdk> $ bitbake avs-image-qt5 The image with QT5 is useful if you want to add some GUI for example to render DisplayCards. Step 4 : Deploying the built images to SD/MMC card to boot on target board. After a build has succesfully completed, the created image resides at <build_sdk>/tmp/deploy/images/imx7d-pico/ In this directory, you will find the   imx7d-pico-avs.sdcard   image or   imx7d-pico-avs-qt5.sdcard, depending on the build you chose on Step3. To Flash the .sdcard image into the eMMC device of your PicoPi board follow the next steps: Download the   bootbomb flasher Follow the instruction on   Section 4. Board Reflashing   of the   Quick Start Guide for AVS kit   to setup your board on flashing mode. Copy the built SDCARD file $ sudo dd if=imx7d-pico-avs.sdcard of=/dev/sd bs=1M && sync $ sync Properly eject the pico-imx7d board: $ sudo eject /dev/sd NXP Documentation Refer to the   Quick Start Quide for AVS SDK   to fully setup your PicoPi board with Synaptics 2Mic and PicoPi i.mx7D For a more comprehensive understanding of Yocto, its features and setup; more image build and deployment options and customization, please take a look at the   i.MX_Yocto_Project_User's_Guide.pdf   document from the Linux documents bundle mentioned at the beginning of this document. For a more detailed description of the Linux BSP, u-boot use and configuration, please take a look at the   i.MX_Linux_User's_Guide.pdf   document from the Linux documents bundle mentioned at the beginning of this document.
View full article