Damned RPi3 !

A project log for C GPIO library for Raspberry Pi

Lightweight GPL'd #include for your C programs

Yann Guidon / YGDESYann Guidon / YGDES 02/16/2017 at 17:340 Comments

Trying to turn a LED on with the lib on a RPi3 using the slim image. and work but not the C code.

The culprit is found easily because doesn't return anything (despite being on RPi3).

pi@raspberrypi:~/ $ cat /proc/iomem 
00000000-3affffff : System RAM
  00008000-007ea673 : Kernel code
  00862000-009901eb : Kernel data
3f007000-3f007eff : /soc/dma@7e007000
3f200000-3f2000b3 : /soc/gpio@7e200000
3f201000-3f201fff : /soc/uart@7e201000
  3f201000-3f201fff : /soc/uart@7e201000
3f300000-3f3000ff : /soc/mmc@7e300000

The expected keyword is not found ! Instead of bcm2708_gpio, I get /soc/gpio

Another thing is that I forgot to enable the device tree... But a keyword can be added:

grep -E '/soc/gpio|bcm2708_gpio' /proc/iomem


pi@raspberrypi:~/projets/files $ . 
3f200000-3f2000b3 : /soc/gpio@7e200000
pi@raspberrypi:~/projets/files $ echo $GPIO_BASE 

Seems legit... But I still have to test with the device tree.

20180118 : don't forget to run the detection script as ROOT !

pi@raspberrypi$ sudo 

Raspbian now returns invalid values when run as user:

 $ cat /proc/iomem
00000000-00000000 : System RAM
  00000000-00000000 : Kernel code
  00000000-00000000 : Kernel data
00000000-00000000 : dwc_otg

(I should update my files......)