i.MX处理器知识库

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

i.MX Processors Knowledge Base

讨论

排序依据:
Ubuntu distro uses dash instead of bash as shell, then change it to bash: # cd /bin # sudo rm sh # sudo ln -s bash sh Install all necessary packages by typing: sudo apt-get install patch g++ rpm zlib1g-dev m4 bison libncurses5-dev libglib2.0-dev gettext \ build-essential tcl intltool libxml2-dev liborbit2-dev libx11-dev ccache flex uuid-dev liblzo2-dev If under Ubuntu 64bit, install ia32-libs package: sudo apt-get install ia32-libs If you will install Xorg in your ltib, you will need to install this package: sudo apt-get install x11proto-core-dev If you will install gtk+ in your ltib, you will need to install the following packages: sudo apt-get install libdbus-glib-1-dev libgtk2.0-dev libdbus-glib-1-dev Configure visudo file, as root using the command "/usr/sbin/visudo", and add the following line in the User privilege section: username ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm Where username is your user name, the name you use to do logon in your system. Classic Error messages and solutions under Ubuntu Can't exec "mconf": No such file or directory at /home/tic/ltib/bin/Ltibutils.pm line 972. exec: mconf /home/tic/ltib/config/main.lkc: No such file or directory at /home/tic/ltib/bin/Ltibutils.pm line 972. traceback:   Ltibutils::system_nb:972   main::get_plat_dir:2947     main:548 Started: Tue Feb 16 18:01:38 2010 Ended:  Tue Feb 16 18:59:26 2010 Elapsed: 3468 seconds Build Failed Solution: edit the ltib script line 925:                   # install the new package           $cmd  = "$cf->{sudo} $cf->{rpm} ";           $cmd .= "--root $cf->{rpmroot} ";           $cmd .= "--dbpath $cf->{rpmdb} ";           $cmd .= "--prefix $cf->{rpmipfx} " if $cf->{rpmipfx};           $cmd .= "--ignorearch -ivh ";           $cmd .= "--force "  unless $cf->{conflicts} || $cf->{hostinst};           $cmd .= "--replacepkgs --replacefiles " if $cf->{hostinst};           $cmd .= "--nodeps " if $cf->{nodeps};           $cmd .= "--excludedocs "; +        $cmd .= "--force-debian " if $rpm =~ m/rpm-fs/ && `uname -a` =~ m/ubuntu/i;           $cmd .= "--define '_tmppath $cf->{tmppath}' ";           $cmd .= "$rpm"; error: cannot open Name index using db3 - No such file or directory (2) error: cannot open Name index using db3 - No such file or directory (2) sudo rpm --root / --dbpath /tmp/rpm-tic/rpmdb -e --allmatches --nodeps --define '_tmppath /home/tic/ltib/tmp' rpm-fs 2>/dev/null sudo rpm --root / --dbpath /tmp/rpm-tic/rpmdb --ignorearch -ivh --force --nodeps --excludedocs --define '_tmppath /home/tic/ltib/tmp'  /tmp/rpm-tic/RPMS/i686/rpm-fs-4.0.4-1.i686.rpm rpm: please use alien to install rpm packages on Debian, if you are really sure use --force-debian switch. See README.Debian for more details. sudo /opt/freescale/ltib/usr/bin/rpm --root / --dbpath /opt/freescale/ltib/var/lib/rpm -Uv --justdb --notriggers --noscripts --nodeps  /tmp/rpm-tic/RPMS/i686/rpm-fs-4.0.4-1.i686.rpm sudo: /opt/freescale/ltib/usr/bin/rpm: command not found mkdir: cannot create directory `/opt/freescale': Permission denied Cannot create the download directory:   /opt/freescale/pkgs Either change to a global directory you have write permissions to, or create it as root.  Please set the permissions to 777 traceback:   main::check_dirs:2469   main::host_checks:1426     main:542 Started: Wed Nov 25 01:56:53 2009 Ended:  Wed Nov 25 02:07:42 2009 Elapsed: 649 seconds Build Failed solution : sudo chmod 777 /opt make[1]: Entering directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8' Making all in tools make[2]: Entering directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8/tools' make[2]: *** No rule to make target `all'.  Stop. make[2]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8' make: *** [all] Error 2 error: Bad exit status from /home/tic/ltib/tmp/rpm-tmp.U8vEdX (%build) RPM build errors:     Bad exit status from /home/tic/ltib/tmp/rpm-tmp.U8vEdX (%build) Build time for texinfo: 55 seconds Failed building texinfo Died at ./ltib line 1380. traceback:   main::build_host_rpms:1380   main::host_checks:1435     main:542 Started: Wed Nov 25 20:10:43 2009 Ended:  Wed Nov 25 20:31:42 2009 Elapsed: 1259 seconds These packages failed to build: texinfo Build Failed solution : install ccache package in host + cd /opt/freescale/ltib/usr/src/rpm/BUILD + cd lkc-1.4 + make -j1 conf mconf gcc -O0 -Wall -g -fPIC -c conf.c -o conf.o bison -l -b zconf -p zconf zconf.y flex -L -Pzconf zconf.l make: flex: Command not found make: *** [lex.zconf.c] Error 127 error: Bad exit status from /home/tic/ltib/tmp/rpm-tmp.010CjL (%build) RPM build errors:     Bad exit status from /home/tic/ltib/tmp/rpm-tmp.010CjL (%build) Build time for lkc: 2 seconds Failed building lkc Died at ./ltib line 1380. traceback:   main::build_host_rpms:1380   main::host_checks:1435     main:542 Started: Thu Nov 26 00:33:46 2009 Ended:  Thu Nov 26 01:19:39 2009 Elapsed: 2753 seconds These packages failed to build: lkc Build Failed solution : install flex package in host Making all in po make[2]: Entering directory `/home/tic/ltib/rpm/BUILD/alsa-utils-1.0.11rc2/alsaconf/po' mv: cannot stat `t-ja.gmo': No such file or directory make[2]: *** [ja.gmo] Error 1 make[2]: *** Waiting for unfinished jobs.... mv: cannot stat `t-ru.gmo': No such file or directory make[2]: *** [ru.gmo] Error 1 make[2]: Leaving directory `/home/tic/ltib/rpm/BUILD/alsa-utils-1.0.11rc2/alsaconf/po' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/tic/ltib/rpm/BUILD/alsa-utils-1.0.11rc2/alsaconf' make: *** [all-recursive] Error 1 error: Bad exit status from /home/tic/ltib/tmp/rpm-tmp.93730 (%build) RPM build errors:     Bad exit status from /home/tic/ltib/tmp/rpm-tmp.93730 (%build) Build time for alsa-utils: 84 seconds Failed building alsa-utils f_buildrpms() returned an error, exiting traceback:   main:560 Started: Sat Nov 28 07:39:40 2009 Ended:  Sat Nov 28 08:17:18 2009 Elapsed: 2258 seconds These packages failed to build: alsa-utils Build Failed Exiting on error or interrupt solution : install package gettext and ja-trans checking for glib-genmarshal... no configure: error: Could not find a glib-genmarshal in your PATH error: Bad exit status from /home/tic/ltib/tmp/rpm-tmp.13030 (%build) RPM build errors:     Bad exit status from /home/tic/ltib/tmp/rpm-tmp.13030 (%build) Build time for glib2: 107 seconds Failed building glib2 f_buildrpms() returned an error, exiting traceback:   main:560 Started: Sat Dec  5 03:19:36 2009 Ended:  Sat Dec  5 03:29:46 2009 Elapsed: 610 seconds These packages failed to build: glib2 Build Failed Exiting on error or interrupt solution : install the package libglib2.0-dev
查看全文
MAX resolution 1024 x 768 Factory Details:      Long name:    Freescale: Hardware (VPU) Encoder      Class:            Codec/Encoder/Video      Description:    Encodes raw YUV 4:2:0 data to MPEG4 SP, H.264 BP or H.263 (Annex J, K (RS=0 and ASO=0) and T) elementary data;Enco des raw YUV 4:2:0, 4:2:2 horizontal, 4:2:2 vertical or 4:0:0 data into MJPEG elementary data;      Author(s):       Multimedia Team <shmmmw@freescale.com>      Rank:             primary (256) Plugin Details:      Name:                    mfw_vpuencoder      Description:            Encodes Raw YUV Data to MPEG4 SP, H.264 BP or H.263 data. For H.263 P0, the source frame rate must be 3000 0/1001 fps      Filename:               /usr/lib/gstreamer-0.10/libmfw_gst_vpu_enc.so      Version:                  2.0.2      License:                  unknown      Source module:        gst-fsl-plugin      Binary package:       Gstreamer Multimedia Plugins (Freescale)      Origin URL:              http://www.freescale.com GObject   +----GstObject         +----GstElement               +----MfwGstVPU_Enc Pad Templates:    SINK template: 'sink'       Availability: Always       Capabilities:          video/x-raw-yuv                   format: I420                   width: [ 48, 8192 ]                   height: [ 32, 8192 ]        video/x-raw-yuv                   format: YV12                   width: [ 48, 8192 ]                   height: [ 32, 8192 ]        video/x-raw-yuv                   format: NV12                   width: [ 48, 8192 ]                   height: [ 32, 8192 ]        video/x-raw-yuv                   format: Y42B                   width: [ 48, 8192 ]                   height: [ 32, 8192 ]        video/x-raw-yuv                   format: Y444                   width: [ 48, 8192 ]                   height: [ 32, 8192 ]    SRC template: 'src'        Availability: Always        Capabilities:            video/mpeg                             width: [ 48, 1280 ]                           height: [ 32, 720 ]                   mpegversion: 4                 systemstream: false            video/x-h263                             width: [ 48, 1280 ]                            height: [ 32, 720 ]            video/x-h264                             width: [ 48, 1280 ]                            height: [ 32, 720 ]            image/jpeg                             width: [ 48, 8192 ]                            height: [ 32, 8192 ] Element Flags:    no flags set Element Implementation:    Has change_state() function: 0x2b01c98c    Has custom save_thyself() function: gst_element_save_thyself    Has custom restore_thyself() function: gst_element_restore_thyself Element has no clocking capabilities. Element has no indexing capabilities. Element has no URI handling capabilities. Pads:    SRC: 'src'      Implementation:      Pad Template: 'src'    SINK: 'sink'      Implementation:        Has chainfunc(): 0x2b01de28        Has custom eventfunc(): mfw_gst_vpuenc_sink_event        Has bufferallocfunc(): mfw_gst_vpuenc_buffer_alloc      Pad Template: 'sink' Element Properties:    name                : The name of the object                          flags: readable, writable                          String. Default: null Current: "mfwgstvpu_enc0"    codec-type          : selects the codec type for encoding                          flags: readable, writable                          Enum "MfwGstVpuEncCodecs" Default: 2, "std_avc" Current: 2, "std_avc"                             (0): std_mpeg4        - STD_MPEG4                             (1): std_h263           - STD_H263                             (2): std_avc             - STD_AVC                             (7): std_mjpg           - STD_MJPG    profile             : enable time profile of the vpu encoder plug-in                          flags: readable, writable                          Boolean. Default: false Current: false    width               : width of the frame to be encoded                          flags: readable, writable                          Unsigned Integer. Range: 48 - 8192 Default: 48 Current: 0    height              : height of the frame to be encoded                          flags: readable, writable                          Unsigned Integer. Range: 32 - 8192 Default: 32 Current: 0    bitrate             : target bitrate (in kbps) at which stream is to be encoded - 0 for VBR and others for CBR                          flags: readable, writable                          Unsigned Integer. Range: 0 - 32767 Default: 0 Current: 32768    gopsize             : gets the GOP size at which stream is to be encoded                          flags: readable, writable                          Unsigned Integer. Range: 0 - 32767 Default: 30 Current: 30    qp                  : gets the quantization parameter - range is 0-51 - will be ignored for CBR (bitrate!=0)                          flags: readable, writable                          Unsigned Integer. Range: 0 - 51 Default: 15 Current: 4294967295    max-qp              : Maximum quantization parameter for CBR - range is 0-51 for H264 and 1-31 for MPEG4 - lower value brings be tter video quality but higher frame sizes                          flags: readable, writable                          Unsigned Integer. Range: 0 - 51 Default: 51 Current: 4294967295    min-qp              : Minimum quantization parameter for CBR - range is 0-51 for H264 and 1-31 for MPEG4 - lower value brings be tter video quality but higher frame sizes                          flags: readable, writable                          Unsigned Integer. Range: 0 - 51 Default: 0 Current: 4294967295    gamma               : gamma value for CBR - tells VPU the speed on changing qp - lower will cause better video quality                          flags: readable, writable                          Unsigned Integer. Range: 0 - 32768 Default: 24576 Current: 24576    intrarefresh        : 0 - Intra MB refresh is not used. Otherwise - At least N MB's in every P-frame will be encoded as intra MB 's.                          flags: readable, writable                          Unsigned Integer. Range: 0 - 3600 Default: 0 Current: 0    h263profile0        : enable encoding of H.263 profile 0 when codec-type is set to std_h263                          flags: readable, writable                          Boolean. Default: false Current: false    loopback            : disables parallelization for performance - turn off if pipeline with decoder                          flags: readable, writable                          Boolean. Default: true Current: true    intra-qp            : Quantization parameter for I frame. When this value is -1, the quantization parameter for I frames is auto matically determined by the VPU. In MPEG4/H.263 mode, the range is 1.C31; in H.264 mode, the range is from 0.C51. This is ignored for STD_MJPG                          flags: readable, writable                          Unsigned Integer. Range: 0 - 51 Default: 15 Current: 4294967295    crop-left           : The left crop value of input frame to be encoded                          flags: readable, writable                          Unsigned Integer. Range: 0 - 4294967295 Default: 0 Current: 0    crop-top            : The top crop value of input frame to be encoded                          flags: readable, writable                          Unsigned Integer. Range: 0 - 4294967295 Default: 0 Current: 0    crop-right          : The right crop value of input frame to be encoded                          flags: readable, writable                          Unsigned Integer. Range: 0 - 4294967295 Default: 0 Current: 0    crop-bottom         : The bottom crop value of input frame to be encoded                          flags: readable, writable                          Unsigned Integer. Range: 0 - 4294967295 Default: 0 Current: 0    rotation-angle      : Pre-rotation angle - should be 0, 90, 180 or 270                          flags: readable, writable                          Unsigned Integer. Range: 0 - 270 Default: 0 Current: 0    mirror-direction    : mirror direction from source image to encoded image                          flags: readable, writable                          Enum "MfwGstVpuEncMirDir" Default: 0, "none                " Current: 0, "none                "                             (0): none                     - MIRDIR_NONE                             (1): vertical mirroring     - MIRDIR_VER                             (2): horizontal mirroring - MIRDIR_HOR                             (3): both directions       - MIRDIR_HOR_VER    h264-byte-stream    : Generate H.264 byte stream format of NALU. Take effect for H.264 stream only.                          flags: readable, writable                          Boolean. Default: true Current: true
查看全文
Flashing Kernel and Root File System using RedBoot Creating an image A kernel image and a root file system can be created using All Boards LTIB or compiling the kernel and setting the correct set of files. Create a root file system image from a set of files converting the files to a jffs2 file system. For this, install the package mtd-tools. In Ubuntu type apt-get install mtd-tools For making an root file system for flash, use the jffs2 file system like: mkfs.jffs2 -r rootfs -e 0x20000 -s 0x800 –n -o rootfs.jffs2 Where rootfs/ is the original set of file for the file system and rootfs.jffs2 is the output image file. Flashing Some connections errors can be avoided by Configuring RedBoot. The process below uses TFTP to copy the files between host and target. See All Boards TFTP for detail in configurations. Copy the kernel image and the root file system image to the TFTP dir. For example, in LTIB dir, type sudo cp ./rootfs/boot/zImage /tftpboot sudo cp rootfs.jffs2 /tftpboot/ Where /tftpboot is the dir configured for TFTP The next steps are performed in a Minicom session, and happens on the board. Formatting the flash: Format the flash redboot> fis init -f Make a Bad Block Table redboot> nand scan Flashing kernel Load kernel image (zImage) using the command below. Remember to modify the host IP address: redboot> load -r -b 0x100000 /tftpboot/zImage -h 10.29.244.99 The address 0x100000 is used as a temporary location Create the kernel at the right address (0x100000, for IMX27PDK) redboot> fis create -f 0x100000 kernel Flashing root file system Load root file system image (rootfs.jffs2) to the temporary address. Remember to modify the host IP address: redboot> load -r -b 0x100000 /tftpboot/rootfs.jffs2 -h 10.29.244.99 Create the root file system in the right address (0x600000, for IMX27PDK) redboot> fis create -f 0x600000 root Testing This step can be omitted! You can now load your kernel in the flash by typing: fis load kernel To know if the root file system written in the flash was correctly saved, execute the NFS file system and mount the flash. For load the the root file system by NFS, type: exec -c "noinitrd console=ttymxc0,115200 root=nfs nfsroot=<server_ip>:<root_path_on_server> ip=dhcp" Wait the system go up, then mount the flash at /mnt. Reminde that the flash has a jffs2 file system. mount -t jffs2 /dev/mtdblock4 /mnt ls /mnt List the /mnt contents. The output must be the right file system. For testing root file system on NAND, type exec -c "noinitrd console=ttymxc0,115200 root=/dev/mtdblock4 rw rootfstype=jffs2 ip=dhcp" Modifying the initial script Reset the board and press CTRL-C. Type fc to modify the configurations and insert the initialization script. RedBoot> fc Run script at boot: true Boot script: Enter script, terminate with empty line >> fis load kernel >> exec -c "noinitrd console=ttymxc0,115200 root=/dev/mtdblock4 rw rootfstype=jffs2 ip=dhcp" >> Boot script timeout (1000ms resolution): 1 Use BOOTP for network configuration: false Gateway IP address: 10.29.241.254 Local IP address: 10.29.241.6 Local IP address mask: 255.255.254.0 Default server IP address: 10.29.244.99 Board specifics: 0 Console baud rate: 115200 Set eth0 network hardware address [MAC]: false GDB connection port: 9000 Force console for special debug messages: false Network debug at boot time: false Update RedBoot non-volatile configuration - continue (y/n)? y ... Read from 0x07ee0000-0x07eff000 at 0x00080000: . ... Erase from 0x00080000-0x000a0000: . ... Program from 0x07ee0000-0x07f00000 at 0x00080000: . RedBoot> Remember to save the configuration in the flash by typing y Reset the system. To certify that the board is loading the system from flash, remove the ethernet cable.
查看全文
When to enable CONFIG_DEBUG_LL, choose the debug port and then CONFIG_EARLY_PRINTK on i.MX6, system will hang. There is no error information there as below, Uncompressing Linux... done, booting the kernel. Booting Linux on physical CPU 0x0 Initializing cgroup subsys cpu Initializing cgroup subsys cpuacct Linux version 4.1.15-00001-gd582989-dirty (jay@jay-ubuntu) (gcc version 4.9 20 150123 (prerelease) (GCC) ) #10 SMP PREEMPT Mon Jul 17 15:08:55 CST 2017 CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache Machine model: Freescale i.MX6 Quad SABRE Smart Device Board bootconsole [earlycon0] enabled cma: Reserved 448 MiB at 0x2a000000 Memory policy: Data cache writealloc -------------- hang -----------------‍‍‍‍‍‍‍‍‍‍‍‍‍ The patch fix it on android n7.1.1_1.0.0, kernel: 4.1.15.
查看全文
Copy redboot binary to /tftpboot. In this case: redboot.bin Load binary file to i.MX RAM memory: RedBoot> load -v -r -b 0x100000 /tftpboot/redboot.bin Run the loaded image RedBoot> run 0x100000 Enable NOR, NAND or MMC flash media for Redboot. In this case, NAND is beeing used. RedBoot> factive nand Update RedBoot in the flash with currently running image RedBoot> romupdate
查看全文
Building Freescale U-boot The U-boot provided by Freescale can be downloaded in the following link: http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/ 1 - Set the cross compiler environment variables. When using Yocto, it can be made by the following command (see more details at Yocto Trainning Yocto Training - HOME ) source /opt/poky/1.7/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi 2 - Download the source code using "git clone": git clone  http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git 3 - Create a local branch based on some remote branch. In this example, lets use branch origin/imx_v2014.04_3.14.28_1.0.0_ga cd uboot-imx git checkout -b imx_v2014.04_3.14.28_1.0.0_ga_local origin/imx_v2014.04_3.14.28_1.0.0_ga 4 - Configure the project with the board you want to build. All board are listed on file boards.cfg. Check the exactly name of the choosen board and add "_config" to build the project. In this example, lets use mx6qsabresd make mx6qsabresd_config make 5 - The binary file will be generated and will be located at project root folder. The generated file in this case will be u-boot.imx 6 - More details can be found on files doc/README.imx6 doc/README.imximage README Building Mainline U-boot The U-boot project is developed and maintained by Denx Computer Systems can be downloaded in the following link: http://git.denx.de/?p=u-boot.git;a=summary 1 - Set the cross compiler environment variables. When using Yocto, it can be made by the following command (see more details at Yocto Trainning Yocto Training - HOME ) source /opt/poky/1.7/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi 2 - Download the source code using "git clone": git clone http://git.denx.de/u-boot.git 3 - Check the name of the board on "configs" folder. In this case lets use mx6qsabresd_config make mx6qsabresd_config make 4 - The binary file will be generated and will be located at project root folder. The generated file in this case will be u-boot.imx
查看全文
ATK (Advanced Toolkit) ATK (Advanced Toolkit) is a Windows software for programming the flash memory of i.MX boards. It can be downloaded here. Using ATK This section will describe the procedure to erase the flash memory and program the bootloader. 1 - Connect a serial cable between PC and i.MX board. 2 - Some hardware configurations (switches) must be done to flash the board. Set red and cream switches as below: Switch SW5 -> 000000 Switch SW4 -> 1000000 {{Note|On SW5 and SW4, "1" means the keys selected towards the edge of the board.} 3 - Run ATK (1.6 or above) going to Start -> Programs -> AdvancedToolKit -> AdvancedToolKit Set the options: i.MX CPU -> i.MX35_TO2 Device memory -> DDR2; Custom Initial File -> (keep it unmarked) Communication Channel -> Serial Port (Usually COM1) If you are using TO1, Device Memory -> MDDR 4 - Click on Flash Tools to erase, program or dump the the flash memory and click GO NAND Flash Erasing 1- Configure the Dip Switch of Personality Board: Switch 1 2 3 4 5 6 7 8 SW1 OFF OFF OFF OFF N/A N/A N/A N/A SW2 ON OFF OFF ON ON OFF OFF OFF 2- Choose NAND model K9LAG08U8M 3- Continue the steps Remember to select the checkbutton BBT (Back Block Table)
查看全文
Yocto Project versions and names Preparing host environment For virtual machine (VirtualBox): Download the source code from NXP Code Aurora Yocto Project versions and names See here the list of all yocto version names: Releases - Yocto Project  The current stable release is Zeus Preparing host environment For virtual machine (VirtualBox): Please set memory size minimal to 1GB and disk size to 32GB. (24Feb2014 Ubuntu 12.04LTS)   First, make sure your host PC has the required packages to run Yocto The essential packages you need for a supported Ubuntu distribution are shown in the following command: $ sudo apt-get build-dep qemu $ sudo apt-get remove oss4-dev $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \   build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \   xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \   xterm‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ For other Linux distribution or newer Yocto Project release see here the updated list. Download the source code from community Install the repo $ sudo apt-get install repo‍‍‍‍ Download the BSP source: $ mkdir fsl-community-bsp $ cd fsl-community-bsp $ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b zeus $ repo sync‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Download the source code from NXP Code Aurora See here the list of all BSP releases from NXP: imx-manifest - i.MX Release Manifest  Currently, the latest NXP release how to is here: README - imx-manifest - i.MX Release Manifest  To understand the difference between the 2 source code (community X NXP BSP) see here Go to https://community.nxp.com/docs/DOC-94849  Go to Task #2
查看全文
Booting Linux Directly from SD/MMC Card     You can create a self-bootable SD or MMC card with Linux.     This tutorial describes how to create a complete Linux system (bootloader + Linux kernel + root file system) that boots from SD/MMC card.     This is very useful for people willing to demonstrate several Linux images that can be self-contained in SD/MMC cards. Flashing RedBoot on MMC using ATK     To boot Linux from a SD card, the first thing to do is to program the bootloader to the card. For this, click on the link below:     I.MX35 PDK Board Flashing SDCard Flashing RedBoot on MMC using DD     You can also use dd on any linux system to load redboot:   $ sudo dd if=./Desktop/mx35_3stack_redboot_mmc.bin of=/dev/sdd bs=512 skip=2 seek=2 Configuring Kernel to Boot From SD/MMC     Creating a Linux bootable MMC/SD Card.     Execute LTIB:   $ ./ltib -c     Choose configure the kernel:   [*] Configure the kernel     Change image generation to NFS:     Target Image Generation     Options --->     (X) NFS only     Compile Linux kernel with built-in support to MMC/SD and ext3:     Follow that sequence:     Device Drivers --->     <*> MMC/SD card support --->     <*> UniFi SDIO glue for Freescale MMC/SDIO     <*> Freescale i.MX Secure Digital Host Controller Interface support       File systems --->     <*> Ext3 journalling file system support     After the compilation copy the file ~/ltib/rootfs/boot/zImage to tftpboot directory:   $ cp ~/ltib/rootfs/boot/zImage /tftpboot Creating RedBoot Kernel Partition     Create RedBoot partitions and copy Linux kernel to it:     Turn MMC active:   RedBoot> factive MMC     Initialize flash partitions:   RedBoot> fis init       RedBoot> fis list     ... Read from 0x07ee0000-0x07eff000 at 0x00060000: .     Name FLASH addr Mem addr Length Entry point     RedBoot 0x00000000 0x00000000 0x00040000 0x00000000     FIS directory 0x00060000 0x00060000 0x0001F000 0x00000000     RedBoot config 0x0007F000 0x0007F000 0x00001000 0x00000000     Load kernel to RAM:   RedBoot> load -r -b 0x100000 /tftpboot/zImage     Using default protocol (TFTP)     Raw file loaded 0x00100000-0x002c31b7, assumed entry at 0x00100000     Create a kernel partition with content of kernel image loaded to RAM:       RedBoot> fis create -f 0x200000 kernel         RedBoot> fis list     ... Read from 0x07ee0000-0x07eff000 at 0x00060000: .     Name FLASH addr Mem addr Length Entry point     RedBoot 0x00000000 0x00000000 0x00040000 0x00000000     FIS directory 0x00060000 0x00060000 0x0001F000 0x00000000     RedBoot config 0x0007F000 0x0007F000 0x00001000 0x00000000     kernel 0x00200000 0x00100000 0x001E0000 0x00100000     If you reset your board you need to see:   Booting from [SD card, CSD Version 1.0]     If instead you see this message:   Booting from [unknown version card ]     This means your card is not support, please replace it with other card. Creating the Root File System     After storing the kernel image in the SD card, remove the card from the target board and insert it in your computer (running Linux).     In this example, Linux detected the SD card as /dev/sdb.     Now we need to create two partitions. The first partition will not be used, this is just reserved to RedBoot and kernel. The second partition will be used to store Linux Root File System.   # fdisk /dev/sdb     Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel     Building a new DOS disklabel with disk identifier 0x526c22da.     Changes will remain in memory only, until you decide to write them.     After that, of course, the previous content won't be recoverable.         Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)         Command (m for help): p         Disk /dev/sdb: 1023 MB, 1023934464 bytes     32 heads, 62 sectors/track, 1008 cylinders     Units = cylinders of 1984 * 512 = 1015808 bytes     Disk identifier: 0x526c22da           Device Boot Start End Blocks Id System     Create the first partition with 8 MB; it already contains RedBoot and the kernel, as we stored previously:             Command (m for help): n     Command action       e extended       p primary partition (1-4)     p     Partition number (1-4): 1     First cylinder (1-1008, default 1):     Using default value 1     Last cylinder, +cylinders or +size{K,M,G} (1-1008, default 1008): +8M     Now, create the second partition using all remaining space on SD card:       Command (m for help): n     Command action       e extended       p primary partition (1-4)     p     Partition number (1-4): 2     First cylinder (10-1008, default 10):     Using default value 10     Last cylinder, +cylinders or +size{K,M,G} (10-1008, default 1008):     Using default value 1008         Command (m for help): p         Disk /dev/sdb: 1023 MB, 1023934464 bytes     32 heads, 62 sectors/track, 1008 cylinders     Units = cylinders of 1984 * 512 = 1015808 bytes     Disk identifier: 0x526c22da     Device Boot Start End Blocks Id System     /dev/sdb1 1 9 8897 83 Linux     /dev/sdb2 10 1008 991008 83 Linux         Command (m for help): w   Now format the second partition as EXT3: # mkfs.ext3 /dev/sdb2   Remove the SD card from your computer and insert again. Probably your Linux distribution will dectect it and will mount automatically.   On Ubuntu 8.10 it was mounted on /dev/media:   # mount   ...   /dev/sdb2 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal) If your Linux didn't mount it, then you can mount it manually:   # mkdir -p /media/disk   # mount /dev/sdb2 -t ext3 /media/disk   Enter in your LTIB directory and copy the rootfs content to SD card:   # cd /home/alan/ltib-imx35/rootfs/   # cp -a * /media/disk/   Verify if it was copied correctly:   # ls -l /media/disk/   total 80   drwxr-xr-x 2 root root 4096 2009-03-12 09:55 bin   drwxr-xr-x 2 root root 4096 2009-03-12 09:53 boot   drwxr-xr-x 2 root root 4096 2009-03-12 09:55 dev   drwxr-xr-x 6 root root 4096 2009-03-12 14:41 etc   drwxr-xr-x 3 root root 4096 2009-03-12 09:53 home   drwxr-xr-x 4 root root 4096 2009-03-12 09:55 lib   lrwxrwxrwx 1 root root 11 2009-03-12 14:47 linuxrc -> bin/busybox   drwx------ 2 root root 16384 2009-03-12 14:37 lost+found   drwxr-xr-x 7 root root 4096 2009-03-12 09:53 mnt   drwxr-xr-x 2 root root 4096 2009-03-12 09:53 opt   drwxr-xr-x 2 root root 4096 2009-03-12 09:53 proc   drwxr-xr-x 2 root root 4096 2009-03-12 10:10 root   drwxr-xr-x 2 root root 4096 2009-03-12 09:55 sbin   drwxr-xr-x 2 root root 4096 2009-03-12 09:53 sys   drwxrwxrwt 3 root root 4096 2009-03-12 09:53 tmp   drwxr-xr-x 2 root root 4096 2009-03-12 09:55 unit_tests   drwxr-xr-x 9 root root 4096 2009-03-12 09:55 usr   drwxr-xr-x 11 root root 4096 2009-03-12 09:55 var   root@urubu:~/ltib-imx25/rootfs#     Now umount the SD card:   # umount /media/disk Configuring RedBoot to Load Kernel and Rootfs from SD/MMC Card     Remove the SD card from your computer and place again in the board.     Configure RedBoot to load the kernel from SD/MMC card and set up the kernel command parameter "root" to load the root file system from second SD/MMC card partition (/dev/mmcblk0p2)     RedBoot> fc     Run script at boot: true     Boot script:     Enter script, terminate with empty line     >> fis load kernel     >> exec -b 0x100000 -l 0x200000 -c "noinitrd console=ttymxc0,115200 root=/dev/mmcblk0p2 init=/linuxrc ip=none"     >>     Boot script timeout (1000ms resolution): 1     Use BOOTP for network configuration: false     Gateway IP address: 10.29.244.254     Local IP address: 10.29.244.135     Local IP address mask: 255.255.0.0     Default server IP address: 10.29.240.182     Board specifics: 0     Console baud rate: 115200     Set eth0 network hardware address [MAC]: false     Set FEC network hardware address [MAC]: false     GDB connection port: 9000     Force console for special debug messages: false     Network debug at boot time: false     Default network device: lan92xx_eth0     Update RedBoot non-volatile configuration - continue (y/n)? y     ... Read from 0x07ee0000-0x07eff000 at 0x00060000: .     ... Erase from 0x00060000-0x00080000: .     ... Program from 0x07ee0000-0x07f00000 at 0x00060000: .       Now just reset the board and it will boot directly from SD/MMC card.
查看全文
About this document This document describe the setup detail for Robot Operating systems on  ubuntu 14.04 running on MX6QDL based boards. 1. Software & Hardware requirements Supported NXP HW boards: i.MX 6QuadPlus SABRE-SD Board and Platform i.MX 6Quad SABRE-SD Board and Platform i.MX 6DualLite SABRE-SD Board i.MX 6Quad SABRE-AI Board i.MX 6DualLite SABRE-AI Board i.MX 6SoloX SABRE-SD Board i.MX 6SoloX SABRE-AI Board i.MX 7D Sabre Board Software:  Gcc toolchain, Ubuntu 14.04v installed on your board. 2. Installation For install ROS on iMX boards you need to have Ubuntu 14.04 rootfs installed in your board, for installation steps please follow up: https://community.freescale.com/docs/DOC-330147 Run your rootfs target and Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse.  $sudo nano /etc/apt/sources.list Your file should then look like this: deb http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main universe multiverse restricted Make your installation up to date: $ sudo apt-get update $ sudo apt-get upgrade Set your locale: $ sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX Add ROS ARM repos & Key $ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' $ sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116 $ sudo apt-get update There are many different libraries and tools in ROS - not all compile fully on ARM. In this case we are going to install the ROS Base, however any other packages can be installed individually ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools. $ sudo apt-get install python-rosdep python-wstool build-essential cmake xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic \ libxatracker-dev-lts-utopic libopenvg1-mesa-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic\ libgl1-mesa-dev-lts-utopic libgbm-dev-lts-utopic libegl1-mesa-dev-lts-utopic Alternatively, try installing just this to fix dependency issues, and then install ROS base (includes ROS package, build, and communication libraries. No GUI tools.😞 $ sudo apt-get install libgl1-mesa-dev-lts-utopic $ sudo apt-get install ros-indigo-ros-base Before you can use ROS, you will need to initialize rosdep. It enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS. $ sudo rosdep init $ rosdep update Install rosinstall: $ sudo apt-get install python-rosinstall Verifying OS name. If you installed the Linaro ALIP rootfs, make sure your OS name defined at /etc/lsb-release is as the following. Since ros does not recognize Linaro as an OS, this is necessary. $ lsb_release -a You should get: No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 14.04.4 LTS Release:        14.04 Codename:       trusty In any case you get a different output, the following is for Ubuntu 14.04, trusty. Modify the release number and name as per your target. DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04" 3. Testing The Installation Run ROS $ roscore You should get: ... logging to /root/.ros/log/1c07caa4-1dd3-11b2-b860-00049f0399fe/roslaunch- imx6q-2707.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. Started roslaunch server http://i.Mx6q:37547/ ros_comm version 1.11.16 SUMMARY ======== PARAMETERS * /rosdistro: indigo * /rosversion: 1.11.16 NODES auto-starting new master process[master]: started with pid [2718] ROS_MASTER_URI=http://imx6q:11311/ setting /run_id to 1c07caa4-1dd3-11b2-b860-00049f0399fe process[rosout-1]: started with pid [2731] started core service [/rosout] Open a new Terminal and Create the user catkin_ws Workspace. The catkin_ws workspace will contain the user packages. $ source /opt/ros/indigo/setup.bash $ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src $ catkin_init_workspace $ cd ~/catkin_ws/ $ catkin_make The  catkin_make command is a convenience tool for working with catkin_workspace. If you look in your current directory you should now have a 'build' and 'devel' folder. Inside the 'devel' folder you can see that there are now several setup.*sh files. Sourcing any of these files will overlay this workspace on top of your environment. To understand more about this see the general catkin documentation: http://wiki.ros.org/catkin Before continuing source your new setup.*sh file: $ source devel/setup.bash To make sure your workspace is properly overlayed by the setup script, make sure ROS_PACKAGE_PATH environment variable includes the directory you're in. $ echo $ROS_PACKAGE_PATH /home/youruser/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks Next you should go ahead and learn how to use the workspace. If you are following the ROS tutorials series instead of the catkin tutorials, please continue with Creating a ROS Package. For more testing on your installation, you can try the ROS Tutorials (http://wiki.ros.org/ROS/Tutorials)
查看全文
Introduction Hardware Connections Device Tree Configuration Rebuilding Image Requirements Kernel Device Tree Application Driver Main Init Driver Write Read Building and Run the SPI Application Driver Conclusion   Introduction   This document describes how to interface and use Xtrinsic FXLS8471Q digital accelerometer with IMX6Q processor. For this purpose, UDOO Quad board is used with NXP Linux image for IMX6QSABRE-SD board with Kernel 3.14.56 (not with Udoobuntu) to simulate working with a custom board, the process to customize and build such image for UDOO Quad board is described here: Building Linux Image with QT5 for UDOO Quad    On the sensor side FRDM-FXS-MULTI(-B) sensor expansion board which features many of the Xtrinsic sensors introduced in 2013 including the FXSL8471Q is used.   Hardware Connections    The SPI signals from FRDM-FXS-MULTI are routed to SPI1 module of UDOO Quad. FXLS8471Q provides an INT pin which is indicated on image below, however on this implementation polling method is used. Please note that Chip Select is not controlled automatically by SPI module, therefore this pin is configured as GPIO. Besides these signals, reset and power source pins were also connected.   The following figure shows the pins used in FRDM-FXS-MULTI which are connected with UDOO Quad board.           The pins used on the UDOO Quad side are shown in the images below. You can find UDOO Quad pinout diagram here Index of /download/files/pinout.                             Device Tree Configuration   As mentioned at the beginning of this document, a NXP Linux image for IMX6Q-SABRESD is used. In order to customize this image to be used with the UDOO Quad board it is necessary to build a .dtb that matches with it. This task was accomplished obtaining dts and dtsi source files listed below from Kernel Linux Repository for UDOO at UDOOboard (UDOOboard) · GitHub.   imx6qdl-udoo.dtsi imx6qdl-udoo-externalpins.dtsi imx6q-udoo-hdmi.dts   These files were copied into the IMX6Q-SABRESD build source folder and a imx6q-udoo.dtb was generated. This process is described on Building Linux Image with QT5 for UDOO Quad    The following snippets show how the nodes involved on the SPI configuration were set for UDOO Quad board. Please note that each device tree should match your custom board.   In imx6qdl-udoo-externalpins.dtsi verify that ecspi1 node matches with the one shown below.   &ecspi1 {     fsl,spi-num-chipselects = <1>;     cs-gpios = <&gpio5 17 0>;     pinctrl-0 = <&pinctrl_ecspi1>;     pinctrl-names = "default";     status = "disabled";     spidev0: spi@0 {         #address-cells = <1>;         #size-cells = <1>;         compatible = "spidev";         reg = <0>;         spi-max-frequency = <2000000>;     }; };     As you can see on snippet above, ecspi1 node uses pinctrl_ecspi1 as the pin configuration node which is defined in the same file and it looks as follows.          pinctrl_ecspi1: ecspi1grp {             fsl,pins = <             MX6QDL_PAD_DISP0_DAT22__ECSPI1_MISO  0x100b1             MX6QDL_PAD_DISP0_DAT20__ECSPI1_SCLK  0x100b1             MX6QDL_PAD_DISP0_DAT21__ECSPI1_MOSI  0x100b1             MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17   0x80000000             >;         };   However, as you may know each pin on i.MX devices has up to 8 potential functions, and on the other side, one function can be available in different pins.   For example, ECSPI1_MISO can be mapped to 4 different pins     and each pin can have different functions. From all the available functions in a pin one is chosen to be the pad (pin) name. In the image below DISP0_DATA22 was chosen to be the pad name.       Now, back to pinctrl_ecspi1 node, the macros used here are defined in imx6q-pinfuc.h, as you can see DISP0_DAT20 - DISP0_DAT23 are the pads used with the ECSPI signals.   It is necessary to check it that there are no other configurations for DISP0_DAT20 - DISP0_DAT23 and if they are it is necessary to comment out them or delete them. In this case there were other configurations for these pins in imx6qdl-udoo-externalpins.dtsi and they were commented out.     &iomuxc {     imx6q-udoo {         // External Pinout GPIOs         external_hog: hoggrp-2 {         fsl,pins = <             MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29    0x80000000  // {{external-gpio-0}}             MX6QDL_PAD_CSI0_DAT10__GPIO5_IO28    0x80000000  // {{external-gpio-1}}             MX6QDL_PAD_SD1_CLK__GPIO1_IO20       0x80000000  // {{external-gpio-2}}             MX6QDL_PAD_SD1_DAT0__GPIO1_IO16      0x80000000  // {{external-gpio-3}}             MX6QDL_PAD_SD1_DAT1__GPIO1_IO17      0x80000000  // {{external-gpio-4}}             MX6QDL_PAD_SD1_CMD__GPIO1_IO18       0x80000000  // {{external-gpio-5}}             MX6QDL_PAD_SD4_DAT1__GPIO2_IO09      0x80000000  // {{external-gpio-6}}             MX6QDL_PAD_SD4_DAT2__GPIO2_IO10      0x80000000  // {{external-gpio-7}}             MX6QDL_PAD_SD1_DAT3__GPIO1_IO21      0x80000000  // {{external-gpio-8}}             MX6QDL_PAD_SD1_DAT2__GPIO1_IO19      0x80000000  // {{external-gpio-9}}             MX6QDL_PAD_GPIO_1__GPIO1_IO01        0x80000000  // {{external-gpio-10}}             MX6QDL_PAD_GPIO_9__GPIO1_IO09        0x80000000  // {{external-gpio-11}}             MX6QDL_PAD_GPIO_3__GPIO1_IO03        0x80000000  // {{external-gpio-12}}             MX6QDL_PAD_SD4_DAT0__GPIO2_IO08      0x80000000  // {{external-gpio-13}}             MX6QDL_PAD_CSI0_DAT4__GPIO5_IO22     0x80000000  // {{external-gpio-14}}             MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02    0x80000000  // {{external-gpio-15}}             MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00    0x80000000  // {{external-gpio-16}}             MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01    0x80000000  // {{external-gpio-17}}             MX6QDL_PAD_CSI0_DAT12__GPIO5_IO30    0x80000000  // {{external-gpio-18}}             MX6QDL_PAD_CSI0_DAT13__GPIO5_IO31    0x80000000  // {{external-gpio-19}}             MX6QDL_PAD_EIM_D28__GPIO3_IO28       0x80000000  // {{external-gpio-20}}             MX6QDL_PAD_EIM_D21__GPIO3_IO21       0x80000000  // {{external-gpio-21}}             MX6QDL_PAD_DISP0_DAT6__GPIO4_IO27    0x80000000  // {{external-gpio-22}}             MX6QDL_PAD_DISP0_DAT7__GPIO4_IO28    0x80000000  // {{external-gpio-23}}             MX6QDL_PAD_DISP0_DAT8__GPIO4_IO29    0x80000000  // {{external-gpio-24}}             MX6QDL_PAD_DISP0_DAT9__GPIO4_IO30    0x80000000  // {{external-gpio-25}}             MX6QDL_PAD_DISP0_DAT10__GPIO4_IO31   0x80000000  // {{external-gpio-26}}             MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05   0x80000000  // {{external-gpio-27}}             MX6QDL_PAD_DISP0_DAT12__GPIO5_IO06   0x80000000  // {{external-gpio-28}}             MX6QDL_PAD_DISP0_DAT13__GPIO5_IO07   0x80000000  // {{external-gpio-29}}             MX6QDL_PAD_DISP0_DAT14__GPIO5_IO08   0x80000000  // {{external-gpio-30}}             MX6QDL_PAD_DISP0_DAT15__GPIO5_IO09   0x80000000  // {{external-gpio-31}}             MX6QDL_PAD_DISP0_DAT16__GPIO5_IO10   0x80000000  // {{external-gpio-32}}             MX6QDL_PAD_DISP0_DAT17__GPIO5_IO11   0x80000000  // {{external-gpio-33}}             MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12   0x80000000  // {{external-gpio-34}}             MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13   0x80000000  // {{external-gpio-35}}             //MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14   0x80000000  // {{external-gpio-36}}             //MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15   0x80000000  // {{external-gpio-37}}             MX6QDL_PAD_EIM_A16__GPIO2_IO22       0x80000000  // {{external-gpio-38}}             MX6QDL_PAD_GPIO_18__GPIO7_IO13       0x80000000  // {{external-gpio-39}} (KEY_VOL_UP)             MX6QDL_PAD_NANDF_D0__GPIO2_IO00      0x80000000  // {{external-gpio-40}} (HOME)             MX6QDL_PAD_NANDF_D3__GPIO2_IO03      0x80000000  // {{external-gpio-41}} (SEARCH)             MX6QDL_PAD_NANDF_D2__GPIO2_IO02      0x80000000  // {{external-gpio-42}} (BACK)             MX6QDL_PAD_NANDF_D1__GPIO2_IO01      0x80000000  // {{external-gpio-43}} (MENU)             MX6QDL_PAD_GPIO_19__GPIO4_IO05       0x80000000  // {{external-gpio-44}} (KEY_VOL_DOWN)            // MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16   0x80000000  // {{external-gpio-45}}             //MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17   0x80000000  // {{external-gpio-46}}             MX6QDL_PAD_EIM_D25__GPIO3_IO25       0x80000000  // {{external-gpio-47}}             MX6QDL_PAD_KEY_ROW1__GPIO4_IO09      0x80000000  // {{external-gpio-48}}             MX6QDL_PAD_KEY_COL1__GPIO4_IO08      0x80000000  // {{external-gpio-49}}             MX6QDL_PAD_EIM_OE__GPIO2_IO25        0x80000000  // {{external-gpio-50}}             MX6QDL_PAD_EIM_CS1__GPIO2_IO24       0x80000000  // {{external-gpio-51}}             MX6QDL_PAD_EIM_CS0__GPIO2_IO23       0x80000000  // {{external-gpio-52}}             MX6QDL_PAD_EIM_D24__GPIO3_IO24       0x80000000  // {{external-gpio-53}}             MX6QDL_PAD_GPIO_8__GPIO1_IO08        0x80000000  // {{external-gpio-54}}             MX6QDL_PAD_GPIO_7__GPIO1_IO07        0x80000000  // {{external-gpio-55}}             >;         };     Finally, in imx6q-udoo-hdmi.dts enable ECSPI by including an ecspi1 node reference and setting the status property to "okay".   dts-v1/; #include "imx6q.dtsi" #include "imx6qdl-udoo.dtsi" #include "imx6qdl-udoo-externalpins.dtsi" / {     model = "UDOO Quad Board";     compatible = "udoo,imx6q-udoo", "fsl,imx6q";        mxcfb1: fb@0 {         compatible = "fsl,mxc_sdc_fb";         disp_dev = "hdmi";         interface_pix_fmt = "RGB24";         mode_str ="1920x1080M@60";         default_bpp = <32>;         int_clk = <0>;         late_init = <0>;         status = "okay";     }; }; &ecspi1 {     status = "okay"; };   Note: This could be done in .dtsi but the side effect is that any configuration including the dtsi will have ECSPI1 enabled by default.   Finally it is necessary to rebuild the device tree and copy it to the FAT partition of the sdcard. This process is explained in next section.   Rebuilding Image   Requirements In order to build an image as well as an application it is necessary to install a tool to cross-compile code, this way we will be able to generate executable files for ARM architecture in our host machine. This tool is called meta-toolchain, the following commands are used to install it.   In the following instructions it is considered that the build directory is ~/fsl-release_bsp/build_imx6qsabresd_qt5/   $ cd ~/fsl-release_bsp $ source setup-environment build_imx6qsabresd_qt5 $ bitbake meta-toolchain $ sh tmp/deploy/sdk/fsl-imx-x11-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-<kernel>.sh Kernel   In order to enable the kernel SPI driver it is necessary to set it in the menuconfig and rebuild zImage.   Go to kernel directory within the Yocto build directory that we created. $ cd <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source$   Launch menuconfig for imx $ source /opt/fsl-imx-x11/<kernel version>/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi $ make imx_v7_defconfig $ make menuconfig   Enable SPI Driver by going to Device Drivers --> SPI Support and seting '*' to SPI device Driver, save changes and then exit.     And build zImage $ make zImage   The generated file is located in <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source/arch/arm/boot$ and it must be copied to the FAT partition of the SD card.   Device Tree   To build the device tree go to kernel directory within the Yocto build directory that we created. $ cd <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source$   Build dtb file $ source /opt/fsl-imx-x11/<kernel version>/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi $ make imx_v7_defconfig $ make imx6q-udoo-hdmi.dtb   The generated file is located in <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source/arch/arm/boot/dts$ and it must be renamed as imx6q-udoo.dtb and copied to the FAT partition of the SD card.   Application Driver   The SPI kernel driver uses a structure named spi_ioc_transfer which describes a single SPI transfer. It holds pointers to userspace buffers with transmit and receive data, length of buffers, speed, bits per word among other configurations. For further details you can refer to /include/uapi/linux/spi/spidev.h on your kernel source. In the next section the application driver is explained.   The source files of the application driver as well as the device tree sources can be found in the attached.zip file.   Main   The following code shows function main where the SPI driver is initialized driver using "/dev/spidev0.0" which is listed under /dev (in the target root file system) after SPIdev driver is enabled in menuconfig and kernel is rebuilt as indicated in previous section. Then it reads who am i register just for sanity check purpose and initializes and calibrates the sensor and enters in an endless loop where it reads the sensor whenever there is new data ready. Raw data is returned in 6 bytes, so it is managed to get X, Y and Z values and finally these values are converted to G's values and it waits until a key is pressed to continue to read the following value.     /****************************************************************************** * Main ******************************************************************************/ int main(){      //enableGPIO(); //In case of using interrupt instead of polling      file = spi_init("/dev/spidev0.0"); //dev      who();      FXLS8471Q_Init();      FXLS8471Q_Calibration();      while(1)      {          checkData();          if (DataReady) // Is a new set of data ready?          {              buffer = (unsigned char *)spi_read(OUT_X_MSB_REG, 6, file); // Read data output registers 0x01-0x06              printf("AccData[0] = 0x%X \n AccData[1] = 0x%X \n AccData[2] = 0x%X \n AccData[3] = 0x%X \n AccData[4] = 0x%X \n AccData[5] = 0x%X \n", AccData[0], AccData[1], AccData[2], AccData[3], AccData[4], AccData[5]);              Xout_14_bit = ((short) (AccData[0] << 8 | AccData[1])) >> 2; // Compute 14-bit X-axis output value              Yout_14_bit = ((short) (AccData[2] << 8 | AccData[3])) >> 2; // Compute 14-bit Y-axis output value              Zout_14_bit = ((short) (AccData[4] << 8 | AccData[5])) >> 2; // Compute 14-bit Z-axis output value              Xout_g = ((float) Xout_14_bit) / SENSITIVITY_2G; // Compute X-axis output value in g's              Yout_g = ((float) Yout_14_bit) / SENSITIVITY_2G; // Compute Y-axis output value in g's              Zout_g = ((float) Zout_14_bit) / SENSITIVITY_2G; // Compute Z-axis output value in g's              //printf(" X = %d Y = %d Z = %d \n\n", AccData[0], AccData[2], AccData[4]);              //printf("Xval = %d Yval = %d Zval = %d \n", Xout_14_bit, Yout_14_bit, Zout_14_bit);              printf(" XG = %f YG = %f ZG = %f \n\n", Xout_g, Yout_g, Zout_g);              getchar();         }      }      close(file); } Init Driver   The spi_init function opens a file for the driver "/dev/spidev0.0" which is passed as a parameter from main(), then the SPI configuration parameters are read just for informative purpose. Finally struct xfer which is of type spi_ioc_transfer is initialized.   /********************************* SPIdev Init **********************************************/ int spi_init(char filename[40]) { int file; unsigned char mode, lsb, bits; unsigned int baudrate = 524250, speed; printf("SPI Init \n"); if ((file = open(filename,O_RDWR)) < 0) { printf("Failed to open the bus."); /* ERROR HANDLING; you can check errno to see what went wrong */ com_serial=0; exit(1); } if (ioctl(file, SPI_IOC_RD_MODE, &mode) < 0) { perror("SPI rd_mode"); return -1; } if (ioctl(file, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) { perror("SPI rd_lsb_fist"); return -1; } if (ioctl(file, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) { perror("SPI bits_per_word"); return -1; } if (ioctl(file, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) { perror("SPI max_speed_hz"); return -1; } printf("%s: spi mode %d, %d bits %s per word, %d Hz max\n",filename, mode, bits, lsb ? "LSB first" : "MSB first", baudrate); xfer[0].len = 3; /* Length of command to write*/ xfer[0].cs_change = 0; /* Keep CS activated */ xfer[0].delay_usecs = 0; //delay in us xfer[0].speed_hz = 524250; //speed xfer[0].bits_per_word = 8; // bites per word 8 xfer[1].len = 4; /* Length of Data to read */ xfer[1].cs_change = 0; /* Keep CS activated */ xfer[1].delay_usecs = 0; xfer[1].speed_hz = 524250; xfer[1].bits_per_word = 8; printf("SPI Init Finished \n"); return file; }     Write   The SPI communication is started with the  falling edge on chip select pin. A write operation is initiated by transmitting a 1 for the R/W bit. Then the 8-bit register address, ADDR[7:0] is encoded in the first and second serialized bytes. Data to be written starts in the third serialized byte. The order of the bits is as follows:   Byte 0: R/W, ADDR[6], ADDR[5], ADDR[4], ADDR[3], ADDR[2], ADDR[1], ADDR[0] Byte 1: ADDR[7], X, X, X, X, X, X, X Byte 2: DATA[7], DATA[6], DATA[5], DATA[4], DATA[3], DATA[2], DATA[1], DATA[0]   The SPI communication is finished with the  falling edge on chip select pin.   A you can see below array buf keeps the destination address and the data to be transferred, then xfer structure is configured to point to buf as the transfer buffer and the length of the data es set to 2 + data size (the first 2 bytes are for the destination address which is splitted in 2 bytes). Finally the transfer is started by the ioctl command.   /******************** Write a byte to the FXLS8471Q *************************** * Byte 0: 1,ADDR[6],ADDR[5],ADDR[4],ADDR[3],ADDR[2],ADDR[1],ADDR[0] * Byte 1: ADDR[7],0,0,0,0,0,0,0 * Byte 2: DATA[7],DATA[6],DATA[5],DATA[4],DATA[3],DATA[2],DATA[1],DATA[0] ******************************************************************************/ void spi_write(int registerAddress, int nbytes, char data, int file) { unsigned char buf[32]; int status; memset(buf, 0, sizeof buf); buf[0] = 0x80 | registerAddress; buf[1] = 0x80 & registerAddress; buf[2] = data; xfer[0].tx_buf = (unsigned long)buf; xfer[0].len = nbytes + 2; /* Length of command to write*/ status = ioctl(file, SPI_IOC_MESSAGE(1), xfer); if (status < 0) { perror("SPI_IOC_MESSAGE"); return; } com_serial=1; failcount=0; }     Below is the write operation which writes the value 0x3D to the CTRL_REG1 (0x2A).     Read   Similarly a read operation is initiated by transmitting a 0 for the R/W bit. Then the 8-bit register address, ADDR[7:0] is encoded in the first and second serialized bytes. The data is read from the MISO pin (MSB first).   In this case the array buf keeps the address that is going to be read and the third byte is just a dummy byte to be transferred. Structure xfer keeps transfer buffer pointer which in this case is buf and receive buffer which is AccData, the lenght of the command to write and the length of data to read is also specified and finally the read command is executed with ioctl call.     /********************** Read a byte from the FXLS8471Q *********************** * Byte 0: 0,ADDR[6],ADDR[5],ADDR[4],ADDR[3],ADDR[2],ADDR[1],ADDR[0] * Byte 1: ADDR[7],0,0,0,0,0,0,0 * Byte 2: 0,0,0,0,0,0,0,0 ******************************************************************************/ char * spi_read(int registerAddress, int nbytes, int file) { int status; memset(buf, 0, sizeof buf); memset(AccData, 0, sizeof AccData); buf[0] = 0x7F & registerAddress; buf[1] = 0x80 & registerAddress; buf[2] = 0x00; xfer[0].tx_buf = (unsigned long)buf; xfer[0].len = 2; /* Length of command to write*/ xfer[1].rx_buf = (unsigned long) AccData; xfer[1].len = nbytes; /* Length of Data to read */ xfer[1].speed_hz = 524250; status = ioctl(file, SPI_IOC_MESSAGE(2), xfer); if (status < 0) { perror("SPI_IOC_MESSAGE"); return 0; } com_serial=1; failcount=0; return AccData; }     The screenshot below shows the read operation which reads the correct value 0x6A from the WHO_AM_I register (0x0D).     Building and Run the SPI Application Driver   In order to build the application please save the source files and the Makefile (attached) on any place on your host machine and go to that directory where you saved them. Then build the application with the Meta-toolchain using the Make file with the following commands.   Build application driver $ cd <folder wher spi device driver source is saved> $ source /opt/fsl-imx-x11/<kernel version>/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi $ make   A spi_test file will be created in the same folder, copy this file into the sdcard on the Root File System partition in /home/root. Finally when booting the target execute the application. You must see the following output.       Conclusion   This document summarizes the steps to create a SPI application driver. As you saw it is necessary to rebuild the device tree and the kernel, and to do this it is necessary to install metatoolchain. The application driver uses the SPI kernel driver and its main functions are next: Init SPI Driver Read Write Init sensor Callibrate Sensor Polling data ready function   I would say that the core of the application driver are the read and write functions which configure the SPI kernel driver and pass data to it in the format required by the sensor.   For specific details on the driver please see the attached .zip file which contains the application driver code, the Makefile with the one it is build and the device tree sources.   I hope you find this document useful.     Carlos
查看全文
To disable the Android dm-verity in the new devices you should have the below. A Window/Linux computer The Android SDK platform-packages tools. Download the Android Packages tool. To use the Android kernel or give root access to your Android device, it is needed to have some tools from the Android SDK like ADB or fastboot. To download those tools just go to below web-page: https://developer.android.com/studio#downloads Go to the “command line tools only” part and download the sdk-tools-windows-4333796.zip package. Note: Is recommended to store the content of the zip file in path that you could find without any problem since the Android SDK tools can only be run by the terminal console.   Unlock your Android device. On the Android GUI go to Settings -> systems -> About Phone At the bottom, you should see the build number of your Android device. Tap it multiple times until appears on the screen that you are a developer now. Go to the developer options and search for the OEM unlock option. You need to activate that option. Open the power-shell terminal and go to the path where you stored the zip file.   Example for Windows: cd C:\users\diego\Documents\platform-tools‍ Then you will use the ADB tool (Adroid Debug Bridge). To use it you need to run adb.exe in your power-shell terminal. To run an executable in the Windows terminal is just with ".\". Connect the serial download cable to the host computer (the Type C for the i.MX8M and i.MX8MM. The OTG for the i.M6 SabreSD boards). Open the adb server. .\adb.exe start-server‍ See your connected devices. .\adb.exe devices‍ You should see your device and the serial number that is assigned to the device. Then, enter into Bootloader mode. .\adb.exe reboot bootloader‍       Note to see if your board successfully entered to Bootloader mode. In your serial terminal, you should see that you are in Bootloader mode. Once inside the Bootloader mode, using fastboot you can unlock your phone. First, see if your computer recognizes your board once inside the Bootloader mode. .\fastboot.exe devices‍ If you do not see any device, go to Appendix A of the document. Finally, Unlock and reboot the board. .\fastboot.exe oem-unlock .\fastboot.exe reboot‍‍         Unlock the dm-verity option. After the board rebooted. Start again the adb server .\adb.exe start-server .\adb.exe devices‍‍ Then root the board .\adb.exe root ‍ After rooting the board, disable the dm-verity option .\adb.exe disable-verity‍ After disabling the verity option, it will request you to reboot your board. Just reboot your board. .\adb.exe reboot ‍ With that, you should have successfully disabled the verity option on your board.   Appendix A Update the USB driver (For Windows only) If your computer does not recognize once you are inside the bootloader mode. What you need to do is update the USB driver. To update the driver, follow the below steps. First, open your device manager and locate the Universal Serial Bus devices -> USB download gadget. Then press the right-click and select the Update driver option. Select the “Browse my computer for driver software” option. Select the “Let me pick from a list of available drivers on my computer” option.     Select the ADB Device Model.   And accept to install the driver. After that, your computer should recognize the board being into Bootloader mode.   Appendix B connects your Android device to a Linux computer through ADB.   You could face some adb problems if you want to connect your Android device to a Linux computer. If you want to use adb, the Android image does not allow you due to a permission problem. To make it work, you need to create a new rule for a plug device. To make the new rule, create a document inside the /etc/udev/rules.d named 51-android.rules. Inside the document write the following:   SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0660",  GROUP="plugdev", SYMLINK+="android%n"‍‍   Where the ATTR{idVendor} and ATTR{idProduct} is the USB id for the board. To know that information. Write lsusb and your Android device is the one named Google Inc. Then reboot your computer. With this new rule, ADB should work as usual. Hope this document could be useful to someone. Best regards, Diego.
查看全文
First upload the U-Boot firmware using Network (Transferring file over network) or Serial (Transferring file over serial) This is a common serial transfer output: => loady ## Ready for binary (ymodem) download to 0xa0800000 at 115200 bps... CCmode, 1359(SOH)/0(STX)/0(CAN) packets, 9 retries ## Total Size      = 0x0002a388 = 172936 Bytes Unprotect the bootloader flash area: protect off C0000000 C003FFFF Erase the flash blocks: erase C0000000 C003FFFF Copy from RAM to Flash: If firmware has been thansfered over serial: cp.b A0800000 C0000000 2a388 If firmware has been transfered over tftp: cp.b 100000 C0000000 2a388 Installing U-Boot using BDI3000 You can use a BDI2000/3000 to write to the S71WS256 pSRAM: Get this config file. Thanks to the folks at Ultimate Solutions for being such a nice people and writing an almost ready file! Edit the [FLASH] section to this: [FLASH] CHIPTYPE              S29M32X16 CHIPSIZE                0x2000000 BUSWIDTH             16 FILE                        /home/lsantos/work/i.mx27/u-boot/u-boot-v2/uboot.bin ; change to you path FORMAT                 BIN 0xC0000000 ERASE                   0xC0000000 ERASE                   0xC0008000 ERASE                   0xC0018000 ERASE                   0xC0010000 ERASE                   0xC0020000 Don't forget to edit the [HOST] section to your machine's IP address. Telnet to the BDI - CONFIG: loading configuration file passed - CONFIG: loading register definition passed - TARGET: processing reset request - TARGET: BDI asserts TRST and RESET - TARGET: BDI removes TRST - TARGET: Bypass check 0x00000001 => 0x00000002 - TARGET: JTAG exists check passed - Core#0: ID code is 0x07926121 - TARGET: All ICEBreaker access checks passed - TARGET: BDI removes RESET - TARGET: BDI waits for RESET inactive - TARGET: resetting target passed - TARGET: processing target startup .... - TARGET: processing target startup passed Erase the first 128 KiB ADS>erase Erasing flash at 0xc0000000 Erasing flash at 0xc0008000 Erasing flash at 0xc0018000 Erasing flash at 0xc0010000 Erasing flash at 0xc0020000 Erasing flash passed Write the flash ADS>prog Programming /home/lsantos/work/i.mx27/u-boot/u-boot-v2/uboot.bin , please wait .... Programming flash passed Check everything went really well ADS>verify Verifying /home/lsantos/work/i.mx27/u-boot/u-boot-v2/uboot.bin , please wait .... Verifying target memory passed Now you can unplug the BDI and reset the board U-Boot 2.0.0-rc9-00136-gbf725a2-dirty (Jun 17 2009 - 15:45:23)  Board: Freescale i.MX27 ADS cfi_probe: cfi_flash base: 0xc0000000 size: 0x02000000  chip id: [2,882,1,01d] mpll:     265999329 Hz spll:     239999725 Hz arm:      177332886 Hz perclk1:    8866644 Hz perclk2:   17733288 Hz perclk3:   44333221 Hz perclk4:   17733288 Hz clkin26:   26000000 Hz ahb:       44333221 Hz ipg:       22166610 Hz Malloc space: 0xa7b00000 -> 0xa7f00000 (size  4 MB) Stack space : 0xa7af8000 -> 0xa7b00000 (size 32 kB) envfs: wrong magic on /dev/env0 no valid environment found on /dev/env0. Using default environment running /env/bin/init...  Hit any key to stop autoboot:  2  type update_kernel [<imagename>] to update kernel into flash type udate_root [<imagename>] to update rootfs into flash  uboot:/ Of course, this setup works with Redboot, just change the FILE entry at the [FLASH] section or use the prog command: ADS>prog 0xc0000000 /home/lsantos/work/i.mx27/redboot/build/install/bin/redboot.bin BIN Programming /home/lsantos/work/i.mx27/redboot/build/install/bin/redboot.bin , please wait .... Programming flash passed ADS>verify Verifying /home/lsantos/work/i.mx27/redboot/build/install/bin/redboot.bin , please wait .... Verifying target memory passed Rebooting ++... Read from 0x07ee0000-0x07f00000 at 0xc1fe0000: . ... Read from 0x07ed3000-0x07ed4000 at 0xc1fff000: . **Warning** FLASH configuration checksum error or invalid key Use 'fconfig -i' to [re]initialize database PMIC ID: 0x0000009b [Rev: 3.3] Ethernet FEC MAC address: is not set  Board Type: ADS Clock input: 26 MHz Booting from [NOR flash]  PHY ID 22 @ 1 FEC: [ HALF_DUPLEX ] [ disconnected ] [ 10M bps ]: Ethernet eth0: MAC address 00:04:9f:00:af:7a Can't get BOOTP info for device!  RedBoot(tm) bootstrap and debug environment [ROMRAM] Non-certified release, version FSL 200749 - built 19:37:28, Jun 17 2009  Platform: MX27 ADS/EVB (Freescale i.MX27 based) PASS 2.1 [x32 SDR] Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.  RAM: 0x00000000-0x07f00000, [0x00025260-0x07ed1000] available FLASH: 0xc0000000 - 0xc2000000, 256 blocks of 0x00020000 bytes each. RedBoot>
查看全文
About this document This document describe the setup detail for Interfacing, Installing, programming (basis) and testing depth cameras with MX6QDL based boards using the Robotic Operating System (ROS). If you are not using ROS you can also install the proper drivers and compile, in your Ubuntu system as explained on document:  https://community.freescale.com/docs/DOC-330278 1. Software & Hardware requirements Supported NXP HW boards: i.MX 6QuadPlus SABRE-SD Board and Platform i.MX 6Quad SABRE-SD Board and Platform i.MX 6DualLite SABRE-SD Board i.MX 6Quad SABRE-AI Board i.MX 6DualLite SABRE-AI Board Depth sensors tested: Microsoft Kinect, ASUS Xtion. Software:   Gcc, Ubuntu 14.04v, OpenCV, Openni, Python, ROS. 2. Installation on ROS For installation steps of ROS on iMX6 boards in your board, please follow up: https://community.freescale.com/docs/DOC-3301478 Before you can use ROS, you will need to initialize rosdep. It enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS. $ sudo rosdep init $ rosdep update There are many different libraries and tools in ROS - not all compile fully on ARM. In this case we already have installed the ROS Base, however any other packages need to be installed individually. First install the following dependencies, which will take some time and space (~1.4 GB): $ sudo apt-get install --no-install-recommends freeglut3-dev libfreenect-dev libusb-1.0-0-dev libudev-dev ros-indigo-camera-info-manager ros-indigo-dynamic-reconfigure ros-indigo-image-transport ros-indigo-image-proc ros-indigo-depth-image-proc ros-indigo-tf ros-indigo-openni-launch ros-indigo-freenect-* ros-indigo-depthimage-to-laserscan ros-indigo-image-view ros-indigo-camera-info-manager ros-indigo-dynamic-reconfigure libudev-dev doxygen graphviz openjdk-6-jdk ros-indigo-openni2-camera ros-indigo-openni2-launch ros-indigo-rqt-common-plugins ros-indigo-rqt-graph There is no any additional installation to run kinect with ROS, If you are using kinect you can pass to part 4. However the packages used to run the PrimeSense / Asus Xtion on the i.Mx6 are not available over apt yet, so they need to be compiled from source. To use OpenNI2 with ROS, we only need the shared OpenNI2 libraries and the Drivers. Clone OpenNI2 $ git clone https://github.com/OpenNI/OpenNI2 $ cd OpenNI2 Edit ThirdParty/PSCommon/BuildSystem/Platform.Arm $ nano ThirdParty/PSCommon/BuildSystem/Platform.Arm and replace CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 with CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard Add support for pthread library: $ nano ThirdParty/PSCommon/BuildSystem/CommonCppMakefile Search the line 95 and add the code between the two lines: OUTPUT_NAME = $(EXE_NAME)                                                   # We want the executables to look for the .so's locally first:     LDFLAGS += -Wl,-rpath ./ +   ifneq ("$(OSTYPE)","Darwin") +       LDFLAGS += -lpthread +   endif     OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS) endif Save the file and exit Then run make to compile the OpenNI2 drivers and libraries $ PLATFORM=Arm make ALLOW_WARNINGS=1 Once the compilation is done, run the linux install script $ cd Packaging/Linux $ sudo ./install.sh Copy libraries and includes to the system paths $ cd ../../ $ sudo cp -r Include /usr/include/openni2 $ sudo cp -r Bin/Arm-Release/OpenNI2 /usr/lib/ $ sudo cp Bin/Arm-Release/libOpenNI2.* /usr/lib/ Create a package config file $ sudo nano /usr/lib/pkgconfig/libopenni2.pc and fill it with this: prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include/openni2 Name: OpenNI2 Description: A general purpose driver for all OpenNI cameras. Version: 2.2.0.0 Cflags: -I${includedir} Libs: -L${libdir} -lOpenNI2 -L${libdir}/OpenNI2/Drivers -lDummyDevice -lOniFile -lPS1080.so This will enable ubuntu to find the location of the drivers, libraries and include files. To make sure it is correctly found, run $ pkg-config --modversion libopenni2 Which should give the same version as defined in the file above (2.2.0.0). Now the Xtion is ready to be used. Plug it in (if it is already, unplug it first), then run the sample program $ ./Bin/Arm-Release/SimpleRead Then create a catkin workspace as described here, and check out the following packages in the src folder of the catkin workspace: $ cd ~/catkin_ws/src $ git clone https://github.com/ros-drivers/openni2_camera $ git clone https://github.com/ros-drivers/openni2_launch $ git clone https://github.com/ros-drivers/rgbd_launch Now the ros packages checked out above to the catkin workspace can be compiled with catkin_make $ cd ~/catkin_ws $ catkin_make Once the packages are compiled, the Xtion is ready for use with ROS with 3. Testing The Installation Kinect. Open at least 3 bash terminals: Terminal 1: Run ROS $ roscore Terminal 2:  launch the Freenect $ roslaunch freenect_launch freenect.launch Terminal 3: run the image capture $ rosrun image_view image_view image:=camera/rgb/image_color or: $ rosrun image_view image_view image:=camera/rgb/image_rect_mono or: $ rosrun image_view disparity_view image:=camera/depth/disparity It will open a new terminal with the rgb points, mono  and depth images  from the Kinect. Xtion.  Terminal 1: Run ROS $ roscore Terminal 2:  launch Openni2 $ roslaun openi2_launch openni2.launch Terminal 3: you can use rqt or Rviz session to visualize the sensor e.g: $ rqt or $ rosrun rqt_graph rqt_graph In the “rqt” window select “Plugins” -> “Visualization” -> “Image View“                                                             (optional) Install PySide, in any case you get an error with python rqt graph: $ pip install PySide $ cd ~/ Note: rqt and Rviz demand a lot of i.MX GPU work, so general graphic functionality will be affected. For this case is suggested to run rviz in a remote Network ROS session. References: -       www.ros.org -     https://dobots.nl/2014/05/05/asus-xtion-using-openni2-and-ros-on-udoo/
查看全文
If your target system does not have an Ethernet port it is possible to transfer files, such as the kernel image over serial port, using ymodem. On minicom: RedBoot> load -r -b 0x100000 -m ymodem zImage Where "zImage" is the file to be transferred. On minicom press "CTRL + a" and "s", choose ymodem and select the file to be transferred.
查看全文
This tutorial will explain how to compile a Linux distro and the pingpong MQX application to test the communication between ARM Cortex-A9 and ARM Cortex-M4 cores on the SABRE Board for Smart Devices Based on the i.MX 6SoloX. INITIAL SETUP All of the steps were executed on an Ubuntu 14.04 64 bits machine, but should work on other distributions with minimal or no changes. The first step is to install the required tools and applications in the host: $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \   gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm picocom You also need to install the repo tool that will be used to download the Freescale's BSP: $ mkdir ~/bin $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=${PATH}:~/bin Create an environment variable to store the directory name that will be used to download and compile all required software and applications (do no forget to redefine this variable if you close the current terminal or open a new one). $ export IMX6SOLOX=~/imx6solox $ mkdir -p $IMX6SOLOX LINUX DISTRIBUTION Download the Freescale's BSP source code: $ cd $IMX6SOLOX $ mkdir -p fsl-release-bsp && cd fsl-release-bsp $ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.10.53-1.1.0_ga $ repo sync And compile a minimal image for the SABRE Board: $ MACHINE=imx6sxsabresd source fsl-setup-release.sh -b build $ bitbake core-image-minimal After the compilation, a sdcard image should be available. Write it to the sdcard (do not forget to change the device name /dev/sdX in the command below). $ cd tmp/deploy/images/imx6sxsabresd/ $ sudo dd if=core-image-minimal-imx6sxsabresd.sdcard of=/dev/sdX bs=1M && sync To test the image you need to connect the board to your host machine using the USB cable. Two TTY ports will be created. Open your favorite terminal application (minicom, putty, screen, picocom) in the first one and check the Linux boot process. You should be able to login with the root user. FIRMWARE MQX Download the last MQX source code from Freescale's website at http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MQX#. I have used the 4.1.0 version in the tests. Do not forget to download the Linux version (*.gz). Create a directory and decompress the source code: $ cd $IMX6SOLOX $ mkdir -p mqx && cd mqx $ tar xfv ~/Downloads/Freescale\ MQX\ RTOS\ 4.1.0\ for\ i.MX\ 6SoloX\ Linux\ Base.gz $ ls build config doc mcc mqx tools Download and install the required toolchain to compile the MQX application: $ cd $IMX6SOLOX $ mkdir -p toolchain && cd toolchain $ wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 $ tar xfv gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 && rm gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 Now compile the MQX and related libraries: $ cd $IMX6SOLOX/mqx/build/imx6sx_sdb_m4/make $ export TOOLCHAIN_ROOTDIR=$IMX6SOLOX/toolchain/gcc-arm-none-eabi-4_8-2014q1 $ ./build_gcc_arm.sh And compile the pingpong application: $ cd $IMX6SOLOX/mqx/mcc/examples/pingpong/build/make/pingpong_example_imx6sx_sdb_m4 $ ./build_gcc_arm.sh Convert the ELF application to a binary format: $ arm-none-eabi-objcopy -O binary gcc_arm/extflash_release/pingpong_example_imx6sx_sdb_m4.elf m4_qspi.bin The U-Boot bootloader will be responsible to read the MQX firmware from the SDCARD, write in the NOR flash and start the application on the Cortex-M4. Save the m4_qspi.bin file in the first sdcard partition and access the U-Boot's prompt. Run the following command to write the firmware image to the NOR flash: > run update_m4_from_sd And setup U-Boot environment variables so the application will start automatically at boot: > setenv fdt_file imx6sx-sdb-m4.dtb > setenv mmcargs "${mmcargs} uart_from_osc" > setenv bootcmd "run m4boot;${bootcmd}" > saveenv Open another terminal application on the second TTY to have access to the MQX console e reboot the board. You should see the message below: ***** MCC PINGPONG EXAMPLE ***** Please wait : 1) A9 peer is ready Then press "S" to start the demo ******************************** Press "S" to start the demo : Wait for the Linux boot process to finish and press "S" to start the demo application. In the Linux terminal, start the communication with the pingpong application: # echo 1 > /sys/devices/soc0/soc.1/2200000.aips-bus/mcctest.17/pingpong_en & You should see the log of messages sent and received on both terminals. Please let me know if you have any question. Best regards, Sergio Prado sergio.prado@e-labworks.com http://e-labworks.com
查看全文
D1 Capture - kernel 2.6.22 diff --exclude CVS -uNr linux-2.6.22/include/asm-arm/arch-mxc/memory.h linux-2.6.22.modified/include/asm-arm/arch-mxc/memory.h --- linux-2.6.22/include/asm-arm/arch-mxc/memory.h     2009-07-16 16:29:45.000000000 -0300 +++ linux-2.6.22.modified/include/asm-arm/arch-mxc/memory.h     2009-07-15 15:38:34.000000000 -0300 @@ -28,6 +28,7 @@     /* Size of contiguous memory for DMA and other h/w blocks */     #define CONSISTENT_DMA_SIZE     SZ_16M    +     /*!      * @defgroup Memory_MX27 Memory Map      * @ingroup MSL_MX27 @@ -48,7 +49,7 @@     #ifdef CONFIG_DMA_ZONE_SIZE     #define MXC_DMA_ZONE_SIZE     ((CONFIG_DMA_ZONE_SIZE * SZ_1M) >> PAGE_SHIFT)     #else    -#define MXC_DMA_ZONE_SIZE     ((12 * SZ_1M) >> PAGE_SHIFT)   +#define MXC_DMA_ZONE_SIZE     ((20 * SZ_1M) >> PAGE_SHIFT)     #endif      static inline void __arch_adjust_zones(int node, unsigned long *zone_size, diff --exclude CVS -uNr linux-2.6.22/drivers/media/video/mxc/capture/mxc_v4l2_capture.c linux-2.6.22.modified/drivers/media/video/mxc/capture/mxc_v4l2_capture.c ---    linux-2.6.22/drivers/media/video/mxc/capture/mxc_v4l2_capture.c     2009-07-16 16:29:43.000000000 -0300 +++ linux-2.6.22.modified/drivers/media/video/mxc/capture/mxc_v4l2_capture.c     2009-07-16 16:08:02.000000000 -0300 @@ -1650,9 +1650,9 @@                  /* setup cropping */                 cam->crop_bounds.left = 0; -             cam->crop_bounds.width = 640; +             cam->crop_bounds.width = 800;                 cam->crop_bounds.top = 0; -             cam->crop_bounds.height = 480; +             cam->crop_bounds.height = 600;                 cam->crop_current = cam->crop_defrect = cam->crop_bounds;                 ipu_csi_set_window_size(cam->crop_current.width,                                                       cam->crop_current.height); @@ -1663,7 +1663,7 @@                 cam->standard.id = V4L2_STD_UNKNOWN;                 cam->standard.frameperiod.denominator = 30;                 cam->standard.frameperiod.numerator = 1; -             cam->standard.framelines = 480; +             cam->standard.framelines = 600;                 cam->streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;                 cam->streamparm.parm.capture.timeperframe =                 cam->standard.frameperiod; cam->streamparm.parm.capture.capability = V4L2_CAP_TIMEPERFRAME; diff --exclude CVS -uNr linux-2.6.22/drivers/media/video/mxc/capture/ov2640.c linux-2.6.22.modified/drivers/media/video/mxc/capture/ov2640.c ---    linux-2.6.22/drivers/media/video/mxc/capture/ov2640.c     2009-07-16 16:29:45.000000000 -0300 +++ linux-2.6.22.modified/drivers/media/video/mxc/capture/ov2640.c     2009-07-16 16:07:03.000000000 -0300 @@ -698,12 +698,12 @@     #endif                            g_cam->streamparm.parm.capture.capturemode = 1;                 } else { -          out_width = 640; -          out_height = 480; +          out_width = 800; +          out_height = 600;                 g_cam->crop_bounds.left = 0; -          g_cam->crop_bounds.width = 640; +          g_cam->crop_bounds.width = 800;                 g_cam->crop_bounds.top = 0; -          g_cam->crop_bounds.height = 480; +          g_cam->crop_bounds.height = 600;                 g_cam->crop_current = g_cam->crop_defrect = g_cam->crop_bounds;     #ifdef CONFIG_ARCH_MX3                              ipu_csi_set_window_size(g_cam->crop_current.width ,
查看全文
Gingerbread (GB) Prepare the SD Card root/ : root file system (including init, init.rc, etc). Mounted at / system/:  Android system binary/libraries. Mounted at /system data/: Android data area. Mounted at /data recovery/: root file system when booting in "recovery" mode. Not directly used. Partition Description Type Size Header 8 BOOT raw area for bootloader and MEDIA DATA CACHE RECOVERY An example of partition a 4 GB SD card: Copy the system to SD card # sudo dd if=u-boot.bin of=/dev/sdx bs=1K skip=1 seek=1; sync # sudo dd if=u-boot-no-padding.bin of=/dev/sdx bs=1K seek=1; sync # sudo dd if=uImage of=/dev/sdx bs=1M seek=1; sync # sudo dd if=uramdisk.img of=/dev/sdx bs=1M seek=6; sync # sudo dd if=system.img of=/dev/sdx2; sync # sudo dd if=recovery.img of=/dev/sdx4; sync Ice Cream Sandwich (ICS)
查看全文
i.MX27 PDK Board Flashing This tutorial teaches how to flash bootloader using ATK. To flash kernel and root file system, follow the directions: IMX27 PDK NAND Flashing RedBoot. Using ATK ATK (Advanced Toolkit) is a Windows software for programming the flash memory of i.MX boards. This section will describe the procedure to erase the flash memory and program the bootloader. 1 - Connect a serial cable between PC and i.MX board. 2 - Some hardware configurations (switches) must be done to flash the board. Set red and cream switches as below: Switch SW5 -> 00000 Switch SW4 -> 10000001 Installing ATK on Linux Download ATK: Download. Extract ATK: # unzip ATK_1_41_STD_installer.zip Execute the default install process: # wine SETUP.EXE Get mfc42.dll and msvcp60.dll from a Windows Machine (C:\Windows\System32) and copy to wine system32 (/root/.wine/drive_c/windows/system32) Run ATK: # wine ADSToolkit_std.exe Next Step To flash kernel and root file system, follow the directions: IMX27 PDK NAND Flashing RedBoot. PS: On SW5 and SW4, "1" means the keys selected towards the edge of the board. 3 - Run ATK by clicking Start -> Programs -> AdvancedToolKit -> AdvancedToolKit       Set the options:    Device memory -> DDR; Custom Initial File -> (keep it unmarked)    Communication Channel -> Serial Port (Usually COM1) 4 - Click on Flash Tools to erase, program or dump the the flash memory and click GO. Flash Erasing 1 - To erase Flash memory, select the parameters as shown in the figure below: 2 - Turn on the board and press Erase. 3 - ATK shows this message when flash is erased Flash Programming The next step is to program the bootloader image into the board's Flash following the steps below. 1 - Select the parameters as shown in the figure below and press Program. The bootloader binary image file can be found into your Board Support Package Set Program, NAND, Address: 0x00000000 2 - Add it on Image File field and press Program. 3 - Close ATK, turn off the board and set switch back as shown in the picture below. Installing ATK on Linux Download ATK: Download. Extract ATK: # unzip ATK_1_41_STD_installer.zip Execute the default install process: # wine SETUP.EXE Get mfc42.dll and msvcp60.dll from a Windows Machine (C:\Windows\System32) and copy to wine system32 (/root/.wine/drive_c/windows/system32) Run ATK: # wine ADSToolkit_std.exe Next Step To flash kernel and root file system, follow the directions: IMX27 PDK NAND Flashing RedBoot.
查看全文
Quick Steps Four quick steps to build and flash a UBIFS image on i.MX35 NAND (K9LBG08U0D-PCB0), for information on how to you another memory, please see next section. Enable MTD_UBI and UBIFS_FS on kernel Create UBI image from rootfs (used for NFS) - ON PC mkfs.ubifs -v -r rootfs -m 2048 -e 258048 -c 966 -o ubifs.img ubinize -o ubi.img -m 2048 -p 256KiB -s 2048 ubinize.cfg Format NAND using UBI image - ON TARGET ubiformat -f ubi.img /dev/mtd8 Load UBI file system load -r -b 0x100000 zImage fis create -f 0x300000 kernel fis load kernel exec -c "noinitrd console=ttymxc0 115200 ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs ip=none" How To First of all, install mtd-utils on both target and host: Target: ./ltib -c Package list [*] mtd-utils Host sudo aptget install mtd-utils 1. Enable MTD_UBI and UBIFS_FS on kernel MTD_UBI -> Device Drivers     -> Memory Technology Device (MTD) support (MTD [=y])           -> UBI - Unsorted block images                   <*> Enable UBI                    (4096) UBI wear-leveling threshold (NEW)                    (1) Percentage of reserved eraseblocks for bad eraseblocks handling (NEW)                 < > MTD devices emulation driver (gluebi) (NEW)                    ** UBI debugging options **                    [ ] UBI debugging (NEW) UBIFS_FS -> File systems         ->Miscellaneous filesystems             <*> UBIFS file system support                 [ ] Extended attributes support (NEW)                 [ ] Advanced compression options (NEW)                 [ ] Enable debugging (NEW) 2. Create UBI image On TARGET Collect some information needed in order to create the UBI image according to your NAND device root@freescale \~$ cat /proc/mtd dev:   size   erasesize name mtd0: 00080000 00020000 "Bootloader" mtd1: 00400000 00020000 "nor.Kernel" mtd2: 01e00000 00020000 "nor.userfs" mtd3: 01c00000 00020000 "nor.rootfs" mtd4: 00003000 00020000 "FIS directory" mtd5: 02001000 00020000 "Redboot config" mtd6: 00300000 00040000 "nand.bootloader" mtd7: 00500000 00040000 "nand.kernel" mtd8: 10000000 00040000 "nand.rootfs" mtd9: 00800000 00040000 "nand.configure" mtd10: 6f000000 00040000 "nand.userfs" I will use mtd8, because I want the NAND rootfs MTD partition. More on [1] root@freescale ~$ ubiattach /dev/ubi_ctrl -m 8 UBI: attaching mtd8 to ubi0 UBI: physical eraseblock size:   262144 bytes (256 KiB) UBI: logical eraseblock size:    258048 bytes UBI: smallest flash I/O unit:    2048 UBI: VID header offset:          2048 (aligned 2048) UBI: data offset:                4096 UBI: empty MTD device detected UBI: create volume table (copy #1) UBI: create volume table (copy #2) UBI: attached mtd8 to ubi0 UBI: MTD device name:            "nand.rootfs" UBI: MTD device size:            256 MiB UBI: number of good PEBs:        979 UBI: number of bad PEBs:         45 UBI: max. allowed volumes:       128 UBI: wear-leveling threshold:    4096 UBI: number of internal volumes: 1 UBI: number of user volumes:     0 UBI: available PEBs:             966 UBI: total number of reserved PEBs: 13 UBI: number of PEBs reserved for bad PEB handling: 9 UBI: max/mean erase counter: 0/0 UBI: image sequence number: 0 UBI: background thread "ubi_bgt0d" started, PID 2098 UBI device number You will need: -p = physical eraseblock size = 256KiB -e = logical eraseblock size = 258048 -m = smallest flash I/O unit = 2048 -s = VID header offset = 2048 -c = available PEB = 966 Values only for iMX35 PDK NAND - K9LBG08U0D-PCB0 3. ON HOST - Now, create the images (two steps) You need to create ubinize.cfg file! ubinize.cfg [ubifs] mode=ubi image=ubifs.img vol_id=0 vol_size=237MiB vol_type=dynamic vol_name=rootfs vol_flags=autoresize $ mkfs.ubifs -v -r rootfs -m 2048 -e 258048 -c 966 -o ubifs.img mkfs.ubifs      root:                rootfs/      min_io_size:    2048      leb_size:         258048      max_leb_cnt:   966      output:            ubifs.img      jrn_size:          8388608      reserved:         0      compr:            lzo      keyhash:         r5      fanout:            8      orph_lebs:       1      super lebs:      1      master lebs:    2      log_lebs:         4      lpt_lebs:          2      orph_lebs:       1      main_lebs:       132      gc lebs:           1      index lebs:       2      leb_cnt:           142      UUID:              CC2057F9-B20F-46D1-A399-1FCA95DCAFF7 Success\! $ ubinize -o ubi.img -m 2048 -p 256KiB -s 2048 ubinize.cfg $ ls -lh u* -rw-r--r-- 1 daiane daiane 35M 2010-11-26 15:21 ubifs.img -rw-r--r-- 1 daiane daiane 36M 2010-11-26 15:22 ubi.img -rw-r--r-- 1 daiane daiane 113 2010-11-26 15:22 ubinize.cfg $ sudo cp ubi.img rootfs/home/ 4. Format NAND using UBI image - ON TARGET Turn on target (or reset it) and format MTD partition $ cd /home $ ubiformat -f ubi.img /dev/mtd8 5. Load UBI file system Reset and change redboot script: .. fis load kernel .. exec -c "noinitrd console=ttymxc0 115200 ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs ip=none"
查看全文