To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 16992
16991  |  16993
Subject: 
Yes, the puzzle is solved - legousbtower + nqc for linux.
Newsgroups: 
lugnet.robotics
Date: 
Sat, 12 Jan 2002 04:00:14 GMT
Original-From: 
PC CHAN <pc.chan@alcatelIHATESPAM.com>
Viewed: 
1162 times
  
Dear Juergen and Andy,

I found the option to turn on data debugging on legousbtower this
evening.  It all turned out to be an issue between uhci and legousbtower.

  From the out_callback I could tell, it always sent 8 bytes no matter
what tower_send submitted.  The RCX brick was probably choked by the
extra bytes.

Looking at the uhci code, I found that it was dma'ing acording to
urb->transfer_buffer_length instead of the urb->actual_length.

I don't have the specifications to tell what uhci should be looking at.
   Anyway I modified tower_send to submitted bytes_to_write as
buffer_length as a workaround/fix.

It is now working!!!

As promised Juergen this morning, I am sending in the changes I made.

Please feel free to try and optimize them. (The usleeps I I added may
not be optimal nor accurate at all  The locks I added may not be that
necessarily after all.)

Thank you very much again for your kind response and time.

Cheers,
P.C. Chan

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

P.S.
To use RCX_USBTowerPipe_linux.cpp, please put it into the rcxlib
directory under nqc-2.4.a4 and modify the Makefile to take
RCX_USBTowerPipe_linux.o instead of RCX_USBTowerPipe_none.o

To use legousbtower,

-> // please mknod /dev/tower0 c 240 180
    //   ( mknod /dev/tower1 c 240 181.. if you have more than 1 tower.)
       ( chmod if necessary.) before insmod.

-> It works with uhci but NOT usb-uhci.
                           ---

***Sorry typos:  mknod /dev/tower0 c 180 240
                  mknod /dev/tower1 c 180 241 ...

                  valid minor nodes 240 to 245 (but not yet registered.)

********************************************************************






--
MIME ATTACHMENTS DISCARDED:

1.  Content-Type: application/octet-stream;
     name="legousbtower.c-1.gz"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
     filename="legousbtower.c-1.gz"
    Content-Length: 9040

2.  Content-Type: application/octet-stream;
     name="RCX_USBTowerPipe_linu-1.gz"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
     filename="RCX_USBTowerPipe_linu-1.gz"
    Content-Length: 2077



Message has 2 Replies:
  Re: [Legousb-devel] Yes, the puzzle is solved - legousbtower + nqc for linux.
 
Hello, I can confirm, that this worked! First time lego usb support on my linux machine: jstifter@suba:~/nqc-2.4.a4 > bin/nqc -Susb -TRCX2 -d test.nqc Downloading Program:..complete Battery Level = 9.2 V jstifter@suba:~/nqc-2.4.a4 > I had to comment (...) (23 years ago, 12-Jan-02, to lugnet.robotics)
  Re: [Legousb-devel] Yes, the puzzle is solved - legousbtower + nqc for linux.
 
(...) I believe this is correct. actual_length is only used on incoming data because the amount of data supplied may be less than the maximum buffer size (held in transfer_buffer_length). On the transmission side you just use transfer_buffer_length (...) (23 years ago, 15-Jan-02, to lugnet.robotics)

3 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR