Skip to content

SC16IS752 Interrupt bug? #3340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Thomas-GeDaD opened this issue Nov 18, 2019 · 20 comments
Closed

SC16IS752 Interrupt bug? #3340

Thomas-GeDaD opened this issue Nov 18, 2019 · 20 comments

Comments

@Thomas-GeDaD
Copy link

Thomas-GeDaD commented Nov 18, 2019

I´m not sure if it is the right place for the Problem:
I use 3x SC16is752 devices on a Pi 4 with buster (4.19.75-v7l+ #1270)
All 3 devices works if I only use 1 or 2 of them:
In config.txt:
works:

#dtoverlay=sc16is752-i2c,int_pin=13,addr=0x4A,xtal=14745600
dtoverlay=sc16is752-i2c,int_pin=12,addr=0x49,xtal=14745600
dtoverlay=sc16is752-i2c,int_pin=6,addr=0x48,xtal=14745600

works:

dtoverlay=sc16is752-i2c,int_pin=13,addr=0x4A,xtal=14745600
#dtoverlay=sc16is752-i2c,int_pin=12,addr=0x49,xtal=14745600
dtoverlay=sc16is752-i2c,int_pin=6,addr=0x48,xtal=14745600

works:

dtoverlay=sc16is752-i2c,int_pin=13,addr=0x4A,xtal=14745600
dtoverlay=sc16is752-i2c,int_pin=12,addr=0x49,xtal=14745600
#dtoverlay=sc16is752-i2c,int_pin=6,addr=0x48,xtal=14745600

with all configuration I get ttySC0-ttySC3 and can send an recieve data from a GPS (NMEA)
All works perfectly.
But If I use all three devices I get problems=>

dtoverlay=sc16is752-i2c,int_pin=13,addr=0x4A,xtal=14745600
dtoverlay=sc16is752-i2c,int_pin=12,addr=0x49,xtal=14745600
dtoverlay=sc16is752-i2c,int_pin=6,addr=0x48,xtal=14745600

After startup the Pi dmesg seems fine without any issue.

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.75-v7l+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1270 SMP Tue Sep 24 18:51:41 BST 2019
[ 0.000000] CPU: ARMv7 Processor [410fd083] revision 3 (ARMv7), cr=30c5383d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi 4 Model B Rev 1.1
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Reserved 256 MiB at 0x000000001ec00000
[ 0.000000] On node 0 totalpages: 504832
[ 0.000000] DMA zone: 1728 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 196608 pages, LIFO batch:63
[ 0.000000] HighMem zone: 308224 pages, LIFO batch:63
[ 0.000000] random: get_random_bytes called from start_kernel+0xc0/0x4e8 with crng_init=0
[ 0.000000] percpu: Embedded 17 pages/cpu s39488 r8192 d21952 u69632
[ 0.000000] pcpu-alloc: s39488 r8192 d21952 u69632 alloc=17*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 503104
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 cma=64M cma=256M video=HDMI-A-1:1920x1080M@60,margin_left=48,margin_right=48,margin_top=48,margin_bottom=48 smsc95xx.macaddr=DC:A6:32:12:F9:C6 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=5b55e216-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 1721828K/2019328K available (8192K kernel code, 661K rwdata, 2352K rodata, 2048K init, 850K bss, 35356K reserved, 262144K cma-reserved, 1232896K highmem)
[ 0.000000] Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0x(ptrval) - 0x(ptrval) (10208 kB)
.init : 0x(ptrval) - 0x(ptrval) (2048 kB)
.data : 0x(ptrval) - 0x(ptrval) ( 662 kB)
.bss : 0x(ptrval) - 0x(ptrval) ( 851 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] ftrace: allocating 28124 entries in 83 pages
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[ 0.000005] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[ 0.000018] Switching to timer-based delay loop, resolution 18ns
[ 0.000238] Console: colour dummy device 80x30
[ 0.000262] console [tty1] enabled
[ 0.000304] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=540000)
[ 0.000325] pid_max: default: 32768 minimum: 301
[ 0.000584] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000601] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001335] CPU: Testing write buffer coherency: ok
[ 0.001736] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002360] Setting up static identity map for 0x200000 - 0x20003c
[ 0.002514] rcu: Hierarchical SRCU implementation.
[ 0.003361] smp: Bringing up secondary CPUs ...
[ 0.004239] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.005230] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.006186] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.006318] smp: Brought up 1 node, 4 CPUs
[ 0.006331] SMP: Total of 4 processors activated (432.00 BogoMIPS).
[ 0.006341] CPU: All CPU(s) started in HYP mode.
[ 0.006349] CPU: Virtualization extensions available.
[ 0.007115] devtmpfs: initialized
[ 0.017740] VFP support v0.3: implementor 41 architecture 3 part 40 variant 8 rev 0
[ 0.017942] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.017961] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.025441] pinctrl core: initialized pinctrl subsystem
[ 0.026269] NET: Registered protocol family 16
[ 0.028998] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.030492] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.030502] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.030698] Serial: AMBA PL011 UART driver
[ 0.033740] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[ 0.070455] bcm2835-dma fe007000.dma: DMA legacy API manager at (ptrval), dmachans=0x1
[ 0.072770] vgaarb: loaded
[ 0.073135] SCSI subsystem initialized
[ 0.073329] usbcore: registered new interface driver usbfs
[ 0.073380] usbcore: registered new interface driver hub
[ 0.073447] usbcore: registered new device driver usb
[ 0.090405] raspberrypi-firmware soc:firmware: Attached to firmware from 2019-09-24 17:34, variant start
[ 0.100112] raspberrypi-firmware soc:firmware: Firmware hash is cd3add54955f8fa065b414d8fc07c525e7ddffc8
[ 0.111673] clocksource: Switched to clocksource arch_sys_counter
[ 0.188790] VFS: Disk quotas dquot_6.6.0
[ 0.188867] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.189045] FS-Cache: Loaded
[ 0.189220] CacheFiles: Loaded
[ 0.189774] simple-framebuffer 3e887000.framebuffer: framebuffer at 0x3e887000, 0x373800 bytes, mapped to 0x(ptrval)
[ 0.189789] simple-framebuffer 3e887000.framebuffer: format=r5g6b5, mode=1824x984x16, linelength=3648
[ 0.196205] Console: switching to colour frame buffer device 228x61
[ 0.201997] simple-framebuffer 3e887000.framebuffer: fb0: simplefb registered!
[ 0.210932] NET: Registered protocol family 2
[ 0.211556] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[ 0.211580] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.211651] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.211765] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.211884] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.211912] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.212199] NET: Registered protocol family 1
[ 0.212718] RPC: Registered named UNIX socket transport module.
[ 0.212727] RPC: Registered udp transport module.
[ 0.212736] RPC: Registered tcp transport module.
[ 0.212746] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.212760] PCI: CLS 0 bytes, default 64
[ 0.215789] Initialise system trusted keyrings
[ 0.215959] workingset: timestamp_bits=14 max_order=19 bucket_order=5
[ 0.224855] FS-Cache: Netfs 'nfs' registered for caching
[ 0.225393] NFS: Registering the id_resolver key type
[ 0.225416] Key type id_resolver registered
[ 0.225425] Key type id_legacy registered
[ 0.225444] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.227652] Key type asymmetric registered
[ 0.227662] Asymmetric key parser 'x509' registered
[ 0.227769] bounce: pool size: 64 pages
[ 0.227807] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 0.227966] io scheduler noop registered
[ 0.227977] io scheduler deadline registered (default)
[ 0.228129] io scheduler cfq registered
[ 0.228140] io scheduler mq-deadline registered (default)
[ 0.228150] io scheduler kyber registered
[ 0.231130] brcm-pcie fd500000.pcie: could not get clock
[ 0.231186] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[ 0.231222] brcm-pcie fd500000.pcie: MEM 0x600000000..0x603ffffff -> 0xf8000000
[ 0.291738] brcm-pcie fd500000.pcie: link up, 5.0 Gbps x1 (!SSC)
[ 0.291978] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00
[ 0.291994] pci_bus 0000:00: root bus resource [bus 00-01]
[ 0.292010] pci_bus 0000:00: root bus resource [mem 0x600000000-0x603ffffff] (bus address [0xf8000000-0xfbffffff])
[ 0.292052] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400
[ 0.292188] pci 0000:00:00.0: PME# supported from D0 D3hot
[ 0.295086] PCI: bus0: Fast back to back transfers disabled
[ 0.295103] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 0.295304] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330
[ 0.295427] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[ 0.295739] pci 0000:01:00.0: PME# supported from D0 D3cold
[ 0.298615] PCI: bus1: Fast back to back transfers disabled
[ 0.298630] pci_bus 0000:01: busn_res: [bus 01] end is updated to 01
[ 0.298680] pci 0000:00:00.0: BAR 8: assigned [mem 0x600000000-0x6000fffff]
[ 0.298698] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit]
[ 0.298768] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 0.298785] pci 0000:00:00.0: bridge window [mem 0x600000000-0x6000fffff]
[ 0.298989] pcieport 0000:00:00.0: enabling device (0140 -> 0142)
[ 0.299150] pcieport 0000:00:00.0: Signaling PME with IRQ 58
[ 0.299305] pcieport 0000:00:00.0: AER enabled with IRQ 58
[ 0.299470] pci 0000:01:00.0: enabling device (0140 -> 0142)
[ 0.301263] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 0.303259] iproc-rng200 fe104000.rng: hwrng registered
[ 0.303488] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[ 0.304000] vc-sm: Videocore shared memory driver
[ 0.304393] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000
[ 0.314117] brd: module loaded
[ 0.323586] loop: module loaded
[ 0.324341] Loading iSCSI transport class v2.0-870.
[ 0.325965] libphy: Fixed MDIO Bus: probed
[ 0.326397] bcmgenet fd580000.genet: failed to get enet clock
[ 0.326412] bcmgenet fd580000.genet: GENET 5.0 EPHY: 0x0000
[ 0.326430] bcmgenet fd580000.genet: failed to get enet-wol clock
[ 0.326446] bcmgenet fd580000.genet: failed to get enet-eee clock
[ 0.326468] bcmgenet: Skipping UMAC reset
[ 0.326689] unimac-mdio unimac-mdio.-19: DMA mask not set
[ 0.341702] libphy: bcmgenet MII bus: probed
[ 0.382196] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus at 0x(ptrval)
[ 0.383063] usbcore: registered new interface driver r8152
[ 0.383123] usbcore: registered new interface driver lan78xx
[ 0.383176] usbcore: registered new interface driver smsc95xx
[ 0.383468] xhci_hcd 0000:01:00.0: xHCI Host Controller
[ 0.383510] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[ 0.385286] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0000001000000890
[ 0.385585] genirq: irq_chip Brcm_MSI did not update eff. affinity mask of irq 59
[ 0.386439] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[ 0.386452] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.386463] usb usb1: Product: xHCI Host Controller
[ 0.386474] usb usb1: Manufacturer: Linux 4.19.75-v7l+ xhci-hcd
[ 0.386485] usb usb1: SerialNumber: 0000:01:00.0
[ 0.386986] hub 1-0:1.0: USB hub found
[ 0.387073] hub 1-0:1.0: 1 port detected
[ 0.387532] xhci_hcd 0000:01:00.0: xHCI Host Controller
[ 0.387554] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[ 0.387572] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[ 0.387970] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[ 0.387984] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.387995] usb usb2: Product: xHCI Host Controller
[ 0.388006] usb usb2: Manufacturer: Linux 4.19.75-v7l+ xhci-hcd
[ 0.388017] usb usb2: SerialNumber: 0000:01:00.0
[ 0.388506] hub 2-0:1.0: USB hub found
[ 0.388566] hub 2-0:1.0: 4 ports detected
[ 0.389770] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 0.415326] dwc_otg fe980000.usb: base=(ptrval)
[ 0.615569] Core Release: 2.80a
[ 0.615582] Setting default values for core params
[ 0.615609] Finished setting default values for core params
[ 0.815932] Using Buffer DMA mode
[ 0.815942] Periodic Transfer Interrupt Enhancement - disabled
[ 0.815951] Multiprocessor Interrupt Enhancement - disabled
[ 0.815962] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 0.816020] Dedicated Tx FIFOs mode
[ 0.816415] WARN::dwc_otg_hcd_init:1045: FIQ DMA bounce buffers: virt = ded34000 dma = 0x00000000ded34000 len=9024
[ 0.816437] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[ 0.816448] dwc_otg: Microframe scheduler enabled
[ 0.816502] WARN::hcd_init_fiq:457: FIQ on core 1
[ 0.816519] WARN::hcd_init_fiq:458: FIQ ASM at c07b6224 length 36
[ 0.816535] WARN::hcd_init_fiq:497: MPHI regs_base at f0810200
[ 0.816571] dwc_otg fe980000.usb: DWC OTG Controller
[ 0.816601] dwc_otg fe980000.usb: new USB bus registered, assigned bus number 3
[ 0.816633] dwc_otg fe980000.usb: irq 40, io mem 0x00000000
[ 0.816682] Init: Port Power? op_state=1
[ 0.816691] Init: Power Port (0)
[ 0.816953] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[ 0.816966] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.816978] usb usb3: Product: DWC OTG Controller
[ 0.816989] usb usb3: Manufacturer: Linux 4.19.75-v7l+ dwc_otg_hcd
[ 0.817000] usb usb3: SerialNumber: fe980000.usb
[ 0.817490] hub 3-0:1.0: USB hub found
[ 0.817538] hub 3-0:1.0: 1 port detected
[ 0.818118] dwc_otg: FIQ enabled
[ 0.818128] dwc_otg: NAK holdoff enabled
[ 0.818136] dwc_otg: FIQ split-transaction FSM enabled
[ 0.818149] Module dwc_common_port init
[ 0.818361] usbcore: registered new interface driver uas
[ 0.818471] usbcore: registered new interface driver usb-storage
[ 0.818634] mousedev: PS/2 mouse device common for all mice
[ 0.819830] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[ 0.820008] bcm2835-cpufreq: min=600000 max=1500000
[ 0.820555] sdhci: Secure Digital Host Controller Interface driver
[ 0.820564] sdhci: Copyright(c) Pierre Ossman
[ 0.820946] mmc-bcm2835 fe300000.mmcnr: could not get clk, deferring probe
[ 0.821324] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.824317] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.824461] hidraw: raw HID events driver (C) Jiri Kosina
[ 0.824605] usbcore: registered new interface driver usbhid
[ 0.824614] usbhid: USB HID core driver
[ 0.825315] vchiq: vchiq_init_state: slot_zero = (ptrval), is_master = 0
[ 0.826608] [vc_sm_connected_init]: start
[ 0.832972] [vc_sm_connected_init]: end - returning 0
[ 0.834044] Initializing XFRM netlink socket
[ 0.834071] NET: Registered protocol family 17
[ 0.834157] Key type dns_resolver registered
[ 0.834553] Registering SWP/SWPB emulation handler
[ 0.835152] registered taskstats version 1
[ 0.835167] Loading compiled-in X.509 certificates
[ 0.843224] uart-pl011 fe201000.serial: cts_event_workaround enabled
[ 0.843285] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 34, base_baud = 0) is a PL011 rev2
[ 0.846532] console [ttyS0] disabled
[ 0.846563] fe215040.serial: ttyS0 at MMIO 0x0 (irq = 37, base_baud = 62500000) is a 16550
[ 0.846614] console [ttyS0] enabled
[ 0.847046] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[ 0.847518] brcmstb_thermal fd5d2200.thermal: registered AVS TMON of-sensor driver
[ 0.848124] mmc-bcm2835 fe300000.mmcnr: mmc_debug:0 mmc_debug2:0
[ 0.848136] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated
[ 0.872222] sdhci-iproc fe340000.emmc2: Linked as a consumer to regulator.1
[ 0.890427] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 0.892155] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 0.893774] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 0.896675] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 0.898291] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 0.904110] mmc0: SDHCI controller on fe340000.emmc2 [fe340000.emmc2] using ADMA
[ 0.906380] of_cfs_init
[ 0.906462] of_cfs_init: OK
[ 0.907081] Waiting for root device PARTUUID=5b55e216-02...
[ 0.954015] random: fast init done
[ 0.961755] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[ 1.003440] mmc0: new ultra high speed DDR50 SDHC card at address 0001
[ 1.006685] mmcblk0: mmc0:0001 EB1QT 29.8 GiB
[ 1.006979] mmc1: new high speed SDIO card at address 0001
[ 1.008472] mmcblk0: p1 p2
[ 1.031012] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.031052] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.031840] devtmpfs: mounted
[ 1.038027] Freeing unused kernel memory: 2048K
[ 1.071928] Run /sbin/init as init process
[ 1.144394] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.20
[ 1.144408] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 1.144420] usb 1-1: Product: USB2.0 Hub
[ 1.146174] hub 1-1:1.0: USB hub found
[ 1.146522] hub 1-1:1.0: 4 ports detected
[ 1.485757] systemd[1]: System time before build time, advancing clock.
[ 1.579693] NET: Registered protocol family 10
[ 1.580872] Segment Routing with IPv6
[ 1.615812] 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)
[ 1.616470] systemd[1]: Detected architecture arm.
[ 1.624092] systemd[1]: Set hostname to .
[ 1.629796] systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
[ 1.896720] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 1.896742] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 2.072809] systemd[1]: /etc/systemd/system/teamviewerd.service:8: PIDFile= references path below legacy directory /var/run/, updating /var/run/teamviewerd.pid → /run/teamviewerd.pid; please update the unit file accordingly.
[ 2.315134] random: systemd: uninitialized urandom read (16 bytes read)
[ 2.324805] random: systemd: uninitialized urandom read (16 bytes read)
[ 2.325355] systemd[1]: Listening on udev Control Socket.
[ 2.325762] random: systemd: uninitialized urandom read (16 bytes read)
[ 2.330913] systemd[1]: Listening on Syslog Socket.
[ 2.331497] systemd[1]: Listening on Journal Socket (/dev/log).
[ 2.470066] i2c /dev entries driver
[ 2.512886] Driver for 1-wire Dallas network protocol.
[ 2.993716] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 3.098283] systemd-journald[116]: Received request to flush runtime journal from PID 1
[ 3.681505] rpivid-mem feb00000.hevc-decoder: rpivid-hevcmem initialised: Registers at 0xfeb00000 length 0x0000ffff
[ 3.683749] rpivid-mem feb10000.rpivid-local-intc: rpivid-intcmem initialised: Registers at 0xfeb10000 length 0x00000fff
[ 3.684240] rpivid-mem feb20000.h264-decoder: rpivid-h264mem initialised: Registers at 0xfeb20000 length 0x0000ffff
[ 3.684714] rpivid-mem feb30000.vp9-decoder: rpivid-vp9mem initialised: Registers at 0xfeb30000 length 0x0000ffff
[ 3.734841] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.736794] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[ 3.736810] [vc_sm_connected_init]: start
[ 3.737924] [vc_sm_connected_init]: installed successfully
[ 3.740193] media: Linux media interface: v0.10
[ 3.782182] videodev: Linux video capture interface: v2.00
[ 3.813267] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.816023] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.821906] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.845456] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.865223] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[ 3.865264] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[ 3.874506] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[ 3.874548] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[ 3.883610] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[ 3.883647] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[ 4.017278] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.082778] bcm2835_audio soc:audio: card created with 8 channels
[ 4.120693] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 4.291640] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 4.359282] brcmfmac: F1 signature read @0x18000000=0x15264345
[ 4.371928] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.372523] usbcore: registered new interface driver brcmfmac
[ 4.373587] [drm] Initialized v3d 1.0.0 20180419 for fec00000.v3d on minor 0
[ 4.379439] vc4-drm soc:gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops [vc4])
[ 4.379456] checking generic (3e887000 373800) vs hw (0 ffffffffffffffff)
[ 4.379466] fb: switching to vc4drmfb from simple
[ 4.379676] Console: switching to colour dummy device 80x30
[ 4.380629] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 1
[ 4.380641] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 4.380650] [drm] No driver support for vblank timestamp query.
[ 4.380659] [drm] Setting vblank_disable_immediate to false because get_vblank_timestamp == NULL
[ 4.389771] vc4-drm soc:gpu: HDMI-A-1: EDID is invalid:
[ 4.389788] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.389798] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.389807] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.389816] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.389825] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.389834] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.389843] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.389852] [00] ZERO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 4.398699] Console: switching to colour frame buffer device 240x67
[ 4.398742] vc4-drm soc:gpu: fb0: DRM emulated frame buffer device
[ 4.590408] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.602776] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
[ 4.873286] CAN device driver interface
[ 4.909216] mcp251x spi0.1 can0: MCP2515 successfully initialized.
[ 5.804169] IPv6: ADDRCONF(NETDEV_UP): can0: link is not ready
[ 5.804237] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 6.625815] uart-pl011 fe201000.serial: no DMA platform data
[ 6.700229] random: crng init done
[ 6.700244] random: 7 urandom warning(s) missed due to ratelimiting
[ 6.755231] Bluetooth: Core ver 2.22
[ 6.755335] NET: Registered protocol family 31
[ 6.755345] Bluetooth: HCI device and connection manager initialized
[ 6.758850] Bluetooth: HCI socket layer initialized
[ 6.758874] Bluetooth: L2CAP socket layer initialized
[ 6.758932] Bluetooth: SCO socket layer initialized
[ 6.915403] 8021q: 802.1Q VLAN Support v1.8
[ 7.081651] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SSFS
[ 7.328087] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 7.328104] brcmfmac: power management disabled
[ 7.879613] bcmgenet: Skipping UMAC reset
[ 7.971999] bcmgenet fd580000.genet: configuring instance for external RGMII (no delay)
[ 7.972155] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 8.127103] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 8.127110] Bluetooth: BNEP filters: protocol multicast
[ 8.127126] Bluetooth: BNEP socket layer initialized
[ 9.031812] bcmgenet fd580000.genet eth0: Link is Down
[ 12.151838] bcmgenet fd580000.genet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 12.151860] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 14.167987] Bluetooth: HCI UART driver ver 2.3
[ 14.168004] Bluetooth: HCI UART protocol H4 registered
[ 14.168091] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 14.168377] Bluetooth: HCI UART protocol Broadcom registered
[ 14.812368] fuse init (API version 7.27)
[ 20.177928] i2c i2c-1: delete_device: Can't find device in list
[ 20.262718] i2c i2c-1: new_device: Instantiated device ds2482 at 0x18
[ 20.336196] w1_master_driver w1_bus_master1: Attaching one wire slave 28.0118306524ff crc a4
[ 24.631533] can: controller area network core (rev 20170425 abi 9)
[ 24.631607] NET: Registered protocol family 29
[ 24.641318] can: raw protocol (rev 20170425)

the devicetree:

i2c@7e804000 {

		compatible = "brcm,bcm2835-i2c";
		clocks = < 0x03 0x14 >;
		status = "okay";
		#address-cells = < 0x01 >;
		interrupts = < 0x00 0x75 0x04 >;
		#size-cells = < 0x00 >;
		phandle = < 0x29 >;
		reg = < 0x7e804000 0x1000 >;
		clock-frequency = < 0x186a0 >;
		pinctrl-0 = < 0x14 >;
		pinctrl-names = "default";

		sc16is752@49 {
			compatible = "nxp,sc16is752";
			clocks = < 0xca >;
			gpio-controller;
			status = "okay";
			i2c-max-frequency = < 0x61a80 >;
			interrupt-parent = < 0x0f >;
			interrupts = < 0x0c 0x02 >;
			phandle = < 0xcb >;
			reg = < 0x49 >;
			#gpio-cells = < 0x00 >;

			0x49 {
				compatible = "fixed-clock";
				#clock-cells = < 0x00 >;
				phandle = < 0xca >;
				clock-frequency = < 0xe10000 >;
			};
		};

		sc16is752@4a {
			compatible = "nxp,sc16is752";
			clocks = < 0xc7 >;
			gpio-controller;
			status = "okay";
			i2c-max-frequency = < 0x61a80 >;
			interrupt-parent = < 0x0f >;
			interrupts = < 0x0d 0x02 >;
			phandle = < 0xc8 >;
			reg = < 0x4a >;
			#gpio-cells = < 0x00 >;

			0x4A {
				compatible = "fixed-clock";
				#clock-cells = < 0x00 >;
				phandle = < 0xc7 >;
				clock-frequency = < 0xe10000 >;
			};
		};

		sc16is752@48 {
			compatible = "nxp,sc16is752";
			clocks = < 0xcd >;
			gpio-controller;
			status = "okay";
			i2c-max-frequency = < 0x61a80 >;
			interrupt-parent = < 0x0f >;
			interrupts = < 0x06 0x02 >;
			phandle = < 0xce >;
			reg = < 0x48 >;
			#gpio-cells = < 0x00 >;

			0x48 {
				compatible = "fixed-clock";
				#clock-cells = < 0x00 >;
				phandle = < 0xcd >;
				clock-frequency = < 0xe10000 >;
			};
		};
	};

and the i2c detect:
....... 0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- UU UU UU -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- `

I think all is fine.
But if I use one of the ttySC Port the following happened:
sudo stty 19200 -F /dev/ttySC0
In dmesg:

[ 457.730643] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 457.731276] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 457.731636] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 457.731914] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 457.732187] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 457.732805] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 457.733426] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 457.734085] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 457.734689] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 457.735299] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 462.731502] sc16is7xx_port_irq: 19453 callbacks suppressed
[ 462.731514] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 462.731785] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 462.732529] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 462.733048] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 462.733316] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 462.733938] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 462.734455] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 462.735074] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 462.735689] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 462.736202] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 468.001605] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[ 468.001631] sc16is7xx_port_irq: 16481 callbacks suppressed
[ 468.001641] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 469.041626] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[ 469.041656] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 470.081686] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[ 470.081713] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 470.082007] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 470.082478] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 470.082951] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 470.083443] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 470.083742] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 470.083995] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 470.084257] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 473.011785] sc16is7xx_port_irq: 11588 callbacks suppressed

At this time there are physical no data on the UART.
This passes infinitely until i restart.
The amazing think is, that this only happened if I use ttySC0,ttySC1,ttySC4,ttySC5
But It can not be a physical problem because all devices in two pairs or alone worked....
I think it´s a driver Issue?
Thanks....

@pelwell
Copy link
Contributor

pelwell commented Nov 18, 2019

Those devices, or rather that device driver, has been the source of many problems over the years. We've found and fixed a number of bugs, but we can't offer more than time-permitting support on third-party devices and driver software.

The kernel log doesn't give any clue as to how much data was successfully delivered before the failure occurred. Please try systematically sending single bytes to each port individually and report the outcomes.

One thing I do notices is that one of your IRQ GPIOs (6) naturally pulls high while the others (12, 13) pull low, and the overlay makes no attempt to set the pull states. Do you have any kind of external pull-ups? What does the datasheet say on the matter? After booting but before using the serial ports, try forcing the pulls to a consistent state on all three GPIOs using raspi-gpio:

$ raspi-gpio set 6,12,13 ip pu

or:

$ raspi-gpio set 6,12,13 ip pd

Does that change the behaviour?

@Thomas-GeDaD
Copy link
Author

Hi pellwell,
thanks for your fast answer.
I have seen this and checked this times before.
It have no changes. All device Interrupts have a external 1KOhm pullup as described in the datasheet.
If I read the interrupt GPIO´s all are high on the first moment.

What do you mean with sending single bytes to each port? Physically on the uart side?
This happened directly if i want to configurate the Port... There are no data on the uart side at this moment...

@pelwell
Copy link
Contributor

pelwell commented Nov 18, 2019

Please try watching the state of the IRQ lines using raspi-gpio while you try starting one of the interfaces:

$ while true; do raspi-gpio get 6,12,13; sleep 0.5; done

You can adjust the sleep time (in seconds) to watch with finer granularity.

Before initialising the UART all three should be high, then afterwards I would expect no more than one to go low, and only momentarilty so. If you don't see any of the lines flicker, try removing the sleep and logging to a file. You could also install Joan's PiScope (http://abyz.me.uk/rpi/pigpio/piscope.html) - I've not tried it myself, but it looks like it could be useful here if you don't have any other kind of logic analyser or oscilloscope.

@Thomas-GeDaD
Copy link
Author

I have done this. All Interrupt GPIO are all the Time high!

GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 12: level=1 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=1 fsel=0 func=INPUT pull=DOWN

All Intterupt GPIO´s high before and after I configurate a UART Interface....
I recheck it later with a Oscilloscope.
In dmesg the same issue:

[ 7178.643982] sc16is7xx_port_irq: 8282 callbacks suppressed
[ 7178.643995] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7178.645169] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7178.646349] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7178.647754] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7178.648933] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7178.650114] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7178.651529] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7178.652714] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7178.653906] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7178.655327] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7183.653777] sc16is7xx_port_irq: 8292 callbacks suppressed
[ 7183.653790] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7183.654408] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7183.655025] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7183.655641] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7183.656258] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7183.656874] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7183.657489] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7183.658105] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0
[ 7183.658721] sc16is7xx 1-004a: ttySC4: Unexpected interrupt: 0
[ 7183.659337] sc16is7xx 1-004a: ttySC5: Unexpected interrupt: 0

@pelwell
Copy link
Contributor

pelwell commented Nov 18, 2019

The scope will definitely tell you more (and more accurately). Start with the IRQ lines, then we can take it from there.

@Thomas-GeDaD
Copy link
Author

The Interrupt works correct.
But at measured i think I have found the Issue:
2019-11-18_19h50_54
As you see in the Addresstable for 0x4A I use Vdd and SCL (1001010) sometimes the Adress works and sometimes are not. I think there is a problem at startup. The SC16Is752 needs the I2C line for addressing in this case. And there something seems to work wrong. If I use a adress like 1001100 with Vdd and VSS all works fine??
Is the I2C all time availible direct at sturtup? Has anybody ever use it with adressing trough the SCL / SDA line?
Funny....

@Thomas-GeDaD
Copy link
Author

If I start the Pi together with the SC16IS752 it does not work. If I start the Pi and then Power up the SC16IS752 all works fine. The SC16IS752 seems to need the I2C runs before it starts...

@Thomas-GeDaD
Copy link
Author

Thomas-GeDaD commented Nov 18, 2019

By the way I think it´s an issue that all devices displayed as configurated and recognized:
2019-11-18_20h12_20
But not availible:
2019-11-18_20h09_55

Thank´s for your Help!!!

@EJM321
Copy link

EJM321 commented Mar 22, 2022

Hi

I'm hoping this is the correct spot for this question.

I'd like to re-open this issue/look into this issue as I'm experiencing exactly the same problem as Thomas-GeDaD did, but with only x2 devices (SC16IS752). I find that individually (i.e only one overlay enabled at a time in config.txt), each of the two devices work as expected, yet when I enable both overlays neither of them works (not TX or RX).

works:

dtoverlay=sc16is752-i2c-overlay,int_pin=6,addr=0x48
#dtoverlay=sc16is752-i2c-overlay,int_pin=5,addr=0x4c

works:

#dtoverlay=sc16is752-i2c-overlay,int_pin=6,addr=0x48
dtoverlay=sc16is752-i2c-overlay,int_pin=5,addr=0x4c

does not work:

dtoverlay=sc16is752-i2c-overlay,int_pin=6,addr=0x48
dtoverlay=sc16is752-i2c-overlay,int_pin=5,addr=0x4c

I have 1k pullups on the interrupt pins. Both devices seem to initialise correctly as I'm seeing "UU" at both addresses using i2cdetect. I have other hardware on the bus too as you can see below, yet they have been behaving just fine.
GPIO expander at 0x20
GPIO expander at 0x22
PWM/LED driver at 0x40

ls /dev yields the expected ttySC0, ttySC1, ttySC2, ttySC3

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- 22 -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- UU -- -- -- UU -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

I have tried:

  • different I2C addresses (e.g 0x48 and 0x4d, 0x48 and 0x49, 0x48 and 0x4c).
  • different I2C speeds (200kHz,100kHz, 70kHz)
  • different stty -F baud rate speeds 115200 and 9600
  • different rpi gpios (0x48 on GPIO24, 0x48 on GPIO6 and 0x4d on GPIO5)

RPI model: 3b
uname -a: Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

Any help/tips/ideas on this would be much appreciated!


Overlays I'm using, with config.txt parameters as needed:

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2835";

	fragment@0 {
		target = <&i2c1>;

		frag1: __overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			sc16is752: sc16is752@48 {
				compatible = "nxp,sc16is752";
				reg = <0x48>; // i2c address
				clocks = <&sc16is752_clk>;
				interrupt-parent = <&gpio>;
				interrupts = <24 0x2>; /* IRQ_TYPE_EDGE_FALLING */
				gpio-controller;
				#gpio-cells = <0>;
				i2c-max-frequency = <400000>;
				status = "okay";

				sc16is752_clk: sc16is752_clk {
					compatible = "fixed-clock";
					#clock-cells = <0>;
					clock-frequency = <14745600>;
				};
			};
		};
	};

	__overrides__ {
		int_pin = <&sc16is752>,"interrupts:0";
		addr = <&sc16is752>,"reg:0",<&sc16is752_clk>,"name";
		xtal = <&sc16is752_clk>,"clock-frequency:0";
	};
};

config.txt

dtparam=i2c_arm=on,i2c_arm_baudrate=100000

dtoverlay=spi0-cs
dtoverlay=spi1-1cs,cs0_pin=18,cs0_spidev=off

#dtoverlay=lirc-rpi

dtparam=audio=on

dtoverlay = pi3-disable-bt

dtparam=spi=on
dtoverlay=mcp2515-can1-0,oscillator=16000000,interrupt=16
dtoverlay=spi-bcm2835-overlay

enable_uart=1

max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1

dtoverlay=sc16is752-i2c-overlay,int_pin=6,addr=0x48
dtoverlay=sc16is752-i2c-overlay,int_pin=5,addr=0x4c

Here is a dtc -Ifs /proc/device-tree > devicetree4.txt dump:
devicetree4.txt

@pelwell
Copy link
Contributor

pelwell commented Mar 22, 2022

Your system is showing its age.

  1. Don't include the '-overlay' in the name - compiled overlays are named whatever.dtbo, not whatever-overlay.dtb, and they are loaded with dtoverlay=whatever. The current firmware doesn't look for the alternative forms, and will fail to load your overlays.
  2. The spi-bcm2835 overlay doesn't exist in current kernels - the upstream SPI driver is used by default.
  3. That 4.19 kernel is approaching its third birthday - it predates the issue on which you've just piggybacked. Our legacy support ("oldstable") kernel is 5.10, and all future images will ship with 5.15. A lot has happened in that time, including the fixing of a number of issues with that driver, so we won't be supporting 4.19.

@Thomas-GeDaD
Copy link
Author

This is what i add to the boot config and it works fine since the fix in all versions until now:
dtoverlay=sc16is752-i2c,int_pin=13,addr=0x4c,xtal=14745600
Here you find my postinstall for a board:
https://github.com/Thomas-GeDaD/SignalK_raspberry_MCS/blob/master/postinstall.js

@pelwell
Copy link
Contributor

pelwell commented Mar 22, 2022

Thanks for contributing, Thomas - which kernel are you running?

@EJM321
Copy link

EJM321 commented Mar 23, 2022

Hi Pelwell and Thomas, thanks for the advice, I was bit hesitant to update the OS as I have a lot of pre-configured/installed python modules that I use. It would take quite a bit of time setting that all up again. But being on buster it appears that I can update to bullseye (5.10) using these steps without having to start from scratch:

https://www.tomshardware.com/how-to/upgrade-raspberry-pi-os-to-bullseye-from-buster

I have backups of my data, so should be good to go.

Also, just to make sure, I'm using the SC16IS752 overlay from here:

jason77-wang/eoan-rpi-pull@9bf908c

Is this the correct one to use? It appears to be the most recent.

So in summary, I will:

  • Update OS to 5.10
  • Rename/re-compile (dts to dtb) overlay with -overlay omitted in the filename, i.e: sc16ic752-i2c
  • Try again with both devices enabled in config.txt:

dtoverlay=sc16is752-i2c,int_pin=6,addr=0x48
dtoverlay=sc16is752-i2c,int_pin=5,addr=0x4c

Hopefully I get some joy out of these changes.

@EJM321
Copy link

EJM321 commented Mar 23, 2022

Also Thomas, to get the three devices working for you, did you have to power up or reset the SC16IS752 devices after the RPI booted? Or did that not make a difference in the end?

@Thomas-GeDaD
Copy link
Author

We use several Kernels. We sell the MCS in a shop and there are many >500 in the market. I have nerver heard about an issue of the i2c-Serial interfaces, so i think it works on every Kernel version after this, old issue.
@EJM321
Why you compile your own overlay? The sc16is752 is already intigrated. So you only have to load the dt-overlay in the config.txt? So if you start from stratch, only add the line in the config.txt and all works fine. Here you find an overview of our board:
https://github.com/Thomas-GeDaD/openplotter-MCS/blob/master/QuickGuide_MCS.pdf
And this is the load of the dt-overlay:
https://github.com/Thomas-GeDaD/SignalK_raspberry_MCS/blob/f439b5b7c65583c19eb5798ef4d2adb38cd768c5/postinstall.js#L39
This is the shematic:
image

@EJM321
Copy link

EJM321 commented Mar 23, 2022

Thanks for the updated feedback Thomas, that sounds good, I will give it a try now that I know the 4.19.x seems to be the issue.

@Thomas-GeDaD
Copy link
Author

no there was no issue with 4.19. This issue here was based on the sc16is752. The chip has a problem, when there is at first VDD before the i2c is availible. then you get an addressconflict when you use the scl/sda line for adressing the chip. I have change the addresses of the board so i dont need a i2c line for addressing. only use the VDD/gnd for the adresspins!
Ther was an issue with the dt-overlay in 5.4.51. But this was solves. In all other Kernel versions after beginning of 2020 all works fine.
Here you find the issue of 5.4.51:
#3765

@EJM321
Copy link

EJM321 commented Mar 23, 2022

But that's a bit strange as for that very reason I avoided using those addresses that use the SDA and SCL lines in the first place. So I'm also just using the VDD/GND for addressing (e.g 0x48, 0x4d, 0x4c etc),

But still I'm experiencing this multiple device issue? Anyway I will update the OS first and let you know how it went.

@pelwell
Copy link
Contributor

pelwell commented Mar 23, 2022

Thomas is correct in that you don't need to install any overlays - it is already present and verified to work.

@EJM321
Copy link

EJM321 commented Mar 23, 2022

Thanks Pelwell, I take note of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants