Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8680119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:09:50+00:00 2026-06-12T21:09:50+00:00

I have an application talking between the PC and a board with a microcontroller

  • 0

I have an application talking between the PC and a board with a microcontroller running uCLinux. When I send a message over the /dev/TTYS0 I get it on the PC side, however the message comes across as gibberish. I’m pretty sure that I have a baud rate mismatch of some sort.

On the PC side I’m using the baud rate provided:

Serial<id=0x1efb320, open=True>(port='COM4', baudrate=9600, bytesize=8, parity='
N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)

On the Linux board side I’m setting the same baud rate in the code:

tcgetattr(fd, &options);
cfsetispeed(&options, 9600);
cfsetospeed(&options, 9600);
tcsetattr(fd, TCSANOW, &options);
tcgetattr(fd, &options);

This worked for me when I was testing a PC (Win 7)->Linux Box (OpenSuse) so I know the theory is sound. Now that I’ve ported this to my true target (coldfire microcontroller board running uCLinux) I’m getting garbage.

So my first option is to “guess and check” at various baud rates to see if I can find one that will work, but rather than that I’d like to programmatically find a way to identify the supported baud rates of a specific target.

I’m sure there’s some API, but I haven’t found one. Ideas?

EDIT:
Seems it’s possible to get max baud rate on Windows with the COMMPROP structure. Does anything even like this exist on Linux?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:09:52+00:00Added an answer on June 12, 2026 at 9:09 pm

    Please read the cfsetospeed() man page. The speed parameter must be a constant: B50, B75, .., B9600, B19200, B38400, B57600, B115200, or B230400, not just the rate as a number.

    To find out if a specific rate is supported, just set it cfset?speed()+tcsetattr(), then read back the settings (using tcgetattr()+cfget?speed()), and check if the speed was set to the desired value or not. The driver should reject invalid baud rates, I believe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a web application talking to a Postgres SQL database at work -
We have a .NET application talking to Oracle 10g. Our DBA recently pulled a
I have an application that switches between usercontrols a lot, I want them to
i have big trouble with my application that web-application(jsp,java,servlet) landed between two server cause
I have a javascript web application almost totally rendered client side. The data is
I have a java application and I would like to get some data from
I have an application that will need extremely little persistent storage. Realistically, we're talking
I have an application where I am taking a bitmap and compressing it using
I have application which uses Sherlock ActionBar package. The application uses platform-specific behavior for
I have application where i have two view controllers my first view and second

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.