avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] [bug #40748] linuxgpio doesn't work on Raspberry PI re


From: René Liebscher
Subject: Re: [avrdude-dev] [bug #40748] linuxgpio doesn't work on Raspberry PI rev. 2.
Date: Fri, 29 Nov 2013 23:42:04 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

Hi,

I'm sure how you can get the error you observe. In the loop pin should never set to 0 for open the gpio file. (value = 0 is filtered and all exceptions of this are set to non-0 values.) Could print out the relevant values in the loop so I can understand what going on.

Just insert the following line in the for loop:

fprintf(stderr, "linuxgpio: i=%d, pin=%d, mask=%08x, inverse=%08x\n", i, pgm->pinno[i], pgm->pin[i].mask[0], pgm->pin[i].inverse[0]);


René



On 29.11.2013 13:19, anonymous wrote:
URL:
   <http://savannah.nongnu.org/bugs/?40748>

                  Summary: linuxgpio doesn't work on Raspberry PI rev. 2.
                  Project: AVR Downloader/UploaDEr
             Submitted by: None
             Submitted on: Fri 29 Nov 2013 12:19:14 PM UTC
                 Category: None
                 Severity: 3 - Normal
                 Priority: 5 - Normal
               Item Group: None
                   Status: None
                  Privacy: Public
              Assigned to: None
          Originator Name: Joakim Lubeck
         Originator Email: address@hidden
              Open/Closed: Open
          Discussion Lock: Any

     _______________________________________________________

Details:

I just wanted to test linuxgpio on a Raspberry PI rev. 2. I used the following
configuration entry:

---
programmer
   id    = "linuxgpio";
   desc  = "Use the Linux sysfs interface to bitbang GPIO lines";
   type  = "linuxgpio";
   reset = 17;
   sck   = 2;
   mosi  = 3;
   miso  = 4;
;
---

And used this command:

---
sudo ./avrdude -c linuxgpio -p t1634
Can't export GPIO 0, already exported/busy?: Device or resource busy
---

I don't really know why, but it may be because GPIO 0 isn't available on the
RPi rev. 2. and because of the "special handling" of GPIO 0 in linuxgpio.c.

I don't have a solution but got it to work with this as a workaround:

---
svn diff linuxgpio.c
Index: linuxgpio.c
===================================================================
--- linuxgpio.c (revision 1250)
+++ linuxgpio.c (working copy)
@@ -257,7 +257,7 @@
    //that unwanted toggling of GPIO0 can occur and that other optional pins
    //mostry LED status, can't be set to GPIO0. It can be fixed when a better
    //solution exists.
-  for (i=0; i<N_PINS; i++) {
+  for (i=2; i<N_PINS; i++) {
      if ( pgm->pinno[i] != 0 ||
           i == PIN_AVR_RESET ||
           i == PIN_AVR_SCK   ||
---

/Joakim





reply via email to

[Prev in Thread] Current Thread [Next in Thread]