10 Replies Latest reply on Apr 30, 2017 3:45 PM by FerryT

    Fixed: The current yocto image build for Edison

    SpiderKenny

      **EDIT** Added fix for paho-mqtt also.**EDIT**

       

      If you try to build the current Yocto image using the Edison BSP the build might fail.

      The main cause of the failure is that the BSP is out of step with current repository locations.

       

      Specifically, the iotkit-comms-js repository no longer lives at github.com/intel-iot-devkit.

      I found another repository on github for it, at github.com/mceisel, so we need to edit the bitbake recipe file that references the repository location.

       

      So here are the steps I use to build the Linux image for Edison.

      (They are based on Sergey's instructions which can be found here.)

       

      I ran this on a Ubuntu linux desktop.

       

      Step 1. Install the essential packages you need for building.

      sudo apt-get install build-essential git diffstat gawk chrpath texinfo libtool gcc-multilib

       

      Step 2. Down load the Board Support Package and unpack it.

      wget http://downloadmirror.intel.com/24910/eng/edison-src-ww18-15.tgz

      tar xzvf edison-src-ww18-15.tgz

       

      Step. 3 Configure the build arena.

      cd edison-src/

      make setup

       

      Step 4. Fix the build before building.

      nano ./out/linux64/poky/meta-intel-iot-middleware/recipes-devtools/iotkit-comm-js/iotkit-comm-js_0.1.1.bb

      Change the line that starts with SRC_URI to read exactly like this:

      SRC_URI = "git://github.com/mceisel/iotkit-comm-js.git;protocol=https"

       

      Also fix the incorrect location for paho-mqtt:

      nano ./out/linux64/poky/meta-intel-iot-middleware/recipes-connectivity/paho-mqtt/paho-mqtt_3.1.bb

      Change the line that starts with SRC_URI to read exactly like this:

      SRC_URI = "git://github.com/eclipse/paho.mqtt.c.git;protocol=http \

       

      Step 5.

      Build the image:

      make image

       

      Step 6.

      Sit back an watch while the build progresses. It may take several hours to complete, this is normal! Why not take the time to fire up your PS4 and Play Ratchet and Clank for while.

       

      Regards,

      Kenny.

        • 1. Re: Fixed: The current yocto image build for Edison
          joe_nasti

          Kenny,

           

          I believe you are correct that these are the steps to build the 2015 snapshot (older version of Yocto). But the latest firmware image snapshot (http://iotdk.intel.com/src/3.5/edison/iot-devkit-yp-poky-edison-20160606.zip) has it's own set of problems when building.  Check these links out..

          - Re: Building 20160606 from source

          - iotkit-comm-c removed from github?

           

          I actually found the Docker solution to be the easiest to reproduce a build environment...GitHub - Squonk42/edison-yocto-docker: Building an Intel Edison Yocto Linux image using docker.

           

          - Joe

           

          P.S.You mentioned Sergey's blog... By chance are you trying to do anything with audio?

          1 of 1 people found this helpful
          • 2. Re: Fixed: The current yocto image build for Edison
            SpiderKenny

            Hi @joe_nasti

            Thanks I think I'll try building the 2016 Snapshot, and then take a look at the Docker method.

            I have never used docker before.

            • 3. Re: Fixed: The current yocto image build for Edison
              SpiderKenny

              @Joe_nasti

               

              P.S.You mentioned Sergey's blog... By chance are you trying to do anything with audio?

               

              Yes indeed! The board I have developed is an application platform to enhance a clients existing product range by adding internet connectivity, DLNA, and internet radio to their range of audio products.

              On board is UART, CAN, and an I2S Audio DAC.

              • 4. Re: Fixed: The current yocto image build for Edison
                joe_nasti

                I'm new to the Docker game also but it did make life easier virtualizing a build environment than say an Ubuntu VirtualBox image (which requires much more PC resources).  Essentially the 5 directories in Squonk42's github page are different virtualized environments that build atop each other but remain exclusive.

                 

                e.g.

                • ubuntu-build will create an Ubuntu Trusty Tahr (14.04) image with all of the essential build packages
                • edison-user will use the ubuntu-build as a baseline to then make modifications for an edison user and environment
                • edison-source will continue to build on the two above and will be where the source code is extracted and patched up
                • edison-download runs a "bitbake -c fetchall edison-image u-boot" that will fetch the hundreds of other projects from the build
                • edison-image finally takes all of the downloaded, patched source code and runs the bitbake build command and copies the output to /home/edison/toFlash.zip.
                • Squonk42 also has a docker branch on edison-image that will skip all the steps above and just download a completed build image (55gb). I've had trouble with this one extracting properly on multiple computers and haven't reached out to him yet for any help.

                 

                If you have an Ubuntu machine that is capable, maybe you don't need the above. But for cross-compiling (Docker is what the Intel System Studio IoT Edition uses underneath Eclipse) or building other large projects, maybe you could take a look at the Docker intro.  It helped me alot. ----> Getting Started with Docker Windows / Mac

                • 5. Re: Fixed: The current yocto image build for Edison
                  joe_nasti

                  Yes indeed! The board I have developed is an application platform to enhance a clients existing product range by adding internet connectivity, DLNA, and internet radio to their range of audio products.

                  On board is UART, CAN, and an I2S Audio DAC.

                  Could you share some details about your I2S Audio DAC setup? I am still trying to follow Sergey's 'Simple I2S Audio Setup' with the WM8731-based MikroElektronika Codec Board and am having some trouble getting off the ground with audio here...Any help you could share would be awesome!

                  I2C and WM8731 Codec Board (MIKROE-506)

                  • 6. Re: Fixed: The current yocto image build for Edison
                    SpiderKenny

                    Could you share some details about your I2S Audio DAC setup? I am still trying to follow Sergey's 'Simple I2S Audio Setup' with the WM8731-based MikroElektronika Codec Board and am having some trouble getting off the ground with audio here...Any help you could share would be awesome!

                     

                    And so we have come full circle! In order to get Audio working I had to modify the Kernel using the recipe that Sergey created here.

                    That's where I started on the whole "Edison build is broken" theme.

                     

                    So the only way that works for me at the moment is to build based on the 2015 Snapshot, as described in my first post above.

                    After extracting the image, put in place Sergey's WM8731 patch by following step 2 of his instructions here.

                    Then follow the rest of my instructions above to fix and build the image,

                    Then flash the image to a board,

                    Then when the board is booting follow Sergey's instructions again at step 4 here.

                     

                    After it boots, follow his instructiosn at step 5

                    And voila! You should have a working WM8731 based I2S Audio solution.

                     

                    It works for me. I'm playing internet radio over I2S to the WM8731

                    1 of 1 people found this helpful
                    • 7. Re: Fixed: The current yocto image build for Edison
                      joe_nasti

                      Well that definitely isn't something I've tried - going back to last year's image. Let me give that a shot!

                       

                      What I2S audio chip  are you using in your setup? Did you make his audio codec block???

                      • 8. Re: Fixed: The current yocto image build for Edison
                        SpiderKenny

                        I'm using a WM8731 on a custom (self) designed board.

                        • 9. Re: Fixed: The current yocto image build for Edison
                          joe_nasti

                          I was hoping following your build steps would work with my Audio Codec Block, but on boot (after changing Sergey's Step #4) I get messages like these:

                          [    1.650235] mrfld_wm8731 mrfld_wm8731.0: ASoC: CODEC wm8731.1-001a not registered

                          [    1.656171] snd_merr_dpcm_wm8731: snd_soc_register_card failed -517

                          [    1.656283] platform mrfld_wm8731.0: Driver mrfld_wm8731 requests probe deferral

                          and ALSA does not see anything. I later send the i2cset commands from Sergey's old I2S page (Intel Edison - Simple I2S Audio Setup - Malinov Family Web Presence ) to activate and configure the codec board, but by that time the kernel has 'given up' on loading that codec. I tried searching for some alsa reload/relaunch commands but nothing I could figure out was working. Any suggestions? p.s. I just put an order in for fab/assembly of Sergey's Audio Block, but I have 3 weeks to wait ;(

                           

                          EDIT: I actually reboot and then saw the "Media Audio Port: ASoC: no backend DAIs enabled for Media Audio Port" error messages he was talking about, which means the kernel was cool loading that driver now. I was able to do step #5 of his to 'Configure ALSA settings'. Then after a reboot, I saw repeated messages like this:

                          [   11.235683] wm8731 1-001a: ASoC: can't set wm8731-hifi hw params: -121

                          [   11.246103]  SSP2-Codec: ASoC: hw_params BE failed -121

                          [   11.246174]  Media Audio Port: ASoC: hw_params BE failed -121

                          However once I installed mpg123 and tried to play a test mp3 (mp3 test file : test : Free Download & Streaming : Internet Archive ), which is an MP3 at 44.1kHz - which is different than Sergey's configuration of 48kHz/24-bit and saw this:

                          root@edison:~# mpg123 -a hw:1,0 -v mpthreetest.mp3

                          High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3

                                  version 1.21.0; written and copyright by Michael Hipp and others

                                  free software (LGPL) without any warranty but with best wishes

                          Decoder: SSE

                           

                          Playing MPEG stream 1 of 1: mpthreetest.mp3 ...

                          [  480.873035] wm8731 1-001a: ASoC: can't set wm8731-hifi hw params: -121

                          [  480.884265]  SSP2-Codec: ASoC: hw_params BE failed -121

                          [  480.884336]  Media Audio Port: ASoC: hw_params BE failed -121

                          [/edison_dev/yocto/rel3.5/build_edison/tmp/work/core2-32-poky-linux/mpg123/1.21.0-r0/mpg123-1.21.0/src/output/alsa.c:118] error: initialize_device(): cannot set hw params

                          [/edison_dev/yocto/rel3.5/build_edison/tmp/work/core2-32-poky-linux/mpg123/1.21.0-r0/mpg123-1.21.0/src/audio.c:643] error: failed to open audio devic

                          [/edison_dev/yocto/rel3.5/build_edison/tmp/work/core2-32-poky-linux/mpg123/1.21.0-r0/mpg123-1.21.0/src/mpg123.c:547] error: failed to reset audio device: Remote I/O error

                          Since I reboot, I tried to set the i2cset registers again but got 'Device or resource busy'....I tried a wav file with 'aplay' that was 48kHz/16-bit. Trying to find a 24-bit to see if that makes a difference, or I guess I could just try to configure as 16-bit?

                           

                          (Later) Well, I reboot to see if that would help again - and I'm back to the first error -517....GRRRRRR

                          • 10. Re: Fixed: The current yocto image build for Edison
                            FerryT

                            I have made this process easier, and building of a more recent version of the image sources, see Edison images that actually build (including real time kernel) - solved