We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 829f97a commit c749402Copy full SHA for c749402
README.md
@@ -206,6 +206,17 @@ if ser.isOpen():
206
ser.write("Hello World!")
207
ser.close()
208
```
209
+* Available UART names on BeagleBone
210
+ * `UART1`: /dev/ttyO1, Rx: P9_26, Tx: P9_24
211
+ * `UART2`: /dev/ttyO2, Rx: P9_22, Tx: P9_21
212
+ * `UART3`: /dev/ttyO3, Rx: P9_42, Tx: none
213
+ * `UART4`: /dev/ttyO4, Rx: P9_11, Tx: P9_13
214
+ * `UART5`: /dev/ttyO5, Rx: P8_38, Tx: P8_37
215
+ * note: `UART5` requires `disable_uboot_overlay_video=1` in `/boot/uEnv.txt`
216
+* Available UART names on PocketBeagle
217
+ * `PB-UART0`: /dev/ttyO0, Rx: P1_30, Tx: P1_32
218
+ * `PB-UART1`: /dev/ttyO1, Rx: P2_11, Tx: P2_09
219
+ * `PB-UART2`: /dev/ttyO2, Rx: P1_08, Tx: P1_10
220
* [Loopback test with UART1 and UART2](https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart#testing-and-using-the-uart)
221
222
source/common.c
@@ -263,12 +263,24 @@ pins_t table[] = {
263
{ NULL, NULL, 0, 0, 0 }
264
};
265
266
+// Issue #243: UART setup not working for pocket beagle pins
267
+// Add UART entries for the PocketBeagle:
268
+// P1_30 uart0_txd
269
+// P1_32 uart0_rxd
270
+// P2_11 uart1_rxd
271
+// P2_09 uart1_txd
272
+// P1_08 uart2_rxd
273
+// P1_10 uart2_txd
274
+
275
uart_t uart_table[] = {
276
{ "UART1", "/dev/ttyO1", "ADAFRUIT-UART1", "P9_26", "P9_24"},
277
{ "UART2", "/dev/ttyO2", "ADAFRUIT-UART2", "P9_22", "P9_21"},
278
{ "UART3", "/dev/ttyO3", "ADAFRUIT-UART3", "P9_42", ""},
279
{ "UART4", "/dev/ttyO4", "ADAFRUIT-UART4", "P9_11", "P9_13"},
280
{ "UART5", "/dev/ttyO5", "ADAFRUIT-UART5", "P8_38", "P8_37"},
281
+ { "PB-UART0", "/dev/ttyO0", "ADAFRUIT-UART0", "P1_30", "P1_32"},
282
+ { "PB-UART1", "/dev/ttyO1", "ADAFRUIT-UART1", "P2_11", "P2_09"},
283
+ { "PB-UART2", "/dev/ttyO2", "ADAFRUIT-UART2", "P1_08", "P1_10"},
284
285
286
test/test_uart.py
@@ -1,4 +1,5 @@
1
import pytest
2
+import serial
3
import platform
4
5
import Adafruit_BBIO.UART as UART
@@ -11,7 +12,7 @@ def teardown_module(module):
11
12
# ADC.cleanup()
13
14
-class TestAdc:
15
+class TestUart:
16
def test_setup_uart_wrong_name(self):
17
if kernel >= '4.1.0':
18
pass
@@ -25,9 +26,39 @@ def test_setup_adc(self):
25
26
else:
27
UART.setup("UART1")
28
- def test_setup_adc_multiple(self):
29
+ def test_setup_uart_multiple(self):
30
31
32
33
34
35
36
+ # test UART entries for the PocketBeagle (issue #243)
37
+ def test_pocketbeagle(self):
38
+ if kernel < '4.1.0':
39
+ pass
40
+ value = open('/proc/device-tree/model').read()
41
+ if(value.startswith("TI AM335x PocketBeagle")):
42
+ uarts = {
43
+ 'PB-UART0': '/dev/ttyO0',
44
+ 'PB-UART1': '/dev/ttyO1',
45
+ 'PB-UART2': '/dev/ttyO2',
46
+ }
47
+ else:
48
49
+ 'UART1': '/dev/ttyO1',
50
+ 'UART2': '/dev/ttyO2',
51
+ 'UART4': '/dev/ttyO4'
52
+ # note: UART5 requires
53
+ # "disable_uboot_overlay_video=1" in /boot/uEnv.txt
54
+ #'UART5': '/dev/ttyO5'
55
56
57
+ for name, device in sorted(uarts.items()):
58
+ UART.setup(name)
59
+ uart = serial.Serial(port = device, baudrate=9600)
60
+ uart.close()
61
+ uart.open()
62
+ if uart.isOpen():
63
+ uart.write("hello world".encode("utf-8"))
64
0 commit comments