User Tools

Site Tools


Translations of this page:

en:bpi-r3:gpio

GPIO

Sparefunction Mainfunction pin# xxxxxxxxxxxxxxxxxxxxx pin# Mainfunction Sparefunction
- 3V3 1 2 5V -
I2C_SDA GPIO 4 3 4 5V -
I2C SCL GPIO 3 5 6 GND -
PWM1 GPIO 22 7 8 GPIO 43 UART1 TX
- GND 9 10 GPIO 42 UART1 RX
UART2 TX GPIO 30 11 12 GPIO 64 PCM_CLK
UART2 RX GPIO 29 13 14 GND -
PCM_FS GPIO 65 15 16 GPIO 45 UART1_RTS
- 3V3 17 18 GPIO 44 UART1_CTS
SPIC_MO GPIO 7 19 20 GND -
SPIC_MI GPIO 8 21 22 GPIO 62 PCM_DTX
SPIC_CK GPIO 6 23 24 GPIO 14 SPIC_CS
- GND 25 26 GPIO 63 PCM_DRX

R2-gpio (sysfs) R2Pro-gpio (gpiolib)

UART

first get serial device of uart1 (0x11003000):

root@bpi-r3:~# dmesg | grep ttyS
[    0.250249] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 116, base_baud = 2500000) is a ST16650V2
[    0.250315] printk: legacy console [ttyS0] enabled
[    1.312721] 11003000.serial: ttyS1 at MMIO 0x11003000 (irq = 117, base_baud = 1625000) is a ST16650V2
[    1.343287] 11004000.serial: ttyS2 at MMIO 0x11004000 (irq = 118, base_baud = 1625000) is a ST16650V2
[    4.585845] systemd[1]: Expecting device dev-ttyS0.device - /dev/ttyS0...

using uart1 as debug-console logger

root@bpi-r3:~# stty -F /dev/ttyS1 115200 cs8 -cstopb -parenb                                                                           
root@bpi-r3:~# echo "TEST" > /dev/ttyS1
root@bpi-r3:~# dmesg --follow > /dev/ttyS1 &

using a second console parameter in cmdline does not work. default speed is 9600 baud

root@bpi-r3:~# stty -F /dev/ttyS1 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc

openlog uartlogger from tstar (aliexpress) recognizes baud-setting and can log without additional config and so only the dmesg line is needed at bootup.

en/bpi-r3/gpio.txt · Last modified: by frank