From nobody Sun Apr 03 12:39:18 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CD0441A63886 for ; Sun, 3 Apr 2022 12:39:32 +0000 (UTC) (envelope-from mishin@mh.net.ru) Received: from frog.mh.net.ru (mh.balakovo.san.ru [88.147.158.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KWYPt0ztQz3N36 for ; Sun, 3 Apr 2022 12:39:28 +0000 (UTC) (envelope-from mishin@mh.net.ru) Received: from webmail.mh.net.ru (mouse.home [192.168.5.6]) by frog.mh.net.ru (Postfix) with ESMTPSA id 0D75637C15 for ; Sun, 3 Apr 2022 16:39:19 +0400 (+04) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Date: Sun, 03 Apr 2022 16:39:18 +0400 From: Alexander Mishin To: freebsd-arm@freebsd.org Subject: Extra uarts to Rpi4b 8Gb do not work Message-ID: <5b5832ae7bd3f3b642815d179a56ab3a@mh.net.ru> X-Sender: mishin@mh.net.ru Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KWYPt0ztQz3N36 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=mh.net.ru; spf=pass (mx1.freebsd.org: domain of mishin@mh.net.ru designates 88.147.158.22 as permitted sender) smtp.mailfrom=mishin@mh.net.ru X-Spamd-Result: default: False [-3.80 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[mh.net.ru,none]; MLMMJ_DEST(0.00)[freebsd-arm]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12389, ipnet:88.147.128.0/17, country:RU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi, I tried adding extra serial ports on my Raspberry pi 4b 8Gb rev 1.4 for a gpio GPS module - the GPS module connected to uart0 (as well as uart1) is preventing the Raspberry from booting up. I even see dev/ttyu* files for added uarts after reboot, but uarts don't work for me. My os-version: FreeBSD 13.1-STABLE #3 stable/13-n250037-7d59a9451d3b: Sun Mar 20 00:51:26 +04 2022 arm64 I copied uart4.dtbo and uart5.dtbo from rpi-firmware package to /boot/dtb/overlays directory (and to /boot/msdos/overlays. Don't know for sure which folder is being used) and added to /boot/msdos/config.txt to [All] section: --- dtoverlay=uart4 gpio=8,9=a4 dtoverlay=uart5 gpio=12,13=a4 --- I then rebooted my system, checked that the /dev/ttyu(0,1,2) files are exist (uart0 is worked correctly) and checked pins configuration: --- # gpioctl -l | egrep "pin (08|09|12|13|14|15)" pin 08: 1 pin 8<> pin 09: 1 pin 9<> pin 12: 1 pin 12<> pin 13: 1 pin 13<> pin 14: 1 pin 14<> pin 15: 1 pin 15<> --- Then I connecteded the loops to the following pairs of pins: 8,10 (gpio 14,15), 21,24 (gpio 9,8) and 32,33 (gpio 12,13) and ran a script I found somewhere on the Internet when I was looking for a solution to my issue: --- import serial import time test_string = "[serial port test]".encode('utf-8') port_list = ["/dev/ttyu0", "/dev/ttyu1", "/dev/ttyu2" ] for port in port_list: ok = False try: buff = bytearray(len(test_string)) serialPort = serial.Serial(port, 115200, timeout = 2, writeTimeout = 2) bytes_sent = serialPort.write(test_string) time.sleep(1) bytes_read = serialPort.readinto(buff) ok = bytes_read == bytes_sent serialPort.close() except IOError: pass print("port %s is %s" % (port, "OK" if ok else "NOT OK")) --- I get the result: --- port /dev/ttyu0 is OK port /dev/ttyu1 is NOT OK port /dev/ttyu2 is NOT OK --- Did I make a mistake in my actions? Is it possible to add extra uarts to rpi4b at all? Thanks