-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot export GPIOs in Raspberry Pi #4
Comments
Does the /sys/class/gpio directory exist? If not, then probably you must
enable it first in the Linux kernel.
Please search for CONFIG_GPIO_SYSFS option in the kernel configuration.
If /sys/class/gpio exists, it may be the problem with GPIO 4. Do other
GPIOs export correctly?
Please check https://linuxhint.com/gpio-pinout-raspberry-pi/
Try only those which are listed. GPIO 4 has a special function GPCLK0. Maybe it can't be exported due to that?
With best regards,
Wojtek
czw., 30 mar 2023 o 14:34 homevk15 ***@***.***> napisał(a):
… Hi. I read you connected GPIO in QEMU emulated machine to host. When I
type in a shell on my raspberry pi:
sudo -s
echo 4 >/sys/class/gpio/export
I get the error
-bash: /sys/class/gpio/export No such file or directory
My bash script
#!/bin/sh
qemu-system-arm -machine versatilepb -cpu arm1176 -drive
file=/home/user1/rootfs/2016-05-27-raspbian-jessie-lite.img -kernel
kernel-qemu-4.4.34-jessie -m 256M -serial stdio -append "rw console=ttyAMA0
console=tty1 root=/dev/sda2 rootfstype=ext4 rootwait fsck.repair=yes
memtest=1" -nic user,model=virtio-net-pci,ipv4=on,hostfwd=:127.0.0.1:45022-:22
-qtest unix:/tmp/tmp-gpio.sock
I tried many versions of Raspberry Pi and all of them give the same error.
Please, tell me how you made it working.
—
Reply to this email directly, view it on GitHub
<#4>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AATKHAPLOQ672TQJWONSPB3W6V4WLANCNFSM6AAAAAAWNHMTS4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Wojciech M. Zabołotny
My GPG/PGP keys:
standard: 8192R/7E17F00A (B53C 1F09 BEA9 ED46 51B6 2C2E 4344 F292 7E17
F00A)
confidential: 16384R/1FEDB03C (3412 2330 E225 D57D 70C3 2340 B294 9408
1FED B03C)
|
"Does the /sys/class/gpio directory exist?" Could you give me the link to image you had a luck to emulate successfully (or upload it to some online storage)? |
If /sys/class/gpio directory does not exist, then kernel does not support
GPIO via SYSFS.
The sysfs support for GPIO was considered obsolete for many years. Maybe
finally it got switched off in most distribution kernels.
However, in Buildroot (which I usually use for SBCs and embedded systems)
it is enabled.
Regarding the link, I suggest you to (assuming that you have RPi4 and
UART-USB adapter to access the serial console):
- load Buildroot, unpack it,
- run "make raspberrypi4_64_defconfig"
- run "make menuconfig"
- select the external toolchain
- run "make"
- copy the produced SD card image from output/images to an SD card
(using the "dd" utility)
- Boot the RPi with that SD card
Good luck!
Wojtek
czw., 30 mar 2023 o 15:31 homevk15 ***@***.***> napisał(a):
… "Does the /sys/class/gpio directory exist?"
No, it doesn't exist.
"Do other GPIOs export correctly?"
No, the same error with others.
I tried wheezy, jessie, stretch, buster and all of them gives the same
error.
I download them from https://downloads.raspberrypi.org/raspbian/images/
Could you give me the link to image you had a luck to emulate successfully
(or unload it to some online storage)?
—
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AATKHANDRSCBQ63TM5U2H3LW6WDLHANCNFSM6AAAAAAWNHMTS4>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Wojciech M. Zabołotny
My GPG/PGP keys:
standard: 8192R/7E17F00A (B53C 1F09 BEA9 ED46 51B6 2C2E 4344 F292 7E17
F00A)
confidential: 16384R/1FEDB03C (3412 2330 E225 D57D 70C3 2340 B294 9408
1FED B03C)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I read you connected GPIO in QEMU emulated machine to host. When I type in a shell on my raspberry pi:
sudo -s
echo 4 >/sys/class/gpio/export
I get the error
-bash: /sys/class/gpio/export No such file or directory
My bash script
#!/bin/sh
qemu-system-arm -machine versatilepb -cpu arm1176 -drive file=/home/user1/rootfs/2016-05-27-raspbian-jessie-lite.img -kernel kernel-qemu-4.4.34-jessie -m 256M -serial stdio -append "rw console=ttyAMA0 console=tty1 root=/dev/sda2 rootfstype=ext4 rootwait fsck.repair=yes memtest=1" -nic user,model=virtio-net-pci,ipv4=on,hostfwd=:127.0.0.1:45022-:22 -qtest unix:/tmp/tmp-gpio.sock
I tried many versions of Raspberry Pi and all of them give the same error.
Please, tell me how you made it working.
The text was updated successfully, but these errors were encountered: