Home/Support/Support Forum/How to TX/RX on same serial port
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How to TX/RX on same serial port

0 votes
I have noticed that the discussion on how to do RX/TX on the serial port on Connect ME, and similar platforms, comes back again. I am posting a small example that outlines the skeleton on how I did it. I had to remove and change things that relate to our product, so I don’t get in trouble, but one can easily get the idea. This also means that the code will most likely not work as-is; I just don’t have time to pats around with it, so you will have to do some work. Feel free to use it and abuse it - just do that at your own risk.
I used mutex locking to achieve transfer.
You can also look around for instructions on how to maximize the speed of the serial ports if you need – they should be still floating in the posts, so I won’t repeat them here.
I am not claming that this is the way to do it. It is only an example on how I did it using Digi examples and voodoo and got good results.
Just call the serial_threads_start is from your applicationStart.

Enjoy.
asked Jul 2, 2007 in Plug N' Play by ieftimovski New to the Community (24 points)
recategorized Dec 18, 2013 by tuxembb

Please log in or register to answer this question.

5 Answers

0 votes
This code example would be interesting, unfortunately it seems to be gone. Maybe somebody can re-post it?
answered Apr 8, 2010 by hgiritzer New to the Community (3 points)
0 votes
hgiritzer,

Since the original post is from 2004, I assume that ieftimovski was using an original ME with NetOS 4 or 5. The way NetOS uses the serial port has completely changed and any code from then wouldn't work.

-Erik
answered Apr 8, 2010 by egawtry Veteran of the Digi Community (349 points)
0 votes
The post is from Jul 2, 2007, but anyway rather old, that's true.

Nevertheless a small example of how to use the serial port from within a C program (Embedded Linux) and the steps to free the serial port for this application (disable console and what there might be necessary) would be really helpful.
answered Apr 8, 2010 by hgiritzer New to the Community (3 points)
0 votes
Sorry, you are right, I was looking at the wrong date.

It does appear that he is using NetOS though, unless you have an applicationStart in µLinux.

I have used serial ports extensively (written drivers even) with full Linux. The way UNIX works, I would assume that it is identical. What do you want to know?

-Erik
answered Apr 9, 2010 by egawtry Veteran of the Digi Community (349 points)
0 votes
Well, I got it to work in the meantime.

My problem was causes by a misconfigration of the DigiME Embedded Linux ("make xconfig"):

Additionally to the needed "Digi NS921x serial port support" there was the "8250/16550 and compatible serial support" selected, which rendered the serial port unusable (not communicating).

After removal of the "8250/16550 and compatible serial support" it worked as expected.

Thanks,
Helmut
answered Apr 12, 2010 by hgiritzer New to the Community (3 points)
...