PCIe serial with Jetson TX2 not working

I am using Exar xr17v35x (DS-MPE-SER4M) on a PCIE for Serial Communication. I am using driver xr17v35x.
Steps i am following are

  1. $ lspci -vd 13a8:*

01:00.0 Serial controller: Exar Corp. Device 0354 (rev 03) (prog-if 02 [16550])
Flags: fast devsel, IRQ 388
Memory at 50100000 (32-bit, non-prefetchable)
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [78] Power Management version 3
Capabilities: [80] Express Endpoint, MSI 01
Capabilities: [100] Virtual Channel
Kernel driver in use: xrserial

  1. ls /sys/bus/pci/drivers/serial/

0000:01:00.0 bind new_id remove_id uevent unbind

  1. $ echo -n “0000:01:00.0” > /sys/bus/pci/drivers/serial/unbind
    This is unbinding the generic serial driver from XR17V35x device

  2. insmod xr17v35x.ko

Output of dmesg | grep tty
0000:01:00.0: ttyXR0 at MMIO 0x50100000 (irq = 388, base_baud = 7812500) is a XR17V35X
0000:01:00.0: ttyXR1 at MMIO 0x50100400 (irq = 388, base_baud = 7812500) is a XR17V35X
0000:01:00.0: ttyXR2 at MMIO 0x50100800 (irq = 388, base_baud = 7812500) is a XR17V35X
0000:01:00.0: ttyXR3 at MMIO 0x50100c00 (irq = 388, base_baud = 7812500) is a XR17V35X

So port ttyXR0, ttyXR1, ttyXR2, ttyXR3 is creating in /dev/

But when i am doing a loopback test i am not getting output . It is showing “Read Error”. It is not Communicating serially.

I am doing this on #2 configuration.

It looks like the kernel is recognizing the serial card but the ttyS* devices do not talk to the card for some reason.

Can someone help me find out if I am missing any step?
Do I need to load any kernel module?
Do I need to run anything before this can work?

Because lspci is showing, PCIe seems to be functioning to at least some degree. Because the device special files are created, it implies that the driver was also loaded and functioning.

Just to see what it might say about errors, post the verbose lspci (using three “-v” requires sudo):

sudo lspci -d 13a8: -vvv

In your loopback be sure TX and RX are bridged, and also bridge CTS and RTS. Then try your serial port test both with and without flow control.

Thanks for a reply.

$ sudo lspci -d 13a8: -vvv

01:00.0 Serial controller: Exar Corp. Device 0354 (rev 03) (prog-if 02 [16550])
Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 388
Region 0: Memory at 50100000 (32-bit, non-prefetchable)
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Address: 0000000000000000 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v2) Endpoint, MSI 01
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis-, LTR-, OBFF Not Supported
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [100 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
Status: NegoPending- InProgress-
Kernel driver in use: xrserial

As you said i am posting a verbose lspci…

So it appears the PCIe is working correctly at gen. 1 speeds and no errors. The driver is xrserial (which makes sense if it is using “xr” in the “/dev/” name).

What program are you using to determine loopback function? I tend to prefer gtkterm…but for whatever app you use, what settings are you using? Being in loopback guarantees both send and receive are matching in setup, but if for example the port is in a mode far enough different from what your app is using, then nothing will show (or garbage will show if you are getting close). This particular driver might differ in defaults from what I am used to.

Also, beware that often the user talking over the port needs to have either sudo permission or be in group “dialout”. You would need to use “ls -l” on the device special file to see for sure.

I am using minicom for loopback function.

baudrate - 115200
hardware flow control - disable
software flow control - disable

Permission for ttyXR

crw-rw---- 1 root dialout 30, 0 May 6 05:47 ttyXR0
crw-rw---- 1 root dialout 30, 1 May 6 05:47 ttyXR1
crw-rw---- 1 root dialout 30, 2 May 6 05:47 ttyXR2
crw-rw---- 1 root dialout 30, 3 May 6 05:47 ttyXR3

If you add package “gtkterm” (“sudo apt-get install gtkterm”…requires a GUI), and run as root (sudo), try this with TX and RX jumpered together for loopback (I am assuming ttyXR0, but you will need to adjust):

gtkterm -b 8 -t 1 -s 115200 -p /dev/ttyXR0

Do you see echo of what you type in? If so, then it works. If you see garbage, then it works, but one of the settings is “close”. If you see nothing, then it may just be a setting.

Typically you’d also want to try speeds 9600 and 38400:

gtkterm -b 8 -t 1 -s 9600 -p /dev/ttyXR0
gtkterm -b 8 -t 1 -s 38400 -p /dev/ttyXR0

Hi,

I was trying this “gtkterm -b 8 -t 1 -s 115200 -p /dev/ttyXR0” but no success.

I was reading dmesg log, then i got

“serial 0000:01:00.0 couldn’t register serial port 0, irq 388, type 2, error -28”

could it be a issue?
if yes then how to resolve it?

Something in the driver seems to not be set up correctly, but I have no way to make a guess at what. Would someone at NVIDIA be able to comment on “error -28”?

Hello, I’m working with a similar Exar card and would like to hear if you resolved the driver or configuration issue that prevents the uarts from working.