6 Replies Latest reply on Feb 1, 2017 5:10 PM by WalkingThrough

    Intel Joule expansion board MRAA pin mapping GPIOs

    Brian17

      Folks,

       

      I was able to update my BIOS, install Ubuntu 16.04.1 LTS, and install MRAA from (github.com/intel-iot-devkit/mraa).  However, I am unable to initialize the GPIOs on the expansion board on the Intel Joule 570X Development Board.  Below are my system details and troubleshooting notes.  Can someone help guide me with resolving this IO issue?

       

      Summary:

      The on-board blink led example works OK for me using the MRAA pin number 100 (code below). However, I cannot blink a LED using pin 1 (connector J12) or any other pins on the expansion board. Command line control of the on board LEDs work ok also using

       

      $ sudo mraa-gpio set 101 1

      $ sudo mraa-gpio set 101 0

       

      However, the following commands do not turn on/off a LED connected to Pin 1.

       

      $ sudo mraa-gpio set 01 1

      $ sudo mraa-gpio set 01 0

       

      System Setup

      - Intel Joule 570X Development Kit

      - Operating System:

      $ uname -a

      Linux JOULE 4.4.0-59-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

      $ lsb_release -a

      No LSB modules are available.

      Distributor ID: Ubuntu

      Description: Ubuntu 16.04.1 LTS

      Release: 16.04

      Codename: xenial

      - MRAA:

      $ mraa-gpio version
      Version v1.5.16-g3bd590c on Intel GT Tuchuck

       

      - List of GPIO Pin Mapping can be found at

      (http://iotdk.intel.com/docs/master/mraa/grossetete.html)

       

       

      Thank you

       

      #include <mraa.h>
      
       #include <stdio.h>
       #include <unistd.h>
      
       int main()
       {
       // select onboard LED pin based on the platform type
       // create a GPIO object from MRAA using it
       mraa_platform_t platform = mraa_get_platform_type();
       mraa_gpio_context d_pin = NULL;
       switch (platform) {
       case MRAA_INTEL_GALILEO_GEN1:
       d_pin = mraa_gpio_init_raw(3);
       break;
       case MRAA_INTEL_GALILEO_GEN2:
       d_pin = mraa_gpio_init(13);
       break ;
       case MRAA_INTEL_EDISON_FAB_C:
       d_pin = mraa_gpio_init(13);
       break;
       case MRAA_INTEL_GT_TUCHUCK:
       //d_pin = mraa_gpio_init(100);
       d_pin = mraa_gpio_init(1);
       break;
       default:
       fprintf(stderr, "Unsupported platform, exiting");
       return MRAA_ERROR_INVALID_PLATFORM;
       }
       if (d_pin == NULL) {
       fprintf(stderr, "MRAA couldn't initialize GPIO, exiting");
       return MRAA_ERROR_UNSPECIFIED;
       }
      
       // set the pin as output
       if (mraa_gpio_dir(d_pin, MRAA_GPIO_OUT) != MRAA_SUCCESS) {
       fprintf(stderr, "Can't set digital pin as output, exiting");
       return MRAA_ERROR_UNSPECIFIED;
       };
      
       // loop forever toggling the on board LED every second
       for (;;) {
       mraa_gpio_write(d_pin, 0);
       sleep(1);
       mraa_gpio_write(d_pin, 1);
       sleep(1);
       }
      
       return MRAA_SUCCESS;
       }
      
        • 1. Re: Intel Joule expansion board MRAA pin mapping GPIOs
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello Brian17,

          Thank you for interest in the Intel® Joule™ Products.

          I tested your code, and if you substitute line d_pin = mraa_gpio_init(100) with line d_pin = mraa_gpio_init(16) you can use an external LED. Just make sure that you are connecting your LED to breakout J12, pin 16 (I also tested your code using pins 18 and 20 with positive results).

          If the issue persists, please let me know.

          Regards,
          Andres

          • 2. Re: Intel Joule expansion board MRAA pin mapping GPIOs
            Brian17

            Hi Andres,

             

            I tried your suggestion but it doesn't work. I'll reinstall ubuntu/mraa and test again.

             

            Brian

            • 3. Re: Intel Joule expansion board MRAA pin mapping GPIOs
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hello Brian17,

              I think is a good idea to reinstall your OS to test if the previous suggestion works.

              I’ll be waiting for your response. 

              Regards,
              Andres

              • 4. Re: Intel Joule expansion board MRAA pin mapping GPIOs
                floydg

                Some ideas (using Ubuntu and Joule):

                 

                1. always run executable as root (sudo)
                2. for instant gratification use pins 100 - 104 Green (Tuchuck Board), 105 Blue (Joule), 106 white (Joule)

                 

                I have tested the following using QT and mraa, regarding pins with Tuchuck and Intel Joule

                The following pins appeared to "not" work as GPIO outputs:

                Pin: 1,7,27,35,63,69,71,72,73,75,76,77,78,79,80

                 

                If anyone has had success with the pins above I would be interested in hearing implementation scenarios.

                 

                 

                Test System:

                QT5.7

                 

                $uname -a

                Linux Joule 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

                 

                $ lsb_release -a

                No LSB modules are available.

                Distributor ID:    Ubuntu

                Description:    Ubuntu 16.04.1 LTS

                Release:    16.04

                Codename:    xenial

                 

                $ mraa-gpio version

                Version v1.5.1 on Intel GT Tuchuck

                • 5. Re: Intel Joule expansion board MRAA pin mapping GPIOs
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hello floydg,

                  Thank you very much for sharing your experience with the community, your comments and tests are appreciated.

                  Regards,
                  Andres

                  • 6. Re: Intel Joule expansion board MRAA pin mapping GPIOs
                    WalkingThrough

                    I'm having a similar time in trying to use UART2.  From documentation on the expansion board:

                     

                      Signal               Pin

                      UART2 CTS     74

                      UART2_RTS    76

                      UART2_TxD     78

                      UART2_RxD     80

                     

                    On this (  mraa: Intel Joule ) site there is a table of signals and pins.. and UART2 isn't in that list. That port is, I think, the debug port used during OS installs.  Which brings up the question: Is a compile-time option needed to add MRAA support for devices not normally considered to be part of an OS?  I mean... I'd think it entirely believable if a pin or port was dedicated to an OS (or Joule BIOS) critical function and so "external" (user-level) support not provided outside the kernel.  Now that I think on it... some pins may not be available: reserved for deep-OS or hardware use.

                     

                    Mark