NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: /dev/tty01 will not open on Beaglebone Black
On Thu, 31 Aug 2023, Brook Milligan wrote:
I have attached the test program below, and would appreciate more eyes on it [...]
That looks OK apart from a few minor issues:
- If you want to turn off non-blocking, use the standard idiom instead of
fcntl(fd,F_SETFL,0):
int flg = fcntl(fd, F_GETFL, 0);
fcntl(fd, F_SETFL, flg & ~O_NONBLOCK);
- Call cfmakeraw() _before_ changing settings (not after) because it modifies
some bits (eg. CS8, ~PARENB) itself (see: src/lib/libc/termios/cfmakeraw.c)
However, a write fails and hangs the board hard: no keyboard response, no response to pings.
As the others have said, this looks like a kernel issue. Apropos which: from
your `am335x-boneblack-comm_cape.dts' file:
```
&am33xx_pinmux {
bborg_comms_rs485_pins: pinmux_comms_rs485_pins {
pinctrl-single,pins = <
0x074 (PIN_OUTPUT | MUX_MODE6) /* P9_13: gpmc_wpn.uart4_txd_mux2 */
0x070 (PIN_INPUT | MUX_MODE6) /* P9_11: gpmc_wait0.uart4_rxd_mux2 */
>;
};
};
```
Is that `RS-485' there correct? Shouldn't it be UART or RS-232 or something?
Following the links for the Comms cape from beagleboard.org, I landed here:
https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec#UART
where the `BONE-UART4.dts' has this:
```
&ocp {
P9_13_pinmux { pinctrl-0 = <&P9_13_uart_pin>; }; /* UART TX*/
P9_11_pinmux { pinctrl-0 = <&P9_11_uart_pin>; }; /* UART RX*/
};
&bone_uart_4 {
status = "okay";
};
```
There is also the `BB-UART4-00A0.dts' file here (where you got your .dts from):
https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-UART4-00A0.dts
with different contents:
```
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
&ocp {
P9_13_pinmux { status = "disabled"; }; /* P9_13: uart4_txd */
P9_11_pinmux { status = "disabled"; }; /* P9_11: uart4_rxd */
};
&am33xx_pinmux {
bb_uart4_pins: pinmux_bb_uart4_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_GPMC_WPN, PIN_OUTPUT, MUX_MODE6) /* P9_13 gpmc_wpn.uart4_txd_mux2 */
AM33XX_PADCONF(AM335X_PIN_GPMC_WAIT0, PIN_INPUT, MUX_MODE6) /* P9_13 gpmc_wait0.uart4_rxd_mux2 */
>;
};
};
&uart4 {
/* sudo agetty 115200 ttyS4 */
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_uart4_pins>;
};
```
No idea which is right (not an ARM-guy!). The folks on port-arm@ would know.
HTH,
-RVP
Home |
Main Index |
Thread Index |
Old Index