Skip to content

Driver sc16is7xx is not enabling IRQ in sc16is752 chip? #3231

Closed

Description

@kaamil1984

I'm trying to use sc16is752 chip connected to spi1 (and INT to gpio24) and it looks like chip does not generate IRQ when it receives some data.

I have checked this with logic analyzer. SC16IS752 INT pin is always HIGH (pulled up to Vdd by 1kOhm resistor).

I'm using screen /dev/ttySC0 9600 to check if port works. It does not receive data until I "manually" generate falling edge on gpio24 (by shorting it to GND for a moment). When I do that - looks like whole buffer is being read, so interrupt mechanism is working fine.

I also tried to disconnect INT pin from Raspberry to be sure, that Raspberry is not holding this pin in HIGH state somehow.

I saw driver source here: sc16is7xx.c line 1042, it looks that it should enable interrupts in chip, but it doesn't.

static int sc16is7xx_startup(struct uart_port *port)
{

        // (...)

	/* Enable RX, TX interrupts */
	val = SC16IS7XX_IER_RDI_BIT | SC16IS7XX_IER_THRI_BIT;
	sc16is7xx_port_write(port, SC16IS7XX_IER_REG, val);

	return 0;
}

I'm using RPi CM3 module (with "Waveshare Compute Module IO Board Plus" development board) and custom board with SC16IS752, RS485 transceivers and a lot of not related stuff.

schematic

System

# cat /etc/rpi-issue

Raspberry Pi reference 2019-04-08
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, e910bf55ac92e27c6e77043e8995bcb5e0a2d742, stage2
# vcgencmd version
Aug 15 2019 12:06:42
Copyright (c) 2012 Broadcom
version 0e6daa5106dd4164474616408e0dc24f997ffcf3 (clean) (release) (start)
# uname -a
Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

Activity

  1. pelwell commented on Sep 25, 2019

    @pelwell
    Contributor

    Are we supposed to know/assume/guess that pin 6 on CON28 is wired to GPIO24? Many people are using this device, so I'd be very surprised if the IRQ function doesn't work.

  2. JamesH65 commented on Dec 20, 2019

    @JamesH65
    Contributor

    @kaamil1984 Is this issue still present?

  3. added
    Close within 30 days
    Waiting for external input
    on Dec 20, 2019
  4. kaamil1984 commented on Dec 27, 2019

    @kaamil1984
    Author

    Well, it looks like that I had some other issue with device tree or drivers.

    After few tries with diffrent GPIO mappings I managed to get it work.

    I also discovered, that IRQ functionality is not used by UART driver when it receives data. On logic analyzer I see that linux driver continuously checks if there is some data in buffer. I guess that IRQ is used for sc16is752 GPIO input state changes, but I'm not using these GPIOs.

    I'm not completely satisfied how this driver or sc16is752 device or maybe just my configuration works, because SPI bus is continuously busy, but IT WORKS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Close within 30 daysWaiting for external input

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions