C++ GPIO seg fault on Rock64 using Pine64-CPP
#1
I'm trying to run the example.cpp that comes with Pine64-CPP from https://github.com/databit/Pine64-CPP

I am throwing segmentation faults when I run.
 
Initializationsucceeds:
The man-setup() call initialzes the board.  I traced the success path to the following if statement in the setup() function in gpio.cpp
    if((uint64_t)gpio_mem % PAGE_SIZE)
And I also traced the successful  "this->gpioMap =" statement to the one that uses SUNXI_GPIO_BASE
    
In the example code, I initialize the pin with
   man->pinMode (PI_GPIO_24, OUTPUT);
 
The pinMode function in gpio.cpp, launches _setPullupdn with gpio=78 and pud = 1.  As expected
Inside _setPullupdn,  the following is set
     bank= 2
     index = 0
    offset = 28
 
The segmentation fault seems to come from this line in gpio.c
   regval = *(&pio->PULL[0] + index);
 
I have a 4 GB Rock64 running armbian bionic desktop from https://www.armbian.com/rock64/
 
sudo cat /sys/kernel/debug/gpio   gives me

GPIOs 0-31, platform/pinctrl, gpio0:
 gpio-0   (                    |vcc_host_5v         ) out hi    
 gpio-2   (                    |?                   ) out lo    
 gpio-30  (                    |vcc_sd              ) out lo    
 
GPIOs 32-63, platform/pinctrl, gpio1:
 gpio-50  (                    |mdio-reset          ) out hi  
 
GPIOs 64-95, platform/pinctrl, gpio2:
 
GPIOs 96-127, platform/pinctrl, gpio3:
 
GPIOs 510-511, platform/rk8xx-gpio, rk8xx-gpio, can sleep:
 gpio-510 (                    |?                   ) out lo    
 gpio-511 (                    |?                   ) out lo   
 
 
Anyone have any thoughts?
Thanks.


Messages In This Thread
C++ GPIO seg fault on Rock64 using Pine64-CPP - by Jeff R - 02-04-2019, 05:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock64 No Audio @ Debian 12 dmitrymyadzelets 2 238 04-08-2024, 06:47 AM
Last Post: dmitrymyadzelets
  OpenWRT on the Rock64 CanadianBacon 14 8,196 04-03-2024, 08:48 AM
Last Post: helpmerock
  Rock64 bricked shawwwn 7 5,610 03-17-2024, 12:22 PM
Last Post: dmitrymyadzelets
  Rock64 won't boot luminosity7 10 4,045 03-16-2024, 08:33 AM
Last Post: dmitrymyadzelets
  Rock64 doesn't boot dstallmo 1 317 03-16-2024, 08:29 AM
Last Post: dmitrymyadzelets
  How well does Rock64 deal with HDR and Atmos on Kodi? drvlikhell 3 1,858 04-29-2023, 04:24 AM
Last Post: newestssd
  Rock64 board not working, no HDMI no Ethernet. EDited 3 3,479 01-17-2023, 02:31 PM
Last Post: Flagtrax
  ROCK64 v3 can it boot from USB? Tsagualsa 4 2,067 11-29-2022, 11:31 AM
Last Post: Macgyver
  rock64 v3 spiflash Macgyver 0 739 11-28-2022, 02:18 PM
Last Post: Macgyver
  my rock64 dosen't work rookie_267 0 939 10-07-2022, 07:50 PM
Last Post: rookie_267

Forum Jump:


Users browsing this thread: 1 Guest(s)