View topic - Create Serial Communication between 2 devices using UART

Create Serial Communication between 2 devices using UART

For discussion of realtime and/or embedded programming.

Create Serial Communication between 2 devices using UART

Postby bosssaurav » Mon Sep 16, 2019 5:57 am

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 :)
Last edited by bosssaurav on Mon Sep 23, 2019 5:10 am, edited 2 times in total.
bosssaurav
New Member
 
Posts: 7
Joined: Tue Sep 10, 2019 6:34 pm

Re: Create Serial Communication between 2 devices using UART

Postby nico04 » Tue Sep 17, 2019 7:03 am

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
nico04
Senior Member
 
Posts: 152
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Create Serial Communication between 2 devices using UART

Postby ger » Tue Sep 17, 2019 8:07 am

Is the UART Intel (derived from old 8250 or 16x50)? If not devc-ser8250 probably won't work.

Geoff.
ger
Active Member
 
Posts: 29
Joined: Tue Jul 15, 2014 9:24 am

Re: Create Serial Communication between 2 devices using UART

Postby bosssaurav » Thu Sep 19, 2019 4:37 am

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
Last edited by bosssaurav on Mon Sep 23, 2019 5:06 am, edited 1 time in total.
bosssaurav
New Member
 
Posts: 7
Joined: Tue Sep 10, 2019 6:34 pm

Re: Create Serial Communication between 2 devices using UART

Postby nico04 » Thu Sep 19, 2019 7:09 am

Can you post a link to the board you use ?
nico04
Senior Member
 
Posts: 152
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Create Serial Communication between 2 devices using UART

Postby bosssaurav » Thu Sep 19, 2019 8:55 am

bosssaurav
New Member
 
Posts: 7
Joined: Tue Sep 10, 2019 6:34 pm

Re: Create Serial Communication between 2 devices using UART

Postby nico04 » Thu Sep 19, 2019 9:42 am

This is a general information web page, not the board page.
Which processor does the board uses ?
nico04
Senior Member
 
Posts: 152
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Create Serial Communication between 2 devices using UART

Postby bosssaurav » Fri Sep 20, 2019 4:04 am

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 ?
bosssaurav
New Member
 
Posts: 7
Joined: Tue Sep 10, 2019 6:34 pm

Re: Create Serial Communication between 2 devices using UART

Postby nico04 » Fri Sep 20, 2019 6:29 am

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
nico04
Senior Member
 
Posts: 152
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Create Serial Communication between 2 devices using UART

Postby bosssaurav » Fri Sep 20, 2019 11:35 am

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. ?
bosssaurav
New Member
 
Posts: 7
Joined: Tue Sep 10, 2019 6:34 pm

Re: Create Serial Communication between 2 devices using UART

Postby nico04 » Fri Sep 20, 2019 3:03 pm

Can you answer my question in my previous post ?
nico04
Senior Member
 
Posts: 152
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Create Serial Communication between 2 devices using UART

Postby bosssaurav » Mon Sep 23, 2019 5:15 am

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?
bosssaurav
New Member
 
Posts: 7
Joined: Tue Sep 10, 2019 6:34 pm

Re: Create Serial Communication between 2 devices using UART

Postby nico04 » Mon Sep 23, 2019 7:05 am

Have you installed QNX Momentics and QNX Software Center on your machine ?
nico04
Senior Member
 
Posts: 152
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Create Serial Communication between 2 devices using UART

Postby maschoen » Fri Sep 27, 2019 10:06 am

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.
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm

Re: Create Serial Communication between 2 devices using UART

Postby nico04 » Fri Sep 27, 2019 12:53 pm

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
nico04
Senior Member
 
Posts: 152
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Next

Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 1 guest