File: bsd_notes.txt

package info (click to toggle)
picocom 3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 584 kB
  • sloc: ansic: 4,685; makefile: 69; sh: 12
file content (131 lines) | stat: -rw-r--r-- 3,801 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

Notes about running picocom on BSD-based OSes
=============================================

by Joe Merten (https://github.com/JoeMerten)

Test environment
================

- VirtualBox host Kubuntu 16.04
- FreeBsd 11.0 (VM)
- OpenBsd 6.2 (VM)
- NetBsd 7.1.1 (VM)
- Dragonfly 5.0.2 (VM)
- OSX 10.11.6 El Capitan (native on Macbook Pro)
- macOS 10.12 Sierra (native on Macbook Pro)
- Kubuntu 16.04 (native on Macbook Pro)
- all above on Intel x86 64 Bit
  
- Cygwin 5.1 on Windows XP 32 Bit host
  
- Ftdi FT232R, max 1MBaud (chip can 3MBaud, but hw rs232 level shifter
  is specified for just 1MBaud)
- Prolific PL2303, max 230kBaud (chip can 12MBaud, but hw rs232 level
  shifter is specified for just 230kBaud)
- Unknown Asus onboard (16550 compatible?) uart chip, max 115kBaud.
  Just minor testing with this uart, because it seems that it don't
  supports non standard baudrates.

For Cygwin, I'd just checked if it will build and ran `picocom
-h`. I'd personally failed opening a serial port within Cygwin.
Note that for Cygwin it needs to implement a `cfmakeraw()`
replacement. See also:

https://cygwin.com/ml/cygwin/2008-09/msg00295.html
https://sourceforge.net/p/ser2net/patches/9/
https://sourceforge.net/p/ser2net/patches/_discuss/thread/8b87fdad/ed37/attachment/ser2net-2.2-cygwin.patch


Accessing serial ports (examples)
=================================

- Kubuntu:
  /dev/ttyS0
  /dev/ttyUSB0

- FreeBsd:
  /dev/ttyu0
  /dev/ttyU0

- OpenBsd:
  /dev/cuaU0

- NetBsd:
  /dev/ttyU0

- Dragonfly:
  /dev/ttyU0

- macOS
  /dev/tty.usbserial-FTGNI4B7  (Ftdi)
  /dev/tty.usbserial           (Prolific)


Manual controlling handshake lines
==================================

All above listed Bsd variants (FreeBsd, OpenBsd, NetBsd, Dragonfly and
even macOS) fail when trying to reset the handshake lines (RTS and
DTR) using `tcsetattr()` and setting the baudrate to zero. They all
basically work with the TIOCM[BIC|BIS|GET] `ioctl()`s. However, there
are still some issues regarding RTS and DTR control for OpenBsd,
NetBsd and Dragonfly (see details below).


Custom Baudrates
================

Tested with 80000 baud. Most Bsd variants (except NetBsd) worked well
with Ftdi, but not with the Prolific adapter (see details below).
Linux and OSX / macOS still work with both adapters.


Issues
======

FreeBsd
-------

- Custom Baudrates work well with Ftdi adapter. But with Prolific
  adapter, baudrate switched silently to 9600 baud.

OpenBsd
-------

- `term_get_mctl()` sometimes reports wrong values for rts and dtr
  state (after port open).
- `--lower-rts` works as expected, but `--lower-dtr` lowers both rts
  and dtr lines. Same for interactive toggle via `[C-t]` and
  `[C-g]`. Toggle rts via `[C-g]` works but toggle dtr via `[C-t]`
  also changes the state of rts (and `term_get_mctl()` reports wrong
  rts state afterwards).
- Issues occurs with both Ftdi and Prolific adapters.
- Custom baudrates with Prolific adapter has the same issue as in
  FreeBsd.

NetBsd
------

- `term_get_mctl()` sometimes reports wrong values for rts and dtr
  state (after port open)
- Issue occurs with both Ftdi and Prolific adapters.
- Seems that there is no support for custom baudrates.
  - With Ftdi adapter: "Cannot set the device attributes: Invalid
    argument".
  - With Prolific adapter no error message but same behaviour as in
    FreeBsd.

Dragonfly
---------

- Got "FATAL: cannot lock /dev/ttyU0: Operation not supported" on
  startup.  Need to pass `--nolock` or build with `#define USE_FLOCK`
  not set.
- `term_get_mctl()` sometimes reports wrong state for dtr, e.g. when
  passing `--lower-dtr`.
- When exit via `[C-x]`, got "term_exitfunc: reset failed for dev
  /dev/ttyU0: Invalid argument".
- Custom baudrates with Prolific adapter has the same issue as in
  FreeBsd.