Skip navigation.
Home
The QNX Community Portal

View topic - Serial Port as Debug Interface

Serial Port as Debug Interface

For discussion of realtime and/or embedded programming.

Serial Port as Debug Interface

Postby anvesh » Wed Aug 18, 2010 10:04 pm

Hi,
I have a standard x86 board. I have put QNX 6.4.1 without photon on it. During the development phase, I have a display monitor connected to the x86 where I can see the console. On field, there won't be any monitor connected. In that scenario, I want to use the serial port as a Debug Interface so that, it can be connected to my laptop and run the applications on the QNX terminal. I would like to know what needs to be done in order to see the QNX console on the Hyperterminal of my laptop.
Any suggestion is highly appreciated.
Thanks.
anvesh
Active Member
 
Posts: 31
Joined: Wed Dec 03, 2008 6:57 am

Postby lovelyp » Thu Aug 19, 2010 4:56 am

As far as i know --> Connect your x86 board to the laptop using a serial modem cable. Port settings should be the same. Write a script in which attach your executable to pseudo tty by using pterm <executable_name>. Save this script in /etc/profile.d. Run the script. Your executable will start working and the serial console in your laptop will give out the prints given in the executable.

This is what i know. I request the rest of our open qnx friends to give more input on this
lovelyp
Active Member
 
Posts: 23
Joined: Sat Jan 30, 2010 9:14 am

Postby maschoen » Thu Aug 19, 2010 5:45 am

Are you self hosting or are you using the IDE on some other system, eg. Windows? If the former, take a look at a .build file in /boot/build. If the latter, create a target project and look at the default boot script file.

In either case you will see something like this:

devc.console &
reopen /dev/con1

You will need to replace this with something like:
devc.8250 &
reopen /dev/ser1

Examples in the docs should be helpful.

This will redirect the console to the serial port.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Postby anvesh » Thu Aug 19, 2010 2:41 pm

Hi Maschoen,
Thanks for the reply. I thought that I need to write some application which redirects the console. A simple redirection has solved the problem.
anvesh
Active Member
 
Posts: 31
Joined: Wed Dec 03, 2008 6:57 am

Postby anvesh » Thu Aug 19, 2010 3:23 pm

My problem has become a bit more complicated. I came to know that the serial port will be used to connect to some external peripheral. Can I use the ethernet port to redirect the console on to the network port? If yes, pls share the info.
Maschoen: I'm using Windows IDE and flashed QNX on the target.
anvesh
Active Member
 
Posts: 31
Joined: Wed Dec 03, 2008 6:57 am

Postby maschoen » Thu Aug 19, 2010 6:10 pm

I don't know the answer to that. Ethernet is not like a serial port. There may be a simple way to do it, but here is a complicated way.

Write an resource manager that owns /dev/eth_con that you can open and write to, like a serial port. When a client writes to this device, send out UDP packets to some known IP/Port address. Before starting this resource manager in the build script you will first need to start io-pkt, mount tcpip, and configure your ethernet. After that, you can use reopen to redirect the console to this port.

Then you will need a program to read at this IP/Port address.

Since this is such an obvious way to debug things, I'd guess that there is an easier way. You might want to check the docs on building embedded systems and debugging targets.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Postby anvesh » Fri Aug 20, 2010 4:01 pm

I'm thinking about one solution in my mind. Please suggest whether that is possible or not. I would like to see the console of target which is having no photon from Phindows. Can I connect to a QNX target without photon using Phindows?
anvesh
Active Member
 
Posts: 31
Joined: Wed Dec 03, 2008 6:57 am

Postby mario » Fri Aug 20, 2010 4:46 pm

No. My solution to this is to run a virtual session of photon, without any graph driver. That means it can ONLY be access via phindows. All of a processes are started in pterms that are running inside the virtual photon session. Works great for us.

You may be able to telnet into the machine and http://sendreceivereply.wordpress.com/2 ... delivered/ never tried it myself.

There is also : http://community.qnx.com/sf/discussion/ ... CCCDA7BC94
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 3 guests

cron