View topic - Create Serial Communication between 2 devices using UART

Page 1 of 2

Create Serial Communication between 2 devices using UART

PostPosted: Mon Sep 16, 2019 5:57 am
by bosssaurav
OS : QNX ver 7.0

My board has two gpio pins configured as UART2

GPIO_PX_0 UART TX Address : 0xe500
GPIO_PX_0 UART RX Address : 0xe508

Port X address : 0x20080

Now I want to create a serial device file using command : devc-ser8250 [options] [port[^shift][,irq]] &. to be configured at 115200 baud rate.

Which options should i use with devc-ser8250 command to that my serial device file maps to above mention GPIO pins and PORT address?

Also how do I check if the data is being transmitted on the GPIO pins or not. ?

How do we check device tree in QNX and all the address and status of GPIO pins in QNX ?

Thanks :)

Re: Create Serial Communication between 2 devices using UART

PostPosted: Tue Sep 17, 2019 7:03 am
by nico04
Hi,

I guess your system is x86 based. Right ?
If not, what is your processor board ?

To check communication, use a scope to look at Tx pin.
You can also loopback Tx on Rx. Then all bytes sent shall be received.

There's no device tree on QNX.

Nicolas

Re: Create Serial Communication between 2 devices using UART

PostPosted: Tue Sep 17, 2019 8:07 am
by ger
Is the UART Intel (derived from old 8250 or 16x50)? If not devc-ser8250 probably won't work.

Geoff.

Re: Create Serial Communication between 2 devices using UART

PostPosted: Thu Sep 19, 2019 4:37 am
by bosssaurav
No,
the system is x64 based.
Kindly help me with the commands to enable uart on the system and how to create Loopback.

Details same as earlier :

GPIO_PX_0 UART TX Address : 0xe500
GPIO_PX_0 UART RX Address : 0xe508

Port X address : 0x20080

Re: Create Serial Communication between 2 devices using UART

PostPosted: Thu Sep 19, 2019 7:09 am
by nico04
Can you post a link to the board you use ?

Re: Create Serial Communication between 2 devices using UART

PostPosted: Thu Sep 19, 2019 8:55 am
by bosssaurav

Re: Create Serial Communication between 2 devices using UART

PostPosted: Thu Sep 19, 2019 9:42 am
by nico04
This is a general information web page, not the board page.
Which processor does the board uses ?

Re: Create Serial Communication between 2 devices using UART

PostPosted: Fri Sep 20, 2019 4:04 am
by bosssaurav
It uses Octa-core Arm64-bit processors.

I don't have lots of details but even considering to generic nvidia Xavier n all.. What would be the process ?

Re: Create Serial Communication between 2 devices using UART

PostPosted: Fri Sep 20, 2019 6:29 am
by nico04
So, you're not using a x64 processor but a Arm64 one (x64 refers to Intel/AMD 64 bit processors.)

I doubt the devc-ser8250 driver fits this chip.

You get a QNX BSP for nvidia delivered with QNX7.
There must be some documentation explaining how to run a serial driver.
Can you post the build file delivered with the BSP ?
The build file should be in something like xxx\src\hardware\startup\boards\yyy\zzz

Re: Create Serial Communication between 2 devices using UART

PostPosted: Fri Sep 20, 2019 11:35 am
by bosssaurav
Regarding x64. I didn't know that. Thanks for clarifying :)

Sorry I don't have the build-docs.

Assuming it was devc-8250 and details provided in the first comment.

Could you help me with the commands to configure UART. ?

Re: Create Serial Communication between 2 devices using UART

PostPosted: Fri Sep 20, 2019 3:03 pm
by nico04
Can you answer my question in my previous post ?

Re: Create Serial Communication between 2 devices using UART

PostPosted: Mon Sep 23, 2019 5:15 am
by bosssaurav
Unfortunately, I dont have the build files.

Supposing i want to create UART on QNX over some generic hardware.

What steps need to be followed?

Re: Create Serial Communication between 2 devices using UART

PostPosted: Mon Sep 23, 2019 7:05 am
by nico04
Have you installed QNX Momentics and QNX Software Center on your machine ?

Re: Create Serial Communication between 2 devices using UART

PostPosted: Fri Sep 27, 2019 10:06 am
by maschoen
bosssaurav wrote:Unfortunately, I dont have the build files.

Supposing i want to create UART on QNX over some generic hardware.

What steps need to be followed?


I've been reading the discussion here. To begin with, I don't know of any serial driver that works with generic GPIO pins. There may be one but it would surprise me. You could create your own driver, but I suspect there is an inherent problem. If the GPIO pins have an interrupt that fires on level changes you could write an interrupt handler to receive data, however it would be rather unusual in that you would have to process an interrupt on every bit. You would also have to deal with when to timeout to recognize a frame error. An alternative would be to have a periodic interrupt that would sample the GPIO. I believe there's an theorem that says you can run that interrupt at twice the baud rate and not miss data. The same interrupt could be used to output data. Without using interrupts you would need to dominate the processor while sending and receiving data which is very un-qnx and un-realtime like. All this sounds rather hacky and unnecessary. I would think a better solution would be to connect a UART of some kind, even one with serial interface of some kind.

You would generally write a QNX driver such as this one using the Resource Manager framework. This is not a simple task the first time through, but there is sample code around and two references on the subject, the QNX guide and Robert Krten's book. I think the source to the 8250 driver is available somewhere, although it will only be useful on the OS side. The hardware it supports is a UART.

Re: Create Serial Communication between 2 devices using UART

PostPosted: Fri Sep 27, 2019 12:53 pm
by nico04
My understanding is different.

My board has two gpio pins configured as UART2

GPIO_PX_0 UART TX Address : 0xe500
GPIO_PX_0 UART RX Address : 0xe508

What I understand :
- The chip has UART2
- Pin mux registers for GPIO/UART are at addresses 0xe500 and 0xe508
- bosssaurav wants to use UART2 with QNX