Accessing GPIO outside of Ubilinux
I have been using UP Boards for many months now and this particular one is 4th (not because they break, because I keep getting new ideas!) and I've bought a UPS Hat for it from the up-shop. I'm having trouble getting the SUSV daemon service running as it's throwing an error when I try to start it. Now, I'm sure this would have a different outcome on Ubilinux but for this particular project I'm using Kali Linux which for several reasons needs it's own kernel to remain installed.
I've checked dmesg after trying to start the daemon and it throws the error "export_store: invalid GPIO 27". Sure enough if i try to export that pin manually using "echo 27 > /sys/class/gpio/export" it also fails. This makes complete sense because those pins are mapped as a base offset from one of the 4 "/sys/class/gpio/gpiochip" instances. So if it was possible to change which pins the daemon needs to export in order to communicate with the UPS Hat all would be well, but as that's not currently possible is there a way to link or re-map the GPIO assignments in /sys/class/gpio? or perhaps a kernel patch?
I'm completely open to suggestions here so any help is greatly appreciated.
Managed to figure it out for anyone that has a similar requirement:
- Grab the commit from this post http://forum.up-community.org/discussion/2447/i2c-interface-needs-a-long-time-to-initialize (append .patch to the URL to download as a patch file if needed)
- Install and unpack the kernel source for your target OS and integrate the commit. For me the actual driver code applied when the patch was run without issue as they are new files, but the supporting files needed to be modified manually (Kconfig, Makefile, etc).
- Build and install the new kernel, reboot.
For me this just worked and immediately after the reboot I was able to see 'gpiochip0' appear in /sys/class/gpio which allowed me to export the required values as per my previous post. The time it takes to initialize i2c has also been dramatically reduced.
Hope this helps.
with firmware version on the hat you use?
I recently update to 2.40 but now every time i unplug the energy the board reboots.. it happens to you to?
I'm also facing that after the reboot the susv client can't find nay device..
Thanks for the help.
- 303 All Categories
- 104 Announcements & News
- 52 Product News - New Product/Product Change Notice/ End-of-life
- 184 Welcome Developers!
- 53 Unboxing & Project Sharing
- 24 Tech Updates
- 593 UP Products
- 6 UP Xtreme i12
- 1 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 13 UP Squared V2
- 41 UP 4000
- 24 UP Xtreme i11
- 34 UP Squared 6000
- 49 UP Squared Pro
- 140 UP Xtreme
- 826 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 221 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 215 Starter Kits & Peripheral