[MinnowBoard] Echo to MinnowBoardMax GPIO export fails
John Hawley
john.hawley at intel.com
Fri Jan 9 01:18:41 UTC 2015
Ok quick update
We figured out what was going on with the GPIO numbering change. The
Kernel, at commit ea584595fc85e65796335033dfca25ed655cd0ed, made a
modification that changed the GPIO numbering in sysfs, as it was
counting down from 512 instead of 256. This obviously breaks anyone
using a newer kernel.
I've gone ahead and updated the wiki with both a <=3.17 set of values,
as well as >=3.18 values, and I have a merge request in for mraa that
should detect (at runtime) if you are on 3.17 or lower, vs. 3.18 and
higher, and use the right gpio numbers.
I've also dropped an e-mail out to the GPIO maintainer to see if there's
a better way that we should be doing this, as this is a similar problem
to what we've gone through with disks, network interfaces, etc in Linux
before.
Figured I'd let folks know.
- John
On 01/08/2015 09:28 AM, John Hawley wrote:
> Ok Darren merged this into the main
> https://github.com/MinnowBoard/minnow-max-extras/blob/master/lse/what_gpio_num.sh
> repo this morning, use that as my link may get culled at some point.
>
> - John
>
> On 1/7/2015 5:39 PM, Michael Jones wrote:
>> John,
>>
>> Nice, the script works on my board. I can also read values on the pin I need to use.
>>
>> Thanks a million!
>>
>> Now I just need to make a Haskell wrapper to go along with I2C module. If anyone else is crazy enough to use Haskell on the MinnowBoardMax, let me know.
>>
>> Mike
>>
>> On Jan 7, 2015, at 6:32 PM, John Hawley <john.hawley at intel.com> wrote:
>>
>>> Ok I spent a little bit of time digging into this, it *LOOKS* like
>>> Ubuntu is offset by +256 vs. stock and/or Fedora kernels. Not 100% sure
>>> why yet.
>>>
>>> That being said I wrote up a quick script that should discover the right
>>> values for everything and output it to a text console:
>>>
>>> https://github.com/warthog9/minnow-max-extras/blob/master/lse/what_gpio_num.sh
>>>
>>> and I've got a merge request in with it (I'll let Darren have a look at
>>> it and yell at me about it before it gets merged).
>>>
>>> If you are having problems, can you run that script and let me know if
>>> the output is right for you? In the meantime I'll try and dig into why
>>> the offset.
>>>
>>> - John 'Warthog9' Hawley
>>>
>>> On 01/07/2015 06:51 AM, Michael Jones wrote:
>>>> Martin,
>>>>
>>>> Very helpful, thanks. I had to think a bit to understand the base of 82 and 154.
>>>>
>>>> For others:
>>>>
>>>> For 8x, Code GPIO# = 338 + Linux GPIO# (Chart) - 82
>>>> For 2x, Code GPIO# = 410 + Linux GPIO# (Chart) - 154
>>>>
>>>> So for the two examples:
>>>>
>>>> 338 + 84 - 82 = 340
>>>>
>>>> and
>>>>
>>>> 410 + 208 - 154 = 464
>>>>
>>>> I’ll give this a try later this week.
>>>>
>>>> Are there any proper ways to expose the /sys paths for user mode like one can do for /dev/ttyN? Or do people just run their code as root?
>>>>
>>>> Mike
>>>>
>>>>
>>>> On Jan 5, 2015, at 7:29 AM, Martin Oldfield <elinux-mbmx-2014-11 at mjoldfield.com> wrote:
>>>>
>>>>> I've also found wildly different GPIO numbers on my Minnowboard Max.
>>>>>
>>>>> You can read about it at
>>>>> http://www.mjoldfield.com/atelier/2014/12/mbmx-gpio.html.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://minnowboard.57273.x6.nabble.com/MinnowBoard-Echo-to-MinnowBoardMax-GPIO-export-fails-tp903p907.html
>>>>> Sent from the MinnowBoard mailing list archive at Nabble.com.
>>>>> _______________________________________________
>>>>> elinux-MinnowBoard mailing list
>>>>> elinux-MinnowBoard at lists.elinux.org
>>>>> http://lists.elinux.org/mailman/listinfo/elinux-minnowboard
>>>>
>>>>
>>>> _______________________________________________
>>>> elinux-MinnowBoard mailing list
>>>> elinux-MinnowBoard at lists.elinux.org
>>>> http://lists.elinux.org/mailman/listinfo/elinux-minnowboard
>>>>
>>> _______________________________________________
>>> elinux-MinnowBoard mailing list
>>> elinux-MinnowBoard at lists.elinux.org
>>> http://lists.elinux.org/mailman/listinfo/elinux-minnowboard
>>
>>
>> _______________________________________________
>> elinux-MinnowBoard mailing list
>> elinux-MinnowBoard at lists.elinux.org
>> http://lists.elinux.org/mailman/listinfo/elinux-minnowboard
>>
> _______________________________________________
> elinux-MinnowBoard mailing list
> elinux-MinnowBoard at lists.elinux.org
> http://lists.elinux.org/mailman/listinfo/elinux-minnowboard
>
More information about the elinux-MinnowBoard
mailing list