ts-7000
[Top] [All Lists]

[ts-7000] Re: RS486 and linux-2.6.21-ts

To:
Subject: [ts-7000] Re: RS486 and linux-2.6.21-ts
From: Matthew Harrell <>
Date: Fri, 8 May 2009 21:36:31 -0400
Tried that before and it didn't matter.  Turns out the ioctls don't work
on 2.6.21 or at least I can't make them work.  When I used mmap and 
toggled the memory addresses in the manual I was able to get it to 
work fine


>                                          ^^^
>                             You have to pass an int, not a char
>> 
>>   // open socket above here
>> 
>>   char mcr = 5;
>
> int mcr = 5;
>
> Regards,
> Chris
>
>> 
>>   if ( -1 == ioctl ( _sock, TIOC_SBCS485, &mcr ) )
>>     cerr << "ioctl: " << strerror ( errno ) << " (" << errno << ")" << endl;
>> 
>> to get a half-duplex RS485 at 19200 baud.  When I try this, though, I get
>> the error
>> 
>>   ioctl: Invalid argument (22)
>> 
>> What am I doing wrong here?
>> 
>> 
>> ------------------------------------
>> 
>> Yahoo! Groups Links
>> 
>> 
>> 
>
>
> --tQNFdI7EwZjzC8XkwQTWP68hmqpSw6bUnW9rLll
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
>
>
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
>"http://www.w3.org/TR/html4/strict.dtd";>
><html>
><head>
></head>
>
>
>
>
><body style="background-color: #ffffff;">
>
><!--~-|**|PrettyHtmlStartT|**|-~-->
><div id="ygrp-mlmsg" style="width:655px; position:relative;">
><div id="ygrp-msg" style="width: 470px; margin:0; padding:0 25px 0 0; 
>float:left; z-index:1;">
><!--~-|**|PrettyHtmlEndT|**|-~-->
>
>     <div id="ygrp-text" >
>             <!--~-|**|PrettyHtmlStart|**|-~-->
>             <br><br>
>       <!--~-|**|PrettyHtmlEnd|**|-~-->
>       <p>Matthew Harrell wrote:<br>
> &gt; I have one of the 7260 boards and use my own build from the 
> linux-2.6.21-<wbr>ts<br>
> &gt; source tree.  I have the RS-485 option on my board which, according to 
> the<br>
> &gt; docs, should put it on ttyAM1.  According to the manuals 
> (ts-7260-manual<br>
> &gt; section 5.5 and arm-linux-ts72xx section 6.3) it looks like I need to 
> do<br>
> &gt; something like<br>
> &gt; <br>
> &gt;   #include &lt;asm/ioctls.<wbr>h&gt;<br>
> &gt;   #include &lt;sys/ioctl.h&gt;<br>
> &gt; <br>
> &gt;   #define TIOC_SBCC485 _IOW('T',0x70,<wbr>int) /*TS RTS/485 mode 
> Clear*/<br>
> &gt;   #define TIOC_SBCS485 _IOW('T',0x71, int) /*TS RTS/485 mode Set */<br>
><br>
> ^^^<br>
>                             You have to pass an int, not a char<br>
> &gt; <br>
> &gt;   // open socket above here<br>
> &gt; <br>
> &gt;   char mcr = 5;<br>
><br>
> int mcr = 5;<br>
><br>
> Regards,<br>
> Chris<br>
><br>
> &gt; <br>
> &gt;   if ( -1 == ioctl ( _sock, TIOC_SBCS485, &amp;mcr ) )<br>
> &gt;     cerr &lt;&lt; &quot;ioctl: &quot; &lt;&lt; strerror ( errno ) 
> &lt;&lt; &quot; (&quot; &lt;&lt; errno &lt;&lt; &quot;)&quot; &lt;&lt; 
> endl;<br>
> &gt; <br>
> &gt; to get a half-duplex RS485 at 19200 baud.  When I try this, though, I 
> get<br>
> &gt; the error<br>
> &gt; <br>
> &gt;   ioctl: Invalid argument (22)<br>
> &gt; <br>
> &gt; What am I doing wrong here?<br>
> &gt; <br>
> &gt; <br>
> &gt; ------------<wbr>---------<wbr>---------<wbr>------<br>
> &gt; <br>
> &gt; Yahoo! Groups Links<br>
> &gt; <br>
> &gt; <br>
> &gt; <br>
><br>
></p>
>  
>
>     </div>  
>
>     <!--~-|**|PrettyHtmlStart|**|-~-->
>     <div width="1" style="color: white; clear: both;"></div>
>       <!--~-|**|PrettyHtmlEnd|**|-~-->
>       </body>
>       <!--~-|**|PrettyHtmlStart|**|-~-->
>       <head>
><style type="text/css">
><!--
> #ygrp-mkp{
>   border: 1px solid #d8d8d8;
>   font-family: Arial;
>   margin: 14px 0px;
>   padding: 0px 14px;
> }
> #ygrp-mkp hr{
>   border: 1px solid #d8d8d8;
> }
> #ygrp-mkp #hd{
>   color: #628c2a;
>   font-size: 85%;
>   font-weight: bold;
>   line-height: 122%;
>   margin: 10px 0px;
> }
> #ygrp-mkp #ads{
>   margin-bottom: 10px;
> }
> #ygrp-mkp .ad{
>   padding: 0 0;
> }
> #ygrp-mkp .ad a{
>   color: #0000ff;
>   text-decoration: none;
> }
> -->
></style>
></head>
>       <head>
><style type="text/css">
><!--
> #ygrp-sponsor #ygrp-lc{
>   font-family: Arial;
> }
> #ygrp-sponsor #ygrp-lc #hd{
>   margin: 10px 0px;
>   font-weight: bold;
>   font-size: 78%;
>   line-height: 122%;
> }
> #ygrp-sponsor #ygrp-lc .ad{
>   margin-bottom: 10px;
>   padding: 0 0;
> }
> -->
></style>
></head>
>       <head>
>       <style type="text/css">
>       <!--
>       #ygrp-mlmsg {font-size:13px; font-family: 
> arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
>       #ygrp-mlmsg table {font-size:inherit;font:100%;}
>       #ygrp-mlmsg select, input, textarea {font:99% 
> arial,helvetica,clean,sans-serif;}
>       #ygrp-mlmsg pre, code {font:115% monospace;*font-size:100%;}
>       #ygrp-mlmsg * {line-height:1.22em;}
>       #ygrp-text{
>           font-family: Georgia;       
>       }
>       #ygrp-text p{
>           margin: 0 0 1em 0;
>       }
>
>       dd.last p a {
>           font-family: Verdana;
>           font-weight: bold;
>       }
>
>       #ygrp-vitnav{
>               padding-top: 10px;
>               font-family: Verdana;
>               font-size: 77%;
>               margin: 0;
>       }
>       #ygrp-vitnav a{
>               padding: 0 1px;
>       }
>       #ygrp-mlmsg #logo{
>         padding-bottom: 10px;
>       }
>
>       #ygrp-reco {
>       margin-bottom: 20px;
>       padding: 0px;
>       }
>       #ygrp-reco #reco-head {
>               font-weight: bold;
>               color: #ff7900;
>       }
>
>       #reco-category{
>               font-size: 77%;
>       }
>       #reco-desc{
>               font-size: 77%;
>       }
>
>       #ygrp-vital a{
>               text-decoration: none;
>       }
>
>       #ygrp-vital a:hover{
>         text-decoration: underline;
>       }
>
>       #ygrp-sponsor #ov ul{
>               padding: 0 0 0 8px;
>               margin: 0;
>       }
>       #ygrp-sponsor #ov li{
>               list-style-type: square;
>               padding: 6px 0;
>               font-size: 77%;
>       }
>       #ygrp-sponsor #ov li a{
>               text-decoration: none;
>               font-size: 130%;
>       }
>       #ygrp-sponsor #nc{
>         background-color: #eee;
>         margin-bottom: 20px;
>         padding: 0 8px;
>       }
>       #ygrp-sponsor .ad{
>               padding: 8px 0;
>       }
>       #ygrp-sponsor .ad #hd1{
>               font-family: Arial;
>               font-weight: bold;
>               color: #628c2a;
>               font-size: 100%;
>               line-height: 122%;
>       }
>       #ygrp-sponsor .ad a{
>               text-decoration: none;
>       }
>       #ygrp-sponsor .ad a:hover{
>               text-decoration: underline;
>       }
>       #ygrp-sponsor .ad p{
>               margin: 0;
>               font-weight: normal;
>               color: #000000;
>       }
>       o{font-size: 0; }
>       .MsoNormal{
>          margin: 0 0 0 0;
>       }
>       #ygrp-text tt{
>         font-size: 120%;
>       }
>       blockquote{margin: 0 0 0 4px;}
>       .replbq{margin:4}
>
> dd.last p span {
>   margin-right: 10px;
>   font-family: Verdana;
>   font-weight: bold;
> }
>
> dd.last p span.yshortcuts {
>   margin-right: 0;
> }
>
> div.photo-title a,
> div.photo-title a:active,
> div.photo-title a:hover,
> div.photo-title a:visited {
>     text-decoration: none;
> }
>
> div.file-title a,
> div.file-title a:active,
> div.file-title a:hover,
> div.file-title a:visited {
>     text-decoration: none;
> }
>
> #ygrp-msg p#attach-count {
>     clear: both;
>     padding: 15px 0 3px 0;
>     overflow: hidden;
> }
>
> #ygrp-msg p#attach-count span {
>     color: #1E66AE;
>     font-weight: bold;
> }
>
> div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts {
>     font-family: Verdana;
>     font-size: 10px;
>     font-weight: normal;
> }
>
> #ygrp-msg p a {
>     font-family: Verdana;
>     font-size: 10px;
> }
>
> #ygrp-mlmsg a {
>     color: #1E66AE;
> }
>
> div.attach-table div div a {
>     text-decoration: none;
> }
>
> div.attach-table {
>     width: 400px;
> }
>
>       -->
>       </style>
>       </head>
>       <!--~-|**|PrettyHtmlEnd|**|-~-->
>       </html><!--End group email -->
>
>
> --tQNFdI7EwZjzC8XkwQTWP68hmqpSw6bUnW9rLll--
>

-- 
  Matthew Harrell                          Rome did not create a great empire
  Bit Twiddlers, Inc.                       by having meetings - they did it by
                   killing all those who opposed them.


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU