6 Replies Latest reply on Feb 18, 2014 10:52 PM by msg4alex

    Building Wiring library with eglibc (on the board)

    msg4alex

      Hello,

       

         I have installed yocto full image on my board, that is using eglibc instead of uClibc. I want to use the wiring library supplied with Arduino IDE directly on the board, I am able to compile it, but I cannot run programs. I get the following errors:

       

      * it cannot export pins from 16 to 55 (extensions?)

      * it cannot write to pins

      * it cannot setup PWM

       

      I am running the executable with sudo and I have deleted the assert (0) in wiring_digital.c.

       

        Thank you,

      Alexandru

        • 1. Re: Building Wiring library with eglibc (on the board)
          msg4alex

          This is the error:

           

          interrupt-error: Cannot set frequency 0 min 0 max 1000

          interrupt-info: hpet_info: hi_irqfreq 0x0 hi_flags 0x0 hi_hpet 0 hi_timer 2

          45

          wiring_digital-error: unable to open GPIO 16

          wiring_digital-error: unable to open GPIO 17

          wiring_digital-error: unable to open GPIO 18

          wiring_digital-error: unable to open GPIO 19

          wiring_digital-error: unable to open GPIO 20

          wiring_digital-error: unable to open GPIO 21

          wiring_digital-error: unable to open GPIO 22

          wiring_digital-error: unable to open GPIO 23

          wiring_digital-error: unable to open GPIO 24

          wiring_digital-error: unable to open GPIO 25

          wiring_digital-error: unable to open GPIO 26

          wiring_digital-error: unable to open GPIO 27

          wiring_digital-error: unable to open GPIO 28

          wiring_digital-error: unable to open GPIO 29

          wiring_digital-error: unable to open GPIO 30

          wiring_digital-error: unable to open GPIO 31

          wiring_digital-error: unable to open GPIO 32

          wiring_digital-error: unable to open GPIO 36

          wiring_digital-error: unable to open GPIO 37

          wiring_digital-error: unable to open GPIO 38

          wiring_digital-error: unable to open GPIO 39

          wiring_digital-error: unable to open GPIO 40

          wiring_digital-error: unable to open GPIO 41

          wiring_digital-error: unable to open GPIO 42

          wiring_digital-error: unable to open GPIO 43

          wiring_digital-error: unable to open GPIO 44

          wiring_digital-error: unable to open GPIO 45

          wiring_digital-error: unable to open GPIO 46

          wiring_digital-error: unable to open GPIO 47

          wiring_digital-error: unable to open GPIO 48

          wiring_digital-error: unable to open GPIO 49

          wiring_digital-error: unable to open GPIO 50

          wiring_digital-error: unable to open GPIO 51

          wiring_digital-error: unable to open GPIO 54

          wiring_digital-error: unable to open GPIO 55

          wiring_digital-info: pinInit gpiolib 2 is not a candidate for direction confiugration

          wiring_digital-info: pinInit gpiolib 7 is not a candidate for direction confiugration

          wiring_digital-info: pinInit gpiolib 12 is not a candidate for direction confiugration

          wiring_digital-info: pinInit gpiolib 13 is not a candidate for direction confiugration

          wiring_digital-error: pinInit: invalid iHandle for gpio16

          wiring_digital-error: pinInit: invalid iHandle for gpio17

          wiring_digital-error: pinInit: invalid iHandle for gpio18

          wiring_digital-error: pinInit: invalid iHandle for gpio19

          wiring_digital-error: pinInit: invalid iHandle for gpio20

          wiring_digital-error: pinInit: invalid iHandle for gpio21

          wiring_digital-error: pinInit: invalid iHandle for gpio22

          wiring_digital-error: pinInit: invalid iHandle for gpio23

          wiring_digital-error: pinInit: invalid iHandle for gpio24

          wiring_digital-error: pinInit: invalid iHandle for gpio25

          wiring_digital-error: pinInit: invalid iHandle for gpio26

          wiring_digital-error: pinInit: invalid iHandle for gpio27

          wiring_digital-error: pinInit: invalid iHandle for gpio28

          wiring_digital-error: pinInit: invalid iHandle for gpio29

          wiring_digital-error: pinInit: invalid iHandle for gpio30

          wiring_digital-error: pinInit: invalid iHandle for gpio31

          wiring_digital-error: pinInit: invalid iHandle for gpio32

          wiring_digital-error: pinInit: invalid iHandle for gpio36

          wiring_digital-error: pinInit: invalid iHandle for gpio37

          wiring_digital-error: pinInit: invalid iHandle for gpio38

          wiring_digital-error: pinInit: invalid iHandle for gpio39

          wiring_digital-error: pinInit: invalid iHandle for gpio40

          wiring_digital-error: pinInit: invalid iHandle for gpio41

          wiring_digital-error: pinInit: invalid iHandle for gpio42

          wiring_digital-error: pinInit: invalid iHandle for gpio43

          wiring_digital-error: pinInit: invalid iHandle for gpio44

          wiring_digital-error: pinInit: invalid iHandle for gpio45

          wiring_digital-error: pinInit: invalid iHandle for gpio46

          wiring_digital-error: pinInit: invalid iHandle for gpio47

          wiring_digital-error: pinInit: invalid iHandle for gpio48

          wiring_digital-error: pinInit: invalid iHandle for gpio49

          wiring_digital-error: pinInit: invalid iHandle for gpio50

          wiring_digital-error: pinInit: invalid iHandle for gpio51

          wiring_digital-info: pinInit gpiolib 52 is not a candidate for direction confiugration

          wiring_digital-info: pinInit gpiolib 53 is not a candidate for direction confiugration

          wiring_digital-error: pinInit: invalid iHandle for gpio54

          wiring_digital-error: pinInit: invalid iHandle for gpio55

          sysfs-error: can't open handle to /sys/class/pwm/pwmchip0/export

          wiring_analog-error: unable to open pwm1

          sysfs-error: can't write to enable (ret -1)

          wiring_analog-error: unable to disable pwm1

          sysfs-error: can't open handle to /sys/class/pwm/pwmchip0/export

          wiring_analog-error: unable to open pwm3

          sysfs-error: can't write to enable (ret -1)

          wiring_analog-error: unable to disable pwm3

          sysfs-error: can't open handle to /sys/class/pwm/pwmchip0/export

          wiring_analog-error: unable to open pwm4

          sysfs-error: can't write to enable (ret -1)

          wiring_analog-error: unable to disable pwm4

          sysfs-error: can't open handle to /sys/class/pwm/pwmchip0/export

          wiring_analog-error: unable to open pwm5

          sysfs-error: can't write to enable (ret -1)

          wiring_analog-error: unable to disable pwm5

          sysfs-error: can't open handle to /sys/class/pwm/pwmchip0/export

          wiring_analog-error: unable to open pwm6

          sysfs-error: can't write to enable (ret -1)

          wiring_analog-error: unable to disable pwm6

          sysfs-error: can't open handle to /sys/class/pwm/pwmchip0/export

          wiring_analog-error: unable to open pwm7

          sysfs-error: can't write to enable (ret -1)

          wiring_analog-error: unable to disable pwm7

          sysfs-error: err set drive fs_path=/sys/class/gpio/gpio51/drive

           

           

          sysfs-error: err direction fs_path=/sys/class/gpio/gpio51/direction

          • 2. Re: Building Wiring library with eglibc (on the board)
            rmm200

            Do you have a stripped-down test program that uses wiring_digital.c?

            I have ported all the relevant files (38!) to my Galileo, and I would like something to drive them with.

            • 3. Re: Building Wiring library with eglibc (on the board)
              AlexanderMerz

              Did you verify, that /sys/class/pwm/pwmchip0/export and /sys/class/gpio/export really exist? And if so, can you manually export a gpio pin and set a value via Command line interface?

               

              echo "39" > /sys/class/gpio/export

              echo "out" > /sys/class/gpio/gpio39/direction

              echo "1" > /sys/class/gpio/gpio39/value

               

              The error messages indicate missing gpio-/pwm-support.

              1 of 1 people found this helpful
              • 4. Re: Building Wiring library with eglibc (on the board)
                msg4alex

                Yes, they exists. I found the problem, but I am not sure how to fix it. The IO extension driver is not loading, it says device ID not found. As the driver is not loaded, the system cannot access pins higher than 15.

                 

                  Alexandru

                • 5. Re: Building Wiring library with eglibc (on the board)
                  AlexanderMerz

                  Hm, I have an idea: You said, you use an eglibc build - do you mean the "image-sdk" build as described in Sergeys Blog? If so, there is a bug: It says call "setup.sh" to initialize. But it must be:

                  ./setup.sh -e layer

                  else some Galileo-specific parts will be missing in the image build.

                  • 6. Re: Building Wiring library with eglibc (on the board)
                    msg4alex

                    Hey,

                     

                      this is how I solved it. I used the image-sdk and it works. I tried the debian version and it does not load the driver, even if the kernel and the modules are the same.