8 Replies Latest reply on Sep 20, 2016 1:46 PM by Intel Corporation

    ISR not working - Hardware fault ?!

    Horsten

      Hello,

       

      To test the interrupts and the service routines I don't have used a self-made code.

      I have used Harry Fairhead's code whichsoever he has published in his article "Exploring Edison", chapter 4 MRAA GPIO.

      Furthermore I have tested the most recent Yocto image 20160606 and the previous image 20160315.

      The 20160606 image has not proved satisfactory as the device information web page of the Edison appears only after a second page request.

       

      The Edison interrupts are only software simulated interrupts, but since I couldn't find this problem on the Intel pages I assume it's a hardware problem.

      Am I right?

       

      Many thanks in advance.

        • 1. Re: ISR not working - Hardware fault ?!
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi Horsten,

          I understand you’re having issues with the ISRs on the Edison. You mention you tried the code from the Exploring Edison article. Could you explain in detail how are you testing the code?

          I also found other codes in C and Python using MRAA. Take a look at them and let us know if you’re successful in your tests
          https://github.com/intel-iot-devkit/mraa/blob/master/examples/isr_pin6.c
          https://github.com/intel-iot-devkit/mraa/blob/master/examples/python/hello_isr.py

          Now, the device information page not showing on the latest image is a known issue, we’re working to fix it.

          Run the tests we recommended and let us know your results.

          -Sergio
           

          • 2. Re: ISR not working - Hardware fault ?!
            Horsten

            Hello Sergio,

             

            Many thanks for your support.

             

            The C code isr_pin6.c doesn't work. I get the message: unknown type name 'mraa_gpio_edge_t'.

            With Python code I'm not familiar.

             

            This Harry Fairhead code works:

            #include "mraa.h"

            #include <stdio.h>

            #include <unistd.h>

            int main()

            {

            mraa_init();

            mraa_gpio_context pin31 = mraa_gpio_init(31);

            mraa_gpio_dir(pin31, MRAA_GPIO_IN);

            int in;

            for (;;) {

            in=mraa_gpio_read(pin31);

            printf("switch %d \n",in);

            usleep(1000*1000);

            }

            return MRAA_SUCCESS;

            }

             

            This Harry Fairhead code doesn't work:

            #include "mraa.h"

            #include <stdio.h>

            #include <unistd.h>

            void switchChange();

            int main(){

            mraa_init();

            mraa_gpio_context pin31 = mraa_gpio_init(31);

            mraa_gpio_dir(pin31, MRAA_GPIO_IN);

            mraa_gpio_isr(pin31, MRAA_GPIO_EDGE_FALLING, &switchChange, NULL);

            for (;;) {};

            return MRAA_SUCCESS;

            }

            void switchChange(){

            printf("switch \n");

            }

             

            Many thanks.

            • 3. Re: ISR not working - Hardware fault ?!
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Thank you for doing the tests. You mention that one of the codes you tested for the ISR works, so it seems that the issue might not necessarily be hardware related. As for the code that doesn’t work, do you see any errors, could you share more details on how you’re testing this code, this is to confirm there aren’t any hardware related issues. If you believe the issue with the code not working is the code itself then I’d suggest you to contact the “Exploring Edison” website author for more details.

              -Sergio
               

              • 4. Re: ISR not working - Hardware fault ?!
                Horsten

                Dear Sergio,

                 

                It seems to me that the issue is deep inside the Edison.

                 

                The Harry Fairhead code is absolutely simple and I can not realise any mistakes! Please tell me if I'm wrong.

                Please try the Harry Fairhead code on your Edison and tell me how fine it works.

                 

                The hardware test setup is very simple:

                Connect an 100k resistor on the one hand side to pin J19-2 (VCC) and on the other side to pin J19-4 and a switch and

                connect the switch to pin J19-3 (Ground).

                • 5. Re: ISR not working - Hardware fault ?!
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  We’ll run the test and reply with our results soon.

                  -Sergio
                   

                  • 6. Re: ISR not working - Hardware fault ?!
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hi Horsten,

                    The code examples seem to work fine, you may not be compiling the code correctly as not including the mraa library throws some errors. Make sure you’re compiling the code correctly and have the latest mraa version. The wiring seems to be done correctly.

                    To compile including mraa:
                    root@edison:~# gcc harryfairhead.c -o harryfairhead.o –lmraa

                    Let us know if you continue to see the same results.

                    -Sergio
                     

                    • 7. Re: ISR not working - Hardware fault ?!
                      Horsten

                      Dear Sergio,

                       

                      Many thanks for your support.

                       

                      It was a compiling error only. Strange.

                      I was a bit nervous since it was not my first problem with the Edison.

                      • 8. Re: ISR not working - Hardware fault ?!
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi Horsten,

                        It’s great to hear you managed to solve this issue. Thanks for letting us know it was a compiling issue. If you encounter any other issue don’t hesitate to open a new thread to receive help from the community.

                        -Sergio