7 Replies Latest reply on Jun 13, 2017 2:33 AM by FerryT

    Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project

    shubham0000gupta

      Hi,

       

      We have used iot-devkit-yp-poky-edison-20160606 to build custom kernel image for Edison, but in this it contains linux version 3.10.98 and we want to use linux version 4.x to enable 6LowPan.

       

      So we changed the bb file (/poky/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/linux-externalsrc.bb)  in following lines as:

      10: SRC_URI = "git://github.com/01org/edison-linux.git;protocol=https;branch=master"

      11: SRCREV = "master"

      23: LINUX_VERSION ?="4.11.1"

      to fetch the files from master branch with 4.11 linux version.

       

      It got fetched successfully upto do_fetch function, but do_compile function is throwing an error regarding configuration files.

       

      If it is not correct approach please suggest us the correct procedure to follow.

       

                                                                                                                                                                                                             

       

      We already build image(core-image-base with Linux-Intel kernel 4.9).

      Issues while flashing the image on Edison.

      ^MHit any key to stop autoboot:  5 ^H^H^H 4 ^H^H^H 3 ^H^H^H 2 ^H^H^H 1 ^H^H^H 0
      ^MTarget:blank
      ^MPartitioning already done...
      ^MFlashing already done...
      ^MGADGET DRIVER: usb_dnl_dfu
      ^Mreading vmlinuz
      ^M5385024 bytes read in 133 ms (38.6 MiB/s)
      ^MValid Boot Flag
      ^MSetup Size = 0x00003c00
      ^MMagic signature found
      ^MUsing boot protocol version 2.0c
      ^MLinux kernel version 3.10.17-yocto-standard (ee207837@pcz-2T013.sasken.com) #1 SMP PREEMPT Thu Nov 5 19:32:50 IST 2015
      ^MBuilding boot_params at 0x00090000
      ^MLoading bzImage at address 00100000 (5369664 bytes)
      ^MMagic signature found
      ^MKernel command line: "root=/dev/mmcblk1p1 rootdelay=3 rootfstype=ext4 console=ttyMFD2 earlyprintk=ttyMFD2,keep loglevel=4 systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=4379776ba7fb6969adfb30a3175bb766 g_multi.dev_addr=02:00:86:5b:b7:66"
      ^M
      ^MStarting kernel ...
      ^M
      ^M[    0.746304] pca953x 1-0020: failed reading register^M
      [    0.751509] pca953x 1-0021: failed reading register^M
      [    1.602176] snd_soc_sst_platform: Enter:sst_soc_probe^M
      [    1.955907] pmic_ccsm pmic_ccsm: Error reading battery profile from battid frmwrk^M
      [    1.965145] pmic_ccsm pmic_ccsm: Battery Over heat exception^M
      [    1.975398] pmic_ccsm pmic_ccsm: Battery0 temperature outside boundary^M
      ^MINIT: version 2.88 booting^M^M
      Error opening /dev/fb0: No such file or directory^M
      Starting udev^M
      depmod: ERROR: could not open directory /lib/modules/3.10.17-yocto-standard: No such file or directory^M
      depmod: WARNING: -e needs -E or -F^M
      depmod: ERROR: could not open directory /lib/modules/3.10.17-yocto-standard: No such file or directory^M
      depmod: FATAL: could not search modules: No such file or directory^M
      [    6.681983] snd_intel_sst: request fw failed^M
      ALSA: Restoring mixer settings...^M^M
      No state is present for card Loopback^M^M
      Found hardware: "Loopback" "Loopback Mixer" "" "" ""^M^M
      Hardware is initialized using a generic method^M^M
      No state is present for card Loopback^M^M
      No state is present for card dummyaudio^M^M
      Found hardware: "dummy-audio" "" "" "" ""^M^M
      Hardware is initialized using a generic method^M^M
      ^MINIT: Entering runlevel: 5^M^M^M
      Configuring network interfaces... No state is present for card dummyaudio^M^M
      ifconfig: SIOCGIFFLAGS: No such device^M^M
      Starting system message bus: Unknown group "power" in message bus configuration file^M^M
      dbus.^M^M
      Starting rpcbind daemon...done.^M^M
      Starting bluetooth^M^M
      bluetoothd^M^M
      Starting syslogd/klogd: done^M^M
       * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon^M^M
         ...done.^M^M
      Starting Telephony daemon^M^M
      Starting Linux NFC daemon^M^M
      ^MINIT: Id "PCH0" respawning too fast: disabled for 5 minutes^M^M
      ^MINIT: Id "S0" respawning too fast: disabled for 5 minutes^M^M
      ^MINIT: Id "S1" respawning too fast: disabled for 5 minutes^M^M
      
      • we tried with Intel_Edison_Setup_Lin_2016.2.002 and it give Unable to reconnect with Edison.
        • 1. Re: Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project
          0andriy

          Old user space is not compatible with newer kernels. But first of all you have to boot newer kernel (and provide a folder with modules of newer kernel on your rootfs) -- now old one is booting. Also see https://github.com/andy-shev/linux/issues/12

          • 2. Re: Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project
            FerryT

            The source you have in your recipe does not provide 4.11.

             

            Andy's kernel is continuously tracking vanilla + adding patches + adding defconf for edison. I am tracking andy's, but branching directly after a kernel release, so we have sort of a fixed point in time. Currently, eds-4.11. Of course if you want the latest and greatest you need to clone Andy's eds branch (currently I believe at 4.12-rc2).

             

            The vanilla kernel requires a new u-boot (provided by andy again), and an initramfs that loads some modules that cannot be built-in. I am trying to tie everything together, using yocto morty, eds-4.1? kernel, u-boot, initramfs and updated rootfs. Currently my yocto recipies build, and boot into initramfs, but much more work is needed. The latest state will be pushed this week (boot into initramfs). This will be in GitHub - htot/meta-intel-edison: Here is the meta-intel-edison that builds, tries to stay up to date and provides a PREE…   in the morty branch.

             

            The other branches provide buildable versions of the edison image (based of the 2.1 image, but with some updates, and a version with -rt kernel), these should also 'just work'.

            • 3. Re: Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project
              FerryT

              You can find my new images here: GitHub - htot/meta-intel-edison: Here is the meta-intel-edison that builds, tries to stay up to date and provides a PREE…

               

              There are four branches that generate 4 different images:

              • dizzy-uptodate tracks origin/dizzy with 3.10.98 kernel. This branch pulls https://github.com/htot/meta-intel-iot-middleware.git branch dizzy-uptodate with fixes for paho-mqtt relocated and iotkit-comm-js no longer supported.
              • dizzy-latest tracks origin/master as much as possible with 3.10.98 kernel. This branch pulls https://github.com/htot/meta-intel-iot-middleware.git branch dizzy-latest with fixes for paho-mqtt relocated and iotkit-comm-js no longer supported + java support removed. This gives mraa 0.9.0, upm 0.4.1 and mosquitto 1.4.
              • dizzy-rt same as dizzy-latest but with real time kernel. Switches the kernel to the PREEMPT_RT 3.10.17-rt kernel
              • morty experimental branch based on Yocto Morty, vanilla kernel 4.11

               

              To me the most exciting are dizzy-rt and morty. But, if you are just looking to build a new image and can't because the official 3.5 image needs manual modifications try out dizzy-uptodate or dizzy-latest.

               

              If you select one of these branches on github, you will see the contents of the README.md change to the appropriate info for that branch. For morty build instructions can be found on the wiki pages.

               

              Help on morty work is highly appreciated, especially in testing and adding back features that I removed.

              Also, I believe many will be happy to see mraa ported to the vanilla (currently 4.11) kernel, so there applications will work again. Noteworthy things that need to be changed: serial port moved from ttyMFD2 to linux standard ttyS2, pincontrol and pinmux changed to linux standard. The mraa abstraction that takes care is this and needs porting is : mraa/intel_edison_fab_c.c at master · intel-iot-devkit/mraa · GitHub

               

              Ferry

              • 4. Re: Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project
                shubham0000gupta

                Thanks Ferry. When can we expect image with kernel version 4.x?

                I have another problem with BLE which is given below:

                I am working with the image which has version 3.10. I am currently trying to use built in BLE module (as a central device) to connect to other BLE device. I am able to scan but not able to connect when i tried with both bluetoothctl (error : Failed to connect: org.bluez.Error.Failed) and gattlib (

                Scan completed

                ------------START DC:89:AA:C1:E0:A3 ---------------

                Fail to connect to the bluetooth device.).

                I tried same procedure using Raspberry PI , and I am able to connect to BLE device. I was thinking, it might be because of kernel version. Please let me know your thoughts.

                • 5. Re: Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project
                  FerryT

                  shubham0000gupta  :-) scroll up a bit, then you will see there is already a branch 'morty' currently using kernel 4.11.

                   

                  I haven't tried bluetooth yet, with the new kernel. However bluez5 is installed on the image.

                   

                  If you like you can try using the morty image. It will run from the sd card and leave your existing stuff as is (except you need to update u-boot which is more or less permanent, but should not affect the ability to run your current image).

                  • 6. Re: Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project
                    shubham0000gupta

                    Thanks Ferry.

                    We are trying to build morty image for edison board. But while compiling xdk-daemon component it is giving errors.

                    I searched for possible error solutions on internet, but i didn't get any solution. Following are the error logs:

                     

                    ERROR: Function failed: do_compile (log file is located at /u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/work/core2-32-poky-linux/xdk-daemon/0.0.35-r0/temp/log.do_compile.21901)

                    ERROR: Logfile of failure stored in: /u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/work/core2-32-poky-linux/xdk-daemon/0.0.35-r0/temp/log.do_compile.21901

                    Log data follows:

                    | DEBUG: Executing shell function do_compile

                    | /u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/work/core2-32-poky-linux/xdk-daemon/0.0.35-r0/temp/run.do_compile.21901: 125: [: i586: unexpected operator

                    | npm WARN package.json keepAlive@ No repository field.

                    | npm WARN package.json IoT_App_Daemon@ No repository field.

                    | npm WARN package.json IoT_App_Daemon@ No README data

                    |

                    | > mdns@2.2.8 install /u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/work/core2-32-poky-linux/xdk-daemon/0.0.35-r0/xdk-daemon-0.0.35/current/node_modules/mdns

                    | > node-gyp rebuild

                    |

                    | Usage: gyp_main.py [options ...] [build_file ...]

                    |

                    | gyp_main.py: error: no such option: --no-parallel

                    | gyp ERR! configure error

                    | gyp ERR! stack Error: `gyp` failed with exit code: 2

                    | gyp ERR! stack     at ChildProcess.onCpExit (/u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/sysroots/x86_64-linux/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)

                    | gyp ERR! stack     at ChildProcess.emit (events.js:98:17)

                    | gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)

                    | gyp ERR! System Linux 3.13.0-24-generic

                    | gyp ERR! command "node" "/u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/sysroots/x86_64-linux/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

                    | gyp ERR! cwd /u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/work/core2-32-poky-linux/xdk-daemon/0.0.35-r0/xdk-daemon-0.0.35/current/node_modules/mdns

                    | gyp ERR! node -v v0.10.38

                    | gyp ERR! node-gyp -v v1.0.1

                    | gyp ERR! not ok

                    |

                    | npm ERR! mdns@2.2.8 install: `node-gyp rebuild`

                    | npm ERR! Exit status 1

                    | npm ERR!

                    | npm ERR! Failed at the mdns@2.2.8 install script.

                    | npm ERR! This is most likely a problem with the mdns package,

                    | npm ERR! not with npm itself.

                    | npm ERR! Tell the author that this fails on your system:

                    | npm ERR!     node-gyp rebuild

                    | npm ERR! You can get their info via:

                    | npm ERR!     npm owner ls mdns

                    | npm ERR! There is likely additional logging output above.

                    | npm ERR! System Linux 3.13.0-24-generic

                    | npm ERR! command "node" "/u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/sysroots/x86_64-linux/usr/bin/npm" "install" "--arch=i586"

                    | npm ERR! cwd /u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/work/core2-32-poky-linux/xdk-daemon/0.0.35-r0/xdk-daemon-0.0.35/current

                    | npm ERR! node -v v0.10.38

                    | npm ERR! npm -v 1.4.28

                    | npm ERR! code ELIFECYCLE

                    | npm ERR! not ok code 0

                    | WARNING: exit code 1 from a shell command.

                    | ERROR: Function failed: do_compile (log file is located at /u/ee209712/my_Edison_Workspace/out/linux64/build/tmp/work/core2-32-poky-linux/xdk-daemon/0.0.35-r0/temp/log.do_compile.21901)

                    ERROR: Task 1134 (/u/ee209712/my_Edison_Workspace/out/linux64/poky/meta-intel-iot-middleware/recipes-devtools/xdk-daemon/xdk-daemon_0.0.35.bb, do_compile) failed with exit code '1'

                     

                    could you please help me out in this?

                    Thanks

                    • 7. Re: Upgrade Edison linux-kernel version from 3.10.98 to 4.x by yocto project
                      FerryT

                      shubham0000gupta I have disabled xdk-daemon for morty  because it doesn't build.  I have never used it, so for us it is a low priority thing, but if you manage to modify the recipe so that it builds I will be happy to merge that.

                       

                      Keep in mind that your nodejs application probably wants to use mraa, but as the kernel is currently 4.11, lots of stuff (ttyMFD1 is now ttyS1, pinctrl and pinmux) is now being done in the standard linux way, so mraa needs to be ported. Applications that try to use mraa currently will probably fail during init,

                       

                      So, I guess we need to port mraa first (is only one file) before the xdk becomes useful, except maybe for none IO related stuff like the webserver. I am hoping that the mraa developers will be interested in adding support for the edison with vanilla kernel (which is no doubt the future).

                       

                      Currently I am mostly interested in getting a 'bare' linux platform running with the hardware working, move to 64bit kernel, add PREEMPT_RT.