gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Serial Console differences between PI1 and PI4

Fri Jul 03, 2020 9:19 pm

Hi,
On a PI 4 The serial console seems to be working. With the same exact setup including the same SD card, Cable, etc If I switch to a PI1 the serial console there is no output. Can someone help me please.I am on the latest 32 bit raspbian.
Thanks

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Sun Jul 05, 2020 4:05 pm

PI2 the serial console works!
PI1 Still does not.
All help appreciated

User avatar
B.Goode
Posts: 10191
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Serial Console differences between PI1 and PI4

Sun Jul 05, 2020 5:29 pm

There is documentation available from Raspberry Pi themselves which describes the differences between various models of RPi board - https://www.raspberrypi.org/documentati ... on/uart.md

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Mon Jul 06, 2020 11:59 am

Thanks. I read that. From a config perspective I still don't understand what settings/parameters/overlays are needed on RP1 to enable a serial console? I was under the impression that a given version of Raspbian would take care of that.

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Tue Jul 07, 2020 1:35 am

now i suspect hardware issues. may be tx or rx pin is fried ?

User avatar
neilgl
Posts: 2111
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Serial Console differences between PI1 and PI4

Wed Jul 08, 2020 12:08 pm

On a Pi1 (yellow RCA jack model, 26 GPIO) using Raspbian Buster Lite with updates today,

Code: Select all

uname -a
Linux piB 4.19.118+ #1311 Mon Apr 27 14:16:15 BST 2020 armv6l GNU/Linux

Code: Select all

sudo raspi-config[/b]

5 Interfacing Options
P6 Serial
Would you like a login shell to be accessible over serial? 
Yes
 The serial login shell is enabled                        │
 The serial interface is enabled
OK
Finish 
Then connect 3 wires to piB TX/RX/Gnd and connect those to a USB-Serial adapter board (Silicon Labs CP210x) and connect to USB port on a PC. Open COM3 on the PC using PuTTY at 115200

Reboot piB - yes we can see startup messages and login on the PuTTY screen on PC.

User avatar
neilgl
Posts: 2111
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Serial Console differences between PI1 and PI4

Wed Jul 08, 2020 1:46 pm

To test if TX/RX working, on the piB connect a jumper cable (DuPont female-female) between the TX and RX pins on the GPIO. Then power on the piB. Login and use raspi-config to enable serial on GPIO and disable console login. Reboot
Login and start two Terminals (or two PuTTY sessions).
In One, install pyserial then run a python script (serread.py see below) to read the input.

Code: Select all

python3 serread.py
In Two, send serial data:

Code: Select all

stty -F /dev/serial0 115200 
echo -e "hello world\n" > /dev/serial0
You should see that in One.
serread.py

Code: Select all

#!/usr/bin/python3
# install pyserial library - sudo pip3 install pyserial
import serial
print ("read a \\n terminated line from serial TX/RX on GPIO")
with serial.Serial('/dev/serial0', 115200, timeout = 2) as ser:
  print(ser.name )
  ser.close()
  ser.open()
  while True:
    line = ser.readline()   # read a '\n' terminated line
    print(line)
ser.close()

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Thu Jul 09, 2020 12:52 am

Thank you very much for your response and directions. I really appreciate the help.
I verified the correct updates as u suggested by doing uname -a.

With the loopback test (TX to RX on PI with dupont cable) I just keep seeing b ' '

User avatar
neilgl
Posts: 2111
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Serial Console differences between PI1 and PI4

Thu Jul 09, 2020 8:49 am

That b’ ‘ means it has not received anything. Double check your serial configuration in raspi-config. Maybe also try an SD card with just RaspiOS Buster Lite on it.

hippy
Posts: 7459
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Serial Console differences between PI1 and PI4

Thu Jul 09, 2020 4:27 pm

I wrote my own standalone serial loopback test which may be useful -

