2

Initial Question

I work with the NXP chip SC16IS740 as a peripheral to an embedded linux system (mainline kernel v4.8). The usecase is quite simple, a continuosly transmitting uart line (9600 8n1) shall be read via the chip's driver.

So far I included the driver module sc16is7xx in the kernel build and I am able to see the device as /dev/ttySC0.

However, I cannot read the uart for now and I suspect, I am missing the right configuration. I've tried it both with simply

cat /dev/ttySC0

and

minicom -D /dev/ttySC0 -b 9600 -8

Since there are just read-only files in the device's directory (/sys/class/tty/ttySC0/) and I don't find any documentation on how to use the driver, I'm running out of ideas.

What is the proper way of configuring this driver?


Edit: Config, logs & measurements

Config

I included the module in the kernel recipes config as followed:

CONFIG_SERIAL_SC16IS7XX_CORE=m
CONFIG_SERIAL_SC16IS7XX=m
CONFIG_SERIAL_SC16IS7XX_I2C=y

To load / unload the module (which results in loading/unloading the device /dev/ttySC0) I use:

modprobe [-r] sc16is7xx

Logs

Grepping dmesg for sc16is7 results in this kind of messages:

[ 5592.212905] [<c0379a14>] (uart_get_baud_rate) from [<bf07cf84>] (sc16is7xx_set_termios+0x1c4/0x374 [sc16is7xx])
[ 5592.213045] [<bf07cdc0>] (sc16is7xx_set_termios [sc16is7xx]) from [<c0379f04>] (uart_change_speed+0x5c/0x124)

Exactly these two messages are logged, every time I:

  • open or close the connection to /dev/ttySC0 with minicom or cat
  • change the baudrate or other serial port settings in minicom

Measurements

Measuring with a scope (including basic logic analyzing) I can see communication to the chip on the I2C line when I:

  • open or close the connection to /dev/ttySC0 with minicom
  • change the baudrate or other serial port settings in minicom

Otherwise, there is no communication at all on the line. At the moment, I'm trying to analyze the sent bytes and check them with the datasheet, i.e. debugging the driver in a way.

  • 1
    One thing comes to my mind: does the choice between the kernel config variables SERIAL_SC16IS7XX_I2C and SERIAL_SC16IS7XX_SPI match the interface the hardware uses? Is the chip connected to I2C or SPI? Have you checked the logs for any messages from the driver? – Johan Myréen Aug 9 '17 at 20:02
  • What exactly do you want to configure? You can use IOCTLs, or stty on the commandline, to set baud rate etc. Your minicom test should show some input/output. You can configure the kernel module using options (see modinfo, modprobe). – dirkt Aug 10 '17 at 6:38
  • @JohanMyréen the chip is connected via I2C, so I included only SERIAL_SC16IS7XX_I2C. dmesg shows logs on setting the baudrate in minicom, otherwise none. – bunto1 Aug 10 '17 at 13:07
  • @dirkt if I understand correctly, you think that I don't need / there is not more configuration than what can be set in the serial tools (e.g. minicom)? I figured, there would be more settings / possibilities, but I am probably wrong there.. – bunto1 Aug 10 '17 at 13:13
  • Usually, the kernel driver (you didn't say which one you are using) should take care of all important configuration stuff, either via the IOCTL interface (which is also used by stty, minicom etc.), or otherwise (module options etc.). If it doesn't, you'll have to patch the kernel driver. I haven't read the datasheet, and as I don't know the driver, I haven't read the source code of it, either, but if you don't have a particular configuration you think you need and haven't found, you shouldn't worry. Unless something doesn't work. – dirkt Aug 10 '17 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.