LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-04-2005, 09:22 PM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Rep: Reputation: 30
serial port program for Linksys WAP54G segfaulting (linux)


Hey all,

I wrote a program that reads data from a serial port, from a temperature sensor in specific in linux. It opens a file descriptor to /dev/ttyS0, does a tcflush() and sets the serial port attributes. It works perfectly with my desktop linux machine, reads temperatures correctly and all.

For research, I modified a Linksys WAP54G wireless access point to add a serial port to it. I then hooked up my sensor, and tried running my program, and it seg faults at tcflush()

The WAP54G runs embedded linux, I enabled serial port support in the kernel, and has /dev/tts/0 and /dev/tts/1 ... I tried both device links and both seg fault at tcflush(). If i comment out tcflush(), i get no data... but why is tcflush() segfaulting?

I can try to provide more information if neede, just trying to read data from the serial port. Here is the modification I did:
http://www.rwhitby.net/wrt54gs/serial.html

the WAP54G has the same serial port stuff on the motherboard, so it was the same.

Anyways, any help or suggestions would be greatly appreciated!
George
 
Old 06-05-2005, 02:42 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Well...For my taste you need to debug tcflush and see where it segfaults exactly. Try to run it under gdb - it should give you more info.
 
Old 06-06-2005, 12:43 AM   #3
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
i can't run gdb on the embedded device :\
 
Old 06-06-2005, 02:58 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Are you sure it's not ported and installed? There were embedded machines running BSD not long ago with gdb, gcc and other things.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drivers for Belkin 802.11g, Linksys WAP54G, Thomson SpeedTouch 510i Router ibzmiller Linux - Wireless Networking 1 06-07-2005 02:50 PM
linksys wap54g wireless access point 54 mbs master Linux - Wireless Networking 2 12-26-2004 01:58 AM
C++ serial port program problem doar Programming 3 10-01-2004 10:46 AM
Linksys WAP54G Inside the network? cupboardguy Linux - Wireless Networking 1 02-24-2004 01:19 PM
Controlling serial port RTS pin from 'C' program dcarter Slackware 1 09-26-2003 07:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration