Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: impossible to access /dev/mem on RPi B+ [Was: Sound issues on RPi B+, Jun's latest image]



domelevo%gmail.com@localhost (Jean-Baka Domelevo Entfellner) writes:

>(1) The most important issue is the impossible access to /dev/mem, even
>being root. This character device is registered in /dev/ with major=0 and
>minor=0. user is root, group is kmem and rights are rw-r-----. Apparently
>this prevents full use of the GPIO as we have to map memory regions, like
>in the code snippet given at the end of this email (taken from
>http://elinux.org/RPi_Low-level_peripherals#C).

You should use the gpio driver. It is also subject to secure_level
considerations, you need to assign the correct modes to it at
boot time in /etc/gpio.conf and enable gpio=YES in rc.conf.

Without an INSECURE kernel, you cannot change the gpio definitions
after the system has booted up to multiuser.


Without any warranty, this should be correct for the first RPI
models (B+ and RPI2 are probably different), and I haven't tried
anything but the 'activity' LED.


# RPI P1 Header Rev1
#
#                                                  spi0
#              tx  rx  pcm                        ce0  ce1
#  02  04  06  08  10  12  14   16  18  20   22   24   26
#  01  03  05  07  09  11  13   15  17  19   21   23   25
#      sda scl gpc         dout         mosi miso sclk
#       i2c0               cpm               spi0
#

# GPIO0..31
#gpio0  0 set in i2c0_sda
#gpio0  1 set in i2c0_scl
#gpio0  4 set in gpclk0
#gpio0  7 set in spi0_ce1_n
#gpio0  8 set in spi0_ce0_n
#gpio0  9 set in spi0_miso
#gpio0 10 set in spi0_mosi
#gpio0 11 set in spi0_sclk
#gpio0 14 set in uart0_txd
#gpio0 15 set in uart0_rxd
gpio0 16 set out led_d5
#gpio0 17 set in spi1_ce1_n
#gpio0 18 set in spi1_ce0_n
#gpio0 21 set in sd1_dat3
#gpio0 22 set in sd1_clk
#gpio0 23 set in sd1_cmd
#gpio0 24 set in sd1_dat0
#gpio0 25 set in sd1_dat1
#gpio0 28 set in boardid0
#gpio0 29 set in boardid1
#gpio0 30 set in boardid2
#gpio0 31 set in boardid3

# GPIO32..53
#gpio1  8 set in audio0
#gpio1 13 set in audio1
#gpio1 14 set in hdmi_hotplug
#gpio1 15 set in sdcard_detect
#gpio1 16 set in sdcard0
#gpio1 17 set in sdcard1
#gpio1 18 set in sdcard2
#gpio1 19 set in sdcard3
#gpio1 20 set in sdcard4
#gpio1 21 set in sdcard5





>(2) Concerning audio output, everything is fine now, except that I have no
>clue how to control the volume level and that it is impossible to do it
>from within mplayer (no error output, but controls are ineffective).

Never worked for me either, the firmware seems to ignore the
volume setting.


-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index