C++ GPIO seg fault on Rock64 using Pine64-CPP
#2
So, I never resolved the problems with the Pine64-CPP library but I found an alternate. 

First, I used bash scripts to make sure the Rock64 was working, and I had the right pin addresses.
       https://github.com/Leapo/Rock64-BashGPIO

I used the table table from this website to correctly identify the gpio indices.
        https://github.com/Leapo/Rock64-R64.GPIO...GPIO-Modes
        I used the items from the column lableled GPIO# (ROCK)

Lastly, I used the GPIO Class from the following. 
Even though it is was created for the Raspberry Pi, I found that it correctly manipulated the files in /sys/class/gpio on my Rock64.
      https://github.com/halherta/RaspberryPi-GPIOClass-v2

Note: I have only tested the GPIO read function, since that is what I'm trying to do for my project.

Edit 2/20/19
The GPIO Class approach only worked in C++.  For a C version, I used the sysfs code from this site:
     https://elinux.org/RPi_GPIO_Code_Samples
However, to use the Rock64 GPIO assignments from 100 to 103, I needed to change #define BUFFER_MAX 3 to #define BUFFER_MAX 4. 
This may break things for two digit GPIO assignments.  I didn't really test that


Messages In This Thread
RE: C++ GPIO seg fault on Rock64 using Pine64-CPP - by Jeff R - 02-06-2019, 07:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Disable MicroSD reader for extra GPIO mxruben 0 314 07-27-2024, 10:08 PM
Last Post: mxruben
  Rock64 No Audio @ Debian 12 dmitrymyadzelets 2 1,103 04-08-2024, 06:47 AM
Last Post: dmitrymyadzelets
  OpenWRT on the Rock64 CanadianBacon 14 10,758 04-03-2024, 08:48 AM
Last Post: helpmerock
  Rock64 bricked shawwwn 7 6,991 03-17-2024, 12:22 PM
Last Post: dmitrymyadzelets
  Rock64 won't boot luminosity7 10 5,969 03-16-2024, 08:33 AM
Last Post: dmitrymyadzelets
  Rock64 doesn't boot dstallmo 1 741 03-16-2024, 08:29 AM
Last Post: dmitrymyadzelets
  How well does Rock64 deal with HDR and Atmos on Kodi? drvlikhell 3 2,705 04-29-2023, 04:24 AM
Last Post: newestssd
  Rock64 board not working, no HDMI no Ethernet. EDited 3 4,284 01-17-2023, 02:31 PM
Last Post: Flagtrax
  ROCK64 v3 can it boot from USB? Tsagualsa 4 2,945 11-29-2022, 11:31 AM
Last Post: Macgyver
  rock64 v3 spiflash Macgyver 0 1,053 11-28-2022, 02:18 PM
Last Post: Macgyver

Forum Jump:


Users browsing this thread: 1 Guest(s)