-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UART on a Raspberry Pi 5 using GPIO 14/15. #165
Comments
Hi @Dygear. I'm not seeing any obvious problems in your code. There are a few things you could try to debug the issue:
|
I forgot to mention |
Updated the let mut uart = match Uart::with_path("/dev/ttyAMA0", 57600, Parity::None, 8, 1) {
Ok(uart) => uart,
Err(e) => panic!("UART Setup Error: {e}")
}; I'm now able to talk to the device. Thanks for the help and putting me on the correct path. For what it's worth, here's the output of Looks like dygear@MimoFPS-DEV:~ $ ls -lha /dev/
total 4.0K
drwxr-xr-x 16 root root 4.1K Nov 5 09:40 .
drwxr-xr-x 18 root root 4.0K Oct 22 09:13 ..
crw-r--r-- 1 root root 10, 235 Nov 5 09:40 autofs
drwxr-xr-x 2 root root 580 Nov 5 09:40 block
crw------- 1 root root 10, 234 Nov 5 09:40 btrfs-control
drwxr-xr-x 3 root root 60 Nov 5 09:40 bus
crw------- 1 root root 10, 126 Nov 5 09:40 cachefiles
crw-rw---- 1 root video 511, 0 Nov 5 09:40 cec0
crw-rw---- 1 root video 511, 1 Nov 5 09:40 cec1
drwxr-xr-x 2 root root 3.4K Nov 5 09:40 char
crw--w---- 1 root tty 5, 1 Nov 5 09:40 console
crw------- 1 root root 10, 124 Nov 5 09:40 cpu_dma_latency
crw------- 1 root root 10, 203 Nov 5 09:40 cuse
drwxr-xr-x 8 root root 160 Nov 5 09:40 disk
drwxr-xr-x 2 root root 100 Nov 5 09:40 dma_heap
drwxr-xr-x 3 root root 120 Nov 5 09:40 dri
lrwxrwxrwx 1 root root 13 Nov 5 09:40 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Nov 5 09:40 full
crw-rw-rw- 1 root root 10, 229 Nov 5 09:40 fuse
crw-rw---- 1 root gpio 254, 0 Nov 5 09:40 gpiochip0
crw-rw---- 1 root gpio 254, 10 Nov 5 09:40 gpiochip10
crw-rw---- 1 root gpio 254, 11 Nov 5 09:40 gpiochip11
crw-rw---- 1 root gpio 254, 12 Nov 5 09:40 gpiochip12
crw-rw---- 1 root gpio 254, 13 Nov 5 09:40 gpiochip13
lrwxrwxrwx 1 root root 9 Nov 5 09:40 gpiochip4 -> gpiochip0
crw-rw---- 1 root gpio 235, 0 Nov 5 09:40 gpiomem0
crw-rw---- 1 root gpio 239, 0 Nov 5 09:40 gpiomem1
crw-rw---- 1 root gpio 238, 0 Nov 5 09:40 gpiomem2
crw-rw---- 1 root gpio 237, 0 Nov 5 09:40 gpiomem3
crw-rw---- 1 root gpio 236, 0 Nov 5 09:40 gpiomem4
crw------- 1 root root 10, 183 Nov 5 09:40 hwrng
lrwxrwxrwx 1 root root 12 Nov 5 09:40 initctl -> /run/initctl
drwxr-xr-x 3 root root 180 Nov 5 09:40 input
crw-r--r-- 1 root root 1, 11 Nov 5 09:40 kmsg
crw-rw---- 1 root kvm 10, 232 Nov 5 09:40 kvm
lrwxrwxrwx 1 root root 28 Nov 5 09:40 log -> /run/systemd/journal/dev-log
brw-rw---- 1 root disk 7, 0 Nov 5 09:40 loop0
brw-rw---- 1 root disk 7, 1 Nov 5 09:40 loop1
brw-rw---- 1 root disk 7, 2 Nov 5 09:40 loop2
brw-rw---- 1 root disk 7, 3 Nov 5 09:40 loop3
brw-rw---- 1 root disk 7, 4 Nov 5 09:40 loop4
brw-rw---- 1 root disk 7, 5 Nov 5 09:40 loop5
brw-rw---- 1 root disk 7, 6 Nov 5 09:40 loop6
brw-rw---- 1 root disk 7, 7 Nov 5 09:40 loop7
crw-rw---- 1 root disk 10, 237 Nov 5 09:40 loop-control
drwxr-xr-x 2 root root 60 Nov 5 09:40 mapper
crw-rw---- 1 root video 234, 0 Nov 5 09:40 media0
crw-rw---- 1 root video 234, 1 Nov 5 09:40 media1
crw-rw---- 1 root video 234, 2 Nov 5 09:40 media2
crw-r----- 1 root kmem 1, 1 Nov 5 09:40 mem
brw-rw---- 1 root disk 179, 0 Nov 5 09:40 mmcblk0
brw-rw---- 1 root disk 179, 1 Nov 5 09:40 mmcblk0p1
brw-rw---- 1 root disk 179, 2 Nov 5 09:40 mmcblk0p2
drwxrwxrwt 2 root root 40 Dec 31 1969 mqueue
drwxr-xr-x 2 root root 60 Nov 5 09:40 net
crw-rw-rw- 1 root root 1, 3 Nov 5 09:40 null
crw-r----- 1 root kmem 1, 4 Nov 5 09:40 port
crw------- 1 root root 108, 0 Nov 5 09:40 ppp
crw------- 1 root root 250, 0 Nov 5 09:40 pps0
crw-rw-rw- 1 root tty 5, 2 Nov 5 16:28 ptmx
crw------- 1 root root 249, 0 Nov 5 09:40 ptp0
drwxr-xr-x 2 root root 0 Nov 5 09:40 pts
brw-rw---- 1 root disk 1, 0 Nov 5 09:40 ram0
brw-rw---- 1 root disk 1, 1 Nov 5 09:40 ram1
brw-rw---- 1 root disk 1, 10 Nov 5 09:40 ram10
brw-rw---- 1 root disk 1, 11 Nov 5 09:40 ram11
brw-rw---- 1 root disk 1, 12 Nov 5 09:40 ram12
brw-rw---- 1 root disk 1, 13 Nov 5 09:40 ram13
brw-rw---- 1 root disk 1, 14 Nov 5 09:40 ram14
brw-rw---- 1 root disk 1, 15 Nov 5 09:40 ram15
brw-rw---- 1 root disk 1, 2 Nov 5 09:40 ram2
brw-rw---- 1 root disk 1, 3 Nov 5 09:40 ram3
brw-rw---- 1 root disk 1, 4 Nov 5 09:40 ram4
brw-rw---- 1 root disk 1, 5 Nov 5 09:40 ram5
brw-rw---- 1 root disk 1, 6 Nov 5 09:40 ram6
brw-rw---- 1 root disk 1, 7 Nov 5 09:40 ram7
brw-rw---- 1 root disk 1, 8 Nov 5 09:40 ram8
brw-rw---- 1 root disk 1, 9 Nov 5 09:40 ram9
crw-rw-rw- 1 root root 1, 8 Nov 5 09:40 random
crw-rw-r-- 1 root netdev 10, 242 Nov 5 09:40 rfkill
lrwxrwxrwx 1 root root 4 Nov 5 09:40 rtc -> rtc0
crw------- 1 root root 252, 0 Nov 5 09:40 rtc0
lrwxrwxrwx 1 root root 8 Nov 5 09:40 serial0 -> ttyAMA10
drwxrwxrwt 2 root root 40 Nov 5 09:40 shm
drwxr-xr-x 3 root root 180 Nov 5 09:40 snd
crw-rw---- 1 root spi 153, 0 Nov 5 09:40 spidev10.0
lrwxrwxrwx 1 root root 15 Nov 5 09:40 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Nov 5 09:40 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Nov 5 09:40 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root tty 5, 0 Nov 5 15:00 tty
crw--w---- 1 root tty 4, 0 Nov 5 09:40 tty0
crw--w---- 1 root tty 4, 1 Nov 5 09:40 tty1
crw--w---- 1 root tty 4, 10 Nov 5 09:40 tty10
crw--w---- 1 root tty 4, 11 Nov 5 09:40 tty11
crw--w---- 1 root tty 4, 12 Nov 5 09:40 tty12
crw--w---- 1 root tty 4, 13 Nov 5 09:40 tty13
crw--w---- 1 root tty 4, 14 Nov 5 09:40 tty14
crw--w---- 1 root tty 4, 15 Nov 5 09:40 tty15
crw--w---- 1 root tty 4, 16 Nov 5 09:40 tty16
crw--w---- 1 root tty 4, 17 Nov 5 09:40 tty17
crw--w---- 1 root tty 4, 18 Nov 5 09:40 tty18
crw--w---- 1 root tty 4, 19 Nov 5 09:40 tty19
crw--w---- 1 root tty 4, 2 Nov 5 09:40 tty2
crw--w---- 1 root tty 4, 20 Nov 5 09:40 tty20
crw--w---- 1 root tty 4, 21 Nov 5 09:40 tty21
crw--w---- 1 root tty 4, 22 Nov 5 09:40 tty22
crw--w---- 1 root tty 4, 23 Nov 5 09:40 tty23
crw--w---- 1 root tty 4, 24 Nov 5 09:40 tty24
crw--w---- 1 root tty 4, 25 Nov 5 09:40 tty25
crw--w---- 1 root tty 4, 26 Nov 5 09:40 tty26
crw--w---- 1 root tty 4, 27 Nov 5 09:40 tty27
crw--w---- 1 root tty 4, 28 Nov 5 09:40 tty28
crw--w---- 1 root tty 4, 29 Nov 5 09:40 tty29
crw--w---- 1 root tty 4, 3 Nov 5 09:40 tty3
crw--w---- 1 root tty 4, 30 Nov 5 09:40 tty30
crw--w---- 1 root tty 4, 31 Nov 5 09:40 tty31
crw--w---- 1 root tty 4, 32 Nov 5 09:40 tty32
crw--w---- 1 root tty 4, 33 Nov 5 09:40 tty33
crw--w---- 1 root tty 4, 34 Nov 5 09:40 tty34
crw--w---- 1 root tty 4, 35 Nov 5 09:40 tty35
crw--w---- 1 root tty 4, 36 Nov 5 09:40 tty36
crw--w---- 1 root tty 4, 37 Nov 5 09:40 tty37
crw--w---- 1 root tty 4, 38 Nov 5 09:40 tty38
crw--w---- 1 root tty 4, 39 Nov 5 09:40 tty39
crw--w---- 1 root tty 4, 4 Nov 5 09:40 tty4
crw--w---- 1 root tty 4, 40 Nov 5 09:40 tty40
crw--w---- 1 root tty 4, 41 Nov 5 09:40 tty41
crw--w---- 1 root tty 4, 42 Nov 5 09:40 tty42
crw--w---- 1 root tty 4, 43 Nov 5 09:40 tty43
crw--w---- 1 root tty 4, 44 Nov 5 09:40 tty44
crw--w---- 1 root tty 4, 45 Nov 5 09:40 tty45
crw--w---- 1 root tty 4, 46 Nov 5 09:40 tty46
crw--w---- 1 root tty 4, 47 Nov 5 09:40 tty47
crw--w---- 1 root tty 4, 48 Nov 5 09:40 tty48
crw--w---- 1 root tty 4, 49 Nov 5 09:40 tty49
crw--w---- 1 root tty 4, 5 Nov 5 09:40 tty5
crw--w---- 1 root tty 4, 50 Nov 5 09:40 tty50
crw--w---- 1 root tty 4, 51 Nov 5 09:40 tty51
crw--w---- 1 root tty 4, 52 Nov 5 09:40 tty52
crw--w---- 1 root tty 4, 53 Nov 5 09:40 tty53
crw--w---- 1 root tty 4, 54 Nov 5 09:40 tty54
crw--w---- 1 root tty 4, 55 Nov 5 09:40 tty55
crw--w---- 1 root tty 4, 56 Nov 5 09:40 tty56
crw--w---- 1 root tty 4, 57 Nov 5 09:40 tty57
crw--w---- 1 root tty 4, 58 Nov 5 09:40 tty58
crw--w---- 1 root tty 4, 59 Nov 5 09:40 tty59
crw--w---- 1 root tty 4, 6 Nov 5 09:40 tty6
crw--w---- 1 root tty 4, 60 Nov 5 09:40 tty60
crw--w---- 1 root tty 4, 61 Nov 5 09:40 tty61
crw--w---- 1 root tty 4, 62 Nov 5 09:40 tty62
crw--w---- 1 root tty 4, 63 Nov 5 09:40 tty63
crw--w---- 1 root tty 4, 7 Nov 5 09:40 tty7
crw--w---- 1 root tty 4, 8 Nov 5 09:40 tty8
crw--w---- 1 root tty 4, 9 Nov 5 09:40 tty9
crw-rw---- 1 root dialout 204, 64 Nov 5 16:26 ttyAMA0
crw-rw---- 1 root dialout 204, 74 Nov 5 15:18 ttyAMA10
crw------- 1 root root 5, 3 Nov 5 09:40 ttyprintk
crw------- 1 root root 10, 239 Nov 5 09:40 uhid
crw------- 1 root root 10, 223 Nov 5 09:40 uinput
crw-rw-rw- 1 root root 1, 9 Nov 5 09:40 urandom
drwxr-xr-x 3 root root 60 Nov 5 09:40 v4l
crw-rw---- 1 root video 10, 125 Nov 5 09:40 vcio
crw------- 1 root root 246, 0 Nov 5 09:40 vc-mem
crw-rw---- 1 root tty 7, 0 Nov 5 09:40 vcs
crw-rw---- 1 root tty 7, 1 Nov 5 09:40 vcs1
crw-rw---- 1 root tty 7, 2 Nov 5 09:40 vcs2
crw-rw---- 1 root tty 7, 3 Nov 5 09:40 vcs3
crw-rw---- 1 root tty 7, 4 Nov 5 09:40 vcs4
crw-rw---- 1 root tty 7, 5 Nov 5 09:40 vcs5
crw-rw---- 1 root tty 7, 6 Nov 5 09:40 vcs6
crw-rw---- 1 root tty 7, 128 Nov 5 09:40 vcsa
crw-rw---- 1 root tty 7, 129 Nov 5 09:40 vcsa1
crw-rw---- 1 root tty 7, 130 Nov 5 09:40 vcsa2
crw-rw---- 1 root tty 7, 131 Nov 5 09:40 vcsa3
crw-rw---- 1 root tty 7, 132 Nov 5 09:40 vcsa4
crw-rw---- 1 root tty 7, 133 Nov 5 09:40 vcsa5
crw-rw---- 1 root tty 7, 134 Nov 5 09:40 vcsa6
crw-rw---- 1 root tty 7, 64 Nov 5 09:40 vcsu
crw-rw---- 1 root tty 7, 65 Nov 5 09:40 vcsu1
crw-rw---- 1 root tty 7, 66 Nov 5 09:40 vcsu2
crw-rw---- 1 root tty 7, 67 Nov 5 09:40 vcsu3
crw-rw---- 1 root tty 7, 68 Nov 5 09:40 vcsu4
crw-rw---- 1 root tty 7, 69 Nov 5 09:40 vcsu5
crw-rw---- 1 root tty 7, 70 Nov 5 09:40 vcsu6
crw------- 1 root root 10, 127 Nov 5 09:40 vga_arbiter
crw------- 1 root root 10, 137 Nov 5 09:40 vhci
crw-rw---- 1 root kvm 10, 238 Nov 5 09:40 vhost-net
crw-rw---- 1 root kvm 10, 241 Nov 5 09:40 vhost-vsock
crw-rw---- 1 root video 81, 16 Nov 5 09:40 video19
crw-rw---- 1 root video 81, 0 Nov 5 09:40 video20
crw-rw---- 1 root video 81, 1 Nov 5 09:40 video21
crw-rw---- 1 root video 81, 2 Nov 5 09:40 video22
crw-rw---- 1 root video 81, 3 Nov 5 09:40 video23
crw-rw---- 1 root video 81, 4 Nov 5 09:40 video24
crw-rw---- 1 root video 81, 5 Nov 5 09:40 video25
crw-rw---- 1 root video 81, 6 Nov 5 09:40 video26
crw-rw---- 1 root video 81, 7 Nov 5 09:40 video27
crw-rw---- 1 root video 81, 8 Nov 5 09:40 video28
crw-rw---- 1 root video 81, 9 Nov 5 09:40 video29
crw-rw---- 1 root video 81, 10 Nov 5 09:40 video30
crw-rw---- 1 root video 81, 11 Nov 5 09:40 video31
crw-rw---- 1 root video 81, 12 Nov 5 09:40 video32
crw-rw---- 1 root video 81, 13 Nov 5 09:40 video33
crw-rw---- 1 root video 81, 14 Nov 5 09:40 video34
crw-rw---- 1 root video 81, 15 Nov 5 09:40 video35
crw------- 1 root root 10, 130 Nov 5 09:40 watchdog
crw------- 1 root root 248, 0 Nov 5 09:40 watchdog0
crw-rw-rw- 1 root root 1, 5 Nov 5 09:40 zero Did you ever get a Raspberry Pi 5 to use for testing? |
Glad to hear that fixed the issue!
Hmm interesting. Thanks for pointing that out. I haven't checked for UART issues on the Pi 5. I may have to change the default device depending on which Pi is used. Using
I did. I'll have to look into what default options make sense for the Pi 5. Based on your forum post I should also update the documentation on how to configure UART since that seems to have changed. |
The Raspberry Pi side of documentation wasn't that helpful. It was only in the forums that I found out about the
I did disable bluetooth services (with |
After getting some help in the Raspberry Pi forums, on how to configure GPIO 14 & 15 for UART TX / RX, I was able to get the device talking to my Raspberry Pi 5 and confirm that the wiring was correct. When attempting to use rppal to talk to the device, I was unable to send or receive data. Any commands I issued did not produce any results on the device, and I did not receive any feedback from the device either. I read though #127 to see if I had a configuration issue, but it looks like it should just work?
When using
minicom -b 57600 -o -D /dev/ttyAMA0
I can see0x55
(ASCII U) from the device showing that it is talking over that port. It just doesn't look like rppal is picking up that connection. Is there something that I should be doing to configure rrpal to use thettyAMA0
connection on the Raspberry Pi 5?My
Cargo.toml
looks like this:The rest of the code can be found on this repo.
https://github.com/Dygear/rpi-r503
The output of gpio_status may be helpful, so here it is:
The text was updated successfully, but these errors were encountered: