Please select To the mobile version | Continue to access the desktop computer version


Hot search: orangepi
View: 2638|Reply: 1

gpio in arch linux problems

[Copy link]








Rank: 1

Post time 2018-5-16 19:38:54 | Show all posts |Read mode
Edited by greglazor at 2018-5-16 19:40


I managed to install arch linux on a raspberry pi 3. The problem is i cannot use the GPIO. Whenever i try, for example, echo "18" > /sys/class/gpio/export (and other numbers) it says invalid argument. I am root when executing echo. I cannot find a solution to solve this. What could be the problem?

Any help will be apprecited.

I didn't find the right solution from the Internet.

Marketing video company

Thank you.








Registered member

Rank: 2

Post time 2018-5-24 23:10:53 | Show all posts
@greglazor, I'm not sure why you're asking a RaspberryPi question on the OrangePi forum. I actually found your question looking for the answer to this for the OrangePi. Seems like GPIO values and pin outs should be documented on the oPi wiki. But I'm still looking for them, but I haven't spent much time looking yet.

Anyhow I can answer half of your question. The "invalid argument" basically means that the "18" is not a valid value. This can happen for a few reasons:

1. Its not claimed by a driver.
2. Its is in use for some other purpose (like: in active use for SPI, TWI, ...).
3. The driver is rejecting it for some other reason: can't be reconfigured, GPIO isn't available on that pin, ...

My knee-jerk reaction is a missing driver. A module needs loading? If this were a permissions error you would get a more traditional "access denied" error.

First I'd check the /sys/class/gpio/gpiochip* folders to make sure the appropriate driver is loaded. My RaspberryPi 2B has a ".../gpiochip0/label" of "pinctrl-bcm2835". Depending on yours the "BCM" number may vary a little, but I imagine you ought to see the "gpiochip0" folder.

Second I'd check the "base" entry in the correct folder to make sure you have the correct offset, this sometimes changes between driver/kernel versions. On my Orange and Raspberry PIs this is 0. But if not you'll have to add the "base" to your GPIO #. And you also must know what that GPIO number is which usually requires backtracking the connector pin back to the SOC / expander chip and performing a calculation based on the chip's pin number. Seemed like the Raspberry Pi site had that documented fairly well.

And that last bit is what I'm still trying to scrounge up for my oPi Zeros.

Hope this helps
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2020-7-11 12:25 GMT+8 , Processed in 0.028111 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list