viewtopic.php?p=1679003#p1679003

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Thu Jul 09, 2020 5:04 pm

Thanks. Trying it out now.

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Thu Jul 09, 2020 6:09 pm

I only see Loopback Test on /dev/serial0 at 115200 baud. Nothing else.

FWIW a few lines from dmesgfutex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.078503] pinctrl core: initialized pinctrl subsystem
[ 0.080126] NET: Registered protocol family 16
[ 0.083581] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.091043] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[ 0.091117] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.091287] Serial: AMBA PL011 UART driver
[ 0.094557] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[ 0.110713] raspberrypi-firmware soc:firmware: Attached to firmware from 2020-04-15 11:43, variant start
[ 0.120739] raspberrypi-firmware soc:firmware: Firmware hash is 82f9bb929ce2186eb1824178c1ae82902ad6275c
[ 0.171905] bcm2835-dma 20007000.dma: DMA legacy API manager at (ptrval), dmachans=0x1
[ 0.174498] SCSI subsystem initialized
[ 0.174824] usbcore: registered new interface driver usbfs
[ 0.174988] usbcore: registered new interface driver hub
[ 0.175252] usbcore: registered new device driver usb
[ 0.177693] clocksource: Switched to clocksource timer
[ 0.285851] VFS: Disk quotas dquot_6.6.0
[ 0.286038] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.286401] FS-Cache: Loaded
[ 0.286778] CacheFiles: Loaded
[ 0.305861] NET: Registered protocol family 2
[ 0.307212] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.307337] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.307453] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.307573] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.307870] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.307942] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.308404] NET: Registered protocol family 1
[ 0.309554] RPC: Registered named UNIX socket transport module.
[ 0.309620] RPC: Registered udp transport module.
[ 0.309650] RPC: Registered tcp transport module.
[ 0.309676] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.311947] hw perfevents: no irqs for PMU, sampling events not supported
[ 0.312072] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[ 0.316583] Initialise system trusted keyrings
[ 0.317050] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 0.332642] FS-Cache: Netfs 'nfs' registered for caching
[ 0.334036] NFS: Registering the id_resolver key type
[ 0.334140] Key type id_resolver registered
[ 0.334175] Key type id_legacy registered
[ 0.334228] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.340039] Key type asymmetric registered
[ 0.340111] Asymmetric key parser 'x509' registered
[ 0.340246] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 0.340763] io scheduler noop registered
[ 0.340820] io scheduler deadline registered (default)
[ 0.341469] io scheduler cfq registered
[ 0.341522] io scheduler mq-deadline registered (default)
[ 0.341556] io scheduler kyber registered
[ 0.344346] bcm2708_fb soc:fb: FB found 1 display(s)
[ 0.353623] Console: switching to colour frame buffer device 82x26
[ 0.361313] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 656x416
[ 0.370320] bcm2835-rng 20104000.rng: hwrng registered
[ 0.373589] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[ 0.380304] vc-sm: Videocore shared memory driver
[ 0.383864] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[ 0.410066] brd: module loaded
[ 0.426795] loop: module loaded
[ 0.430742] Loading iSCSI transport class v2.0-870.
[ 0.434621] usbcore: registered new interface driver smsc95xx
[ 0.437466] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 0.468477] dwc_otg 20980000.usb: base=(ptrval)
[ 0.671679] Core Release: 2.80a
[ 0.674484] Setting default values for core params
[ 0.677280] Finished setting default values for core params
[ 0.880634] Using Buffer DMA mode
[ 0.883516] Periodic Transfer Interrupt Enhancement - disabled
[ 0.886355] Multiprocessor Interrupt Enhancement - disabled
[ 0.889260] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 0.892156] Dedicated Tx FIFOs mode
[ 0.895710] WARN::dwc_otg_hcd_init:1074: FIQ DMA bounce buffers: virt = db514000 dma = 0x5b514000 len=9024
[ 0.901383] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[ 0.914141] dwc_otg: Microframe scheduler enabled
[ 0.914392] WARN::hcd_init_fiq:457: FIQ on core 0
[ 0.917031] WARN::hcd_init_fiq:458: FIQ ASM at c052bec4 length 36
[ 0.919591] WARN::hcd_init_fiq:497: MPHI regs_base at dc810000
[ 0.922219] dwc_otg 20980000.usb: DWC OTG Controller
[ 0.924843] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
[ 0.927527] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
[ 0.930224] Init: Port Power? op_state=1
[ 0.932790] Init: Power Port (0)
[ 0.935658] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[ 0.940812] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.943569] usb usb1: Product: DWC OTG Controller
[ 0.946247] usb usb1: Manufacturer: Linux 4.19.118+ dwc_otg_hcd
[ 0.949029] usb usb1: SerialNumber: 20980000.usb
[ 0.952856] hub 1-0:1.0: USB hub found
[ 0.955560] hub 1-0:1.0: 1 port detected
[ 0.959289] dwc_otg: FIQ enabled
[ 0.959303] dwc_otg: NAK holdoff enabled
[ 0.959310] dwc_otg: FIQ split-transaction FSM enabled
[ 0.959332] Module dwc_common_port init
[ 0.959913] usbcore: registered new interface driver usb-storage
[ 0.963123] mousedev: PS/2 mouse device common for all mice
[ 0.967187] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[ 0.970587] bcm2835-cpufreq: min=700000 max=700000
[ 0.974071] sdhci: Secure Digital Host Controller Interface driver
[ 0.976856] sdhci: Copyright(c) Pierre Ossman
[ 0.980379] sdhost-bcm2835 20202000.mmc: could not get clk, deferring probe
[ 0.983568] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.987038] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.990184] hidraw: raw HID events driver (C) Jiri Kosina
[ 0.993336] usbcore: registered new interface driver usbhid
[ 0.996206] usbhid: USB HID core driver
[ 1.000280] vchiq: vchiq_init_state: slot_zero = (ptrval), is_master = 0
[ 1.005388] [vc_sm_connected_init]: start
[ 1.015774] [vc_sm_connected_init]: end - returning 0
[ 1.020558] Initializing XFRM netlink socket
[ 1.023388] NET: Registered protocol family 17
[ 1.026215] Key type dns_resolver registered
[ 1.030939] registered taskstats version 1
[ 1.033684] Loading compiled-in X.509 certificates
[ 1.046432] uart-pl011 20201000.serial: cts_event_workaround enabled
[ 1.049553] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 1.058498] sdhost: log_buf @ (ptrval) (5b513000)
[ 1.108752] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 1.113456] of_cfs_init
[ 1.116388] of_cfs_init: OK
[ 1.140391] Waiting for root device PARTUUID=796d9c37-02...
[ 1.152612] random: fast init done
[ 1.182535] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.188322] Indeed it is in host mode hprt0 = 00021501
[ 1.252111] mmc0: new high speed SDHC card at address 1234
[ 1.256940] mmcblk0: mmc0:1234 SA04G 3.64 GiB
[ 1.263783] mmcblk0: p1 p2
[ 1.296944] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.302865] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.319114] devtmpfs: mounted
[ 1.327852] Freeing unused kernel memory: 468K
[ 1.330973] This architecture does not have kernel memory protection.
[ 1.334049] Run /sbin/init as init process
[ 1.407829] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 1.412423] Indeed it is in host mode hprt0 = 00001101
[ 1.648531] usb 1-1: New USB device found, idVendor=0424, idProduct=9512, bcdDevice= 2.00
[ 1.654663] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.661499] hub 1-1:1.0: USB hub found
[ 1.666741] hub 1-1:1.0: 3 ports detected
[ 1.987864] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 2.128311] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00, bcdDevice= 2.00
[ 2.135132] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.142653] smsc95xx v1.0.6
[ 2.244517] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:8b:dd:ce
[ 2.312342] systemd[1]: System time before build time, advancing clock.
[ 2.473252] NET: Registered protocol family 10
[ 2.479241] Segment Routing with IPv6
[ 2.558336] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[ 2.570505] systemd[1]: Detected architecture arm.
[ 2.599528] systemd[1]: Set hostname to <raspberrypi>.
[ 5.360118] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.387951] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.392675] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 5.404283] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.408492] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 5.430860] systemd[1]: Listening on Syslog Socket.
[ 5.444562] systemd[1]: Created slice User and Session Slice.
[ 5.452947] systemd[1]: Reached target Swap.
[ 5.461213] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ 5.472192] systemd[1]: Reached target Local Encrypted Volumes.
[ 7.760073] systemd[1]: Started File System Check Daemon to report status.
[ 7.909163] systemd[1]: Started Journal Service.
[ 9.396024] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 10.092603] systemd-journald[73]: Received request to flush runtime journal from PID 1
[ 12.363003] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.373715] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[ 12.373742] [vc_sm_connected_init]: start
[ 12.389184] media: Linux media interface: v0.10
[ 12.453325] [vc_sm_connected_init]: installed successfully
[ 12.557909] videodev: Linux video capture interface: v2.00
[ 12.689125] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.718088] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.762141] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.823841] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.897984] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[ 12.898050] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[ 12.913544] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[ 12.913607] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[ 12.988236] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[ 12.988295] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[ 22.821593] random: crng init done
[ 22.821618] random: 7 urandom warning(s) missed due to ratelimiting
[ 22.866250] 8021q: 802.1Q VLAN Support v1.8
[ 23.459939] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 23.862414] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 24.029642] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SSFS
[ 24.251229] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 25.824105] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[ 93.299791] uart-pl011 20201000.serial: no DMA platform data
pi@raspberrypi:~ $

