Setup UART pins

This forum is for discussion about general software issues.

Setup UART pins

Postby jesseF » Tue Jun 16, 2020 12:59 pm

I have an Arietta G25 and would like to use a serial port on the GPIO pins I have used the generator at http://linux.tanzilli.com/ to generate a DTB file which I put in /boot/

I now see /dev/ttyS1 but when I try to open the port with picocom I get:
$this->bbcode_second_pass_code('', 'FATAL: failed to add port: Filedes is not a tty
')

I feel like I'm missing a step here, is there a guide I can follow?
jesseF
 
Posts: 24
Joined: Mon Jun 15, 2020 3:36 am

Re: Setup UART pins

Postby jesseF » Sat Jun 20, 2020 3:55 am

Ok, I think I am starting to understand this a bit more although I feel like I am still about where I am.
Tried downloading the following dts file from http://linux.tanzilli.com/ but was unable to get it to compile:
$this->bbcode_second_pass_code('', '
/* acme-arietta.dts - Device Tree file for Arietta G25 */
/dts-v1/;
#include "at91sam9g25.dtsi"
/ {
model = "Acme Systems Arietta G25";
compatible = "acme,ariettag25", "atmel,at91sam9x5", "atmel,at91sam9";
aliases {
serial0 = &dbgu;
};
chosen {
stdout-path = "serial0:115200n8";
bootargs = "mem=256M console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait";
};
memory {
reg = <0x20000000 0x8000000>;
};
clocks {
slow_xtal {
clock-frequency = <32768>;
};
main_xtal {
clock-frequency = <12000000>;
};
};
ahb {
apb {
mmc0: mmc@f0008000 {
pinctrl-0 = <
&pinctrl_mmc0_slot0_clk_cmd_dat0
&pinctrl_mmc0_slot0_dat1_3>;
status = "okay";
slot@0 {
reg = <0>;
bus-width = <4>;
};
};
usart0: serial@f801c000 {
pinctrl-0 = <&pinctrl_usart0>;
status ="okay";
};
usart1: serial@f8020000 {
pinctrl-0 = <&pinctrl_usart1>;
status ="okay";
};
pinctrl@fffff400 {
adc0 {
pinctrl_adc0_ad0: adc0_ad0 {
atmel,pins = <AT91_PIOB 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
};
pinctrl_adc0_ad1: adc0_ad1 {
atmel,pins = <AT91_PIOB 12 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
};
pinctrl_adc0_ad2: adc0_ad2 {
atmel,pins = <AT91_PIOB 13 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
};
pinctrl_adc0_ad3: adc0_ad3 {
atmel,pins = <AT91_PIOB 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
};
};
};

adc0: adc@f804c000 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_adc0_ad0 &pinctrl_adc0_ad1 &pinctrl_adc0_ad2 &pinctrl_adc0_ad3>;
atmel,adc-channels-used = <0xf>;
atmel,adc-num-channels = <4>;
compatible = "atmel,at91sam9x5-adc";
atmel,adc-startup-time = <40>;
atmel,adc-status-register = <0x1c>;
atmel,adc-trigger-register = <0x08>;
atmel,adc-use-external;
atmel,adc-vref = <3250>;
atmel,adc-res = <8 10>;
atmel,adc-res-names = "lowres", "highres";
atmel,adc-use-res = "highres";
trigger@0 {
trigger-name = "continuous";
trigger-value = <0x6>;
};
};

ssc0: ssc@f0010000 {
status = "okay";
};
usb2: gadget@f803c000 {
status = "okay";
};
dbgu: serial@fffff200 {
status = "okay";
};
pinctrl@fffff400 {
};
rtc@fffffeb0 {
status = "okay";
};
};
usb0: ohci@00600000 {
status = "okay";
num-ports = <3>;
};
usb1: ehci@00700000 {
status = "okay";
};
};
leds {
compatible = "gpio-leds";
arietta_led {
label = "arietta_led";
gpios = <&pioB 8 GPIO_ACTIVE_HIGH>; /* PB8 */
linux,default-trigger = "heartbeat";

};
};
};
/* Generated with http://pinout.acmesystems.it */
')
I get the following when I try to compile :
$this->bbcode_second_pass_code('', '
$ dtc -O dtb -o test.dtbo -b 0 -@ generated.dts
Error: generated.dts:3.1-9 syntax error
FATAL ERROR: Unable to parse input tree
')
anyway I realized that that was not a big deal because I could just download the compiled dtb file which I have in boot. basically I still can't use /dev/ttyS0 or /dev/ttyS1 and not sure what I am doing wrong
jesseF
 
Posts: 24
Joined: Mon Jun 15, 2020 3:36 am

Re: Setup UART pins

Postby jesseF » Mon Jun 22, 2020 12:36 pm

So, I'm starting to think that I might have been looking at the wrong things. I found this post https://bbs.archlinux.org/viewtopic.php?id=240036 and this one https://stackoverflow.com/questions/215 ... ty-service

I have run :
$this->bbcode_second_pass_code('', 'systemctl mask serial-getty@ttyS1')
still can't open /dev/ttyS1 though. Now going to try to figure out why ttyS1 is not setup correctly
jesseF
 
Posts: 24
Joined: Mon Jun 15, 2020 3:36 am


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests