Mikeynl
Posts: 20
Joined: Sat Nov 11, 2017 1:36 pm

custom cm3 board uart0 & uart1

Thu May 31, 2018 4:05 pm

Hi,

I am trying to enable the uart0 and uart1 interface on the cm3 module. But cant get them to work.
2018-05-31 18_00_33-Window.png
2018-05-31 18_00_33-Window.png (25.22 KiB) Viewed 608 times
They are wired straight, see image above.

In the DTS file i have them like this:

[email protected] { function = "uart1"; termination = "no_pulling"; drive_strength_mA = < 8 >; }; // UART1 TX
[email protected] { function = "uart1"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // UART1 RX
[email protected] { function = "uart0"; termination = "no_pulling"; drive_strength_mA = < 8 >; }; // UART0 TX
[email protected] { function = "uart0"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // UART0 RX

in cmdline.txt:
console=serial0,115200

in config.txt
enable_uart=1
dtparam=uart0=on
dtparam=uart1=on

The following tty's are created:

lrwxrwxrwx 1 root root 7 May 31 15:48 serial0 -> ttyAMA0
crw-rw-rw- 1 root tty 5, 0 May 31 16:02 tty
crw--w---- 1 root tty 4, 0 May 31 15:48 tty0
crw------- 1 pi tty 4, 1 May 31 15:48 tty1
crw--w---- 1 root tty 4, 10 May 31 15:48 tty10
crw--w---- 1 root tty 4, 11 May 31 15:48 tty11
crw--w---- 1 root tty 4, 12 May 31 15:48 tty12
crw--w---- 1 root tty 4, 13 May 31 15:48 tty13
crw--w---- 1 root tty 4, 14 May 31 15:48 tty14
crw--w---- 1 root tty 4, 15 May 31 15:48 tty15
crw--w---- 1 root tty 4, 16 May 31 15:48 tty16
crw--w---- 1 root tty 4, 17 May 31 15:48 tty17
crw--w---- 1 root tty 4, 18 May 31 15:48 tty18
crw--w---- 1 root tty 4, 19 May 31 15:48 tty19
crw--w---- 1 root tty 4, 2 May 31 15:48 tty2
crw--w---- 1 root tty 4, 20 May 31 15:48 tty20
crw--w---- 1 root tty 4, 21 May 31 15:48 tty21
crw--w---- 1 root tty 4, 22 May 31 15:48 tty22
crw--w---- 1 root tty 4, 23 May 31 15:48 tty23
crw--w---- 1 root tty 4, 24 May 31 15:48 tty24
crw--w---- 1 root tty 4, 25 May 31 15:48 tty25
crw--w---- 1 root tty 4, 26 May 31 15:48 tty26
crw--w---- 1 root tty 4, 27 May 31 15:48 tty27
crw--w---- 1 root tty 4, 28 May 31 15:48 tty28
crw--w---- 1 root tty 4, 29 May 31 15:48 tty29
crw--w---- 1 root tty 4, 3 May 31 15:48 tty3
crw--w---- 1 root tty 4, 30 May 31 15:48 tty30
crw--w---- 1 root tty 4, 31 May 31 15:48 tty31
crw--w---- 1 root tty 4, 32 May 31 15:48 tty32
crw--w---- 1 root tty 4, 33 May 31 15:48 tty33
crw--w---- 1 root tty 4, 34 May 31 15:48 tty34
crw--w---- 1 root tty 4, 35 May 31 15:48 tty35
crw--w---- 1 root tty 4, 36 May 31 15:48 tty36
crw--w---- 1 root tty 4, 37 May 31 15:48 tty37
crw--w---- 1 root tty 4, 38 May 31 15:48 tty38
crw--w---- 1 root tty 4, 39 May 31 15:48 tty39
crw--w---- 1 root tty 4, 4 May 31 15:48 tty4
crw--w---- 1 root tty 4, 40 May 31 15:48 tty40
crw--w---- 1 root tty 4, 41 May 31 15:48 tty41
crw--w---- 1 root tty 4, 42 May 31 15:48 tty42
crw--w---- 1 root tty 4, 43 May 31 15:48 tty43
crw--w---- 1 root tty 4, 44 May 31 15:48 tty44
crw--w---- 1 root tty 4, 45 May 31 15:48 tty45
crw--w---- 1 root tty 4, 46 May 31 15:48 tty46
crw--w---- 1 root tty 4, 47 May 31 15:48 tty47
crw--w---- 1 root tty 4, 48 May 31 15:48 tty48
crw--w---- 1 root tty 4, 49 May 31 15:48 tty49
crw--w---- 1 root tty 4, 5 May 31 15:48 tty5
crw--w---- 1 root tty 4, 50 May 31 15:48 tty50
crw--w---- 1 root tty 4, 51 May 31 15:48 tty51
crw--w---- 1 root tty 4, 52 May 31 15:48 tty52
crw--w---- 1 root tty 4, 53 May 31 15:48 tty53
crw--w---- 1 root tty 4, 54 May 31 15:48 tty54
crw--w---- 1 root tty 4, 55 May 31 15:48 tty55
crw--w---- 1 root tty 4, 56 May 31 15:48 tty56
crw--w---- 1 root tty 4, 57 May 31 15:48 tty57
crw--w---- 1 root tty 4, 58 May 31 15:48 tty58
crw--w---- 1 root tty 4, 59 May 31 15:48 tty59
crw--w---- 1 root tty 4, 6 May 31 15:48 tty6
crw--w---- 1 root tty 4, 60 May 31 15:48 tty60
crw--w---- 1 root tty 4, 61 May 31 15:48 tty61
crw--w---- 1 root tty 4, 62 May 31 15:48 tty62
crw--w---- 1 root tty 4, 63 May 31 15:48 tty63
crw--w---- 1 root tty 4, 7 May 31 15:48 tty7
crw--w---- 1 root tty 4, 8 May 31 15:48 tty8
crw--w---- 1 root tty 4, 9 May 31 15:48 tty9

Before is start digging software, would like to know if above is correct.

Thank you !

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1881
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: custom cm3 board uart0 & uart1

Fri Jun 01, 2018 3:13 pm

All configuration files work in (Broadcom) GPIO numbers, not physical pin numbers. It can be confusing, since we tend to use the word pin interchangeably with GPIO, but it is important to be clear that unless we are explicitly referring to the 40-pin header, the CM edge connector or attaching wires then we probably mean GPIO. In this case your dt-blob.dts should include:

Code: Select all

[email protected] { function = "uart0"; termination = "no_pulling"; drive_strength_mA = < 8 >; }; // UART0 TX
[email protected] { function = "uart0"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // UART0 RX
[email protected] { function = "uart1"; termination = "no_pulling"; drive_strength_mA = < 8 >; }; // UART1 TX
[email protected] { function = "uart1"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // UART1 RX
If it still doesn't work with that change, please post the output from "dmesg" and "raspi-gpio get".

Return to “Device Tree”