hippy
Posts: 7459
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Serial Console differences between PI1 and PI4

Thu Jul 09, 2020 9:08 pm

gopal334 wrote:
Thu Jul 09, 2020 6:09 pm
I only see Loopback Test on /dev/serial0 at 115200 baud. Nothing else.
That's at least some good news in that the GPIO pins are okay, and the hardware is working to the degree it does.

As to why only at 112500 baud; no idea. Were there any error messages when you tried to open at other baud rates ?


Misinterpreted what was stated.
Last edited by hippy on Fri Jul 10, 2020 9:59 am, edited 1 time in total.

User avatar
neilgl
Posts: 2111
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Serial Console differences between PI1 and PI4

Thu Jul 09, 2020 11:28 pm

Hold on I thought that loop back test would print A, B etc. every second, so it is Not working?

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Fri Jul 10, 2020 12:45 am

Nope. I don't see any characters on that terminal. Only the initial message when I run the code.

hippy
Posts: 7459
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Serial Console differences between PI1 and PI4

Fri Jul 10, 2020 9:59 am

Sorry; I misinterpreted what you were saying.

User avatar
neilgl
Posts: 2111
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Serial Console differences between PI1 and PI4

Fri Jul 10, 2020 10:24 am

Looks like it is dead then? Can you still use the TX/RX pins as normal GPIO, e.g. set an LED (with resistor) ON/OFF? (Using raspi-gpio or other.)

hippy
Posts: 7459
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Serial Console differences between PI1 and PI4

Fri Jul 10, 2020 12:53 pm

It does sound like the GPIO pins may be damaged. It doesn't seem the hardware UART could be redirected to other GPIO pins but it would be possible to run a software UART on other pins. Not sure how usable that would be for a command line serial console.

gopal334
Posts: 11
Joined: Fri Jul 03, 2020 9:13 pm

Re: Serial Console differences between PI1 and PI4

Sat Jul 11, 2020 3:06 pm

Thanks for all the help. I really appreciate it.You guys are awesome!!

Return to “Beginners”