Skip to main content
Visitor II
September 25, 2008
Question

USB Problem- Async data to USB Buffers

  • September 25, 2008
  • 2 replies
  • 708 views
Posted on September 25, 2008 at 15:43

USB Problem- Async data to USB Buffers

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:55

    Hi

    Need help Fast!

    I have RS-232 data coming in in small packets (14 - 50 bytes)

    at various times.

    RS-232 baud rate is 625K

    I get 100 to 2000 bytes per millisec.

    Sometimes I have NO data for several milliseconds

    ALL data is critical to the Host/PC application

    Writing 2 small packets slow my thru-put & my RS-232 buffer overflows (its 16K bytes)

    I need to concatenate the data into the PMA Buffer as I receive it.

    I have tried to set the Tx Status of the PMA Buffer to NAK if its still VALID

    Get the PMA Buffer count

    then write the new packet to the tail of the PMA Buffer

    Then update the SetEPTxCount()

    This seems to fail, I think the HW may be going to CTR_LP() and starting to Transmit to the Host/PC

    I am going to try to do Double buffering, but this will only be a stop-gap solution

    Any Ideas?

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:55

    Do I need to add the function CTR_HP() to the USB IRQ handlers?

    I Just found this in the NEW USB SW (10/2006)

    We have been using the 05/2006 USB Lib

    Why does ST Micro wrap everything in a Function call? (Way too much overhead)

    Don't they know about macros, especially in an IRQ handler?

    Some code is good other is very poor.

    Do they do code reviews or customer reviews before issuing the code?