1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Looking for USB stack with permissive licence (mass storage)

Discussion in 'Embedded' started by Noob, Apr 3, 2012.

  1. Noob

    Noob Guest

    Hello everyone,

    I work for a small set-top box manufacturer. Our boxes have
    a 450-MHz SH-4 CPU and typically 128/256 MB of RAM, running
    a proprietary RTOS.

    At the moment, we are using a proprietary third-party USB stack,
    which is mostly a binary release. The source code I do have is
    of fairly low quality... :-(

    I'm looking for an open source USB stack which would be easily
    ported to an SH-4 platform with an RTOS.

    I've just finished integrating lwip, and it was a great experience.
    The documentation is a little lacking, but they've managed to make
    porting very clean, with a clear separation of arch files, and core
    files.

    Would such a beast exist for USB?
    I only need the mass storage class.

    I did stumble upon LUFA, but it seems very AVR-specific.
    (Although it seems to have been ported to ARM recently.)

    http://www.fourwalledcubicle.com/LUFA.php

    Are there other options out there?

    Regards.
    Noob, Apr 3, 2012
    #1
    1. Advertising

  2. Noob

    Tim Wescott Guest

    On Tue, 03 Apr 2012 18:02:09 +0200, Noob wrote:

    > Hello everyone,
    >
    > I work for a small set-top box manufacturer. Our boxes have a 450-MHz
    > SH-4 CPU and typically 128/256 MB of RAM, running a proprietary RTOS.
    >
    > At the moment, we are using a proprietary third-party USB stack, which
    > is mostly a binary release. The source code I do have is of fairly low
    > quality... :-(
    >
    > I'm looking for an open source USB stack which would be easily ported to
    > an SH-4 platform with an RTOS.
    >
    > I've just finished integrating lwip, and it was a great experience. The
    > documentation is a little lacking, but they've managed to make porting
    > very clean, with a clear separation of arch files, and core files.
    >
    > Would such a beast exist for USB?
    > I only need the mass storage class.
    >
    > I did stumble upon LUFA, but it seems very AVR-specific. (Although it
    > seems to have been ported to ARM recently.)
    >
    > http://www.fourwalledcubicle.com/LUFA.php
    >
    > Are there other options out there?
    >
    > Regards.


    You might try these guys:

    http://en.wikipedia.org/wiki/File:Pietenpol.air.camper.g-buco.arp.jpg

    Not open source, but when I integrated uC/OS-II into a product they were
    very cost-effective and supplied nicely compilable source code.

    --
    Tim Wescott
    Control system and signal processing consulting
    www.wescottdesign.com
    Tim Wescott, Apr 3, 2012
    #2
    1. Advertising

  3. Noob

    David Brown Guest

    On 03/04/2012 18:02, Noob wrote:
    > Hello everyone,
    >
    > I work for a small set-top box manufacturer. Our boxes have
    > a 450-MHz SH-4 CPU and typically 128/256 MB of RAM, running
    > a proprietary RTOS.
    >
    > At the moment, we are using a proprietary third-party USB stack,
    > which is mostly a binary release. The source code I do have is
    > of fairly low quality... :-(
    >
    > I'm looking for an open source USB stack which would be easily
    > ported to an SH-4 platform with an RTOS.
    >
    > I've just finished integrating lwip, and it was a great experience.
    > The documentation is a little lacking, but they've managed to make
    > porting very clean, with a clear separation of arch files, and core
    > files.
    >
    > Would such a beast exist for USB?
    > I only need the mass storage class.
    >
    > I did stumble upon LUFA, but it seems very AVR-specific.
    > (Although it seems to have been ported to ARM recently.)
    >
    > http://www.fourwalledcubicle.com/LUFA.php
    >
    > Are there other options out there?
    >
    > Regards.


    If you don't need maximal speed, then maybe you can use something like
    these:

    <http://www.ftdichip.com/Products/ICs/VNC2.htm>

    There is firmware available for these chips for USB mass storage device
    interfacing, amongst others.

    It would mean another chip on the board - but no royalties and probably
    easier development.
    David Brown, Apr 4, 2012
    #3
  4. Noob

    Noob Guest

    Tim Wescott wrote:

    > Noob wrote:
    >
    >> I work for a small set-top box manufacturer. Our boxes have a 450-MHz
    >> SH-4 CPU and typically 128/256 MB of RAM, running a proprietary RTOS.
    >>
    >> At the moment, we are using a proprietary third-party USB stack, which
    >> is mostly a binary release. The source code I do have is of fairly low
    >> quality... :-(
    >>
    >> I'm looking for an open source USB stack which would be easily ported to
    >> an SH-4 platform with an RTOS.
    >>
    >> I've just finished integrating lwip, and it was a great experience. The
    >> documentation is a little lacking, but they've managed to make porting
    >> very clean, with a clear separation of arch files, and core files.
    >>
    >> Would such a beast exist for USB?
    >> I only need the mass storage class.
    >>
    >> I did stumble upon LUFA, but it seems very AVR-specific. (Although it
    >> seems to have been ported to ARM recently.)
    >>
    >> http://www.fourwalledcubicle.com/LUFA.php
    >>
    >> Are there other options out there?

    >
    > You might try these guys:
    >
    > http://en.wikipedia.org/wiki/File:Pietenpol.air.camper.g-buco.arp.jpg


    [Picture of a home-built aircraft]

    I don't understand.

    > Not open source, but when I integrated uC/OS-II into a product they were
    > very cost-effective and supplied nicely compilable source code.


    Do you have a link? How long have they been selling their USB stack?

    Regards.
    Noob, Apr 4, 2012
    #4
  5. Noob

    Noob Guest

    David Brown wrote:

    > Noob wrote:
    >
    >> I work for a small set-top box manufacturer. Our boxes have
    >> a 450-MHz SH-4 CPU and typically 128/256 MB of RAM, running
    >> a proprietary RTOS.
    >>
    >> At the moment, we are using a proprietary third-party USB stack,
    >> which is mostly a binary release. The source code I do have is
    >> of fairly low quality... :-(
    >>
    >> I'm looking for an open source USB stack which would be easily
    >> ported to an SH-4 platform with an RTOS.
    >>
    >> I've just finished integrating lwip, and it was a great experience.
    >> The documentation is a little lacking, but they've managed to make
    >> porting very clean, with a clear separation of arch files, and core
    >> files.
    >>
    >> Would such a beast exist for USB?
    >> I only need the mass storage class.
    >>
    >> I did stumble upon LUFA, but it seems very AVR-specific.
    >> (Although it seems to have been ported to ARM recently.)
    >>
    >> http://www.fourwalledcubicle.com/LUFA.php
    >>
    >> Are there other options out there?

    >
    > If you don't need maximal speed,


    USB 2.0 "Hi-Speed" mode is 480 Mbit/s. My goal is 30 MB/s (240 Mbit/s)
    of "useful" bandwidth (i.e. considering actual data transferred only).
    IIUC, the overhead in the USB protocol is fairly significant.

    > then maybe you can use something like these:
    >
    > <http://www.ftdichip.com/Products/ICs/VNC2.htm>
    >
    > There is firmware available for these chips for USB mass storage device
    > interfacing, amongst others.
    >
    > It would mean another chip on the board - but no royalties and probably
    > easier development.


    Hmmm... The chipset we use provides its own USB controller, and the
    board layout has already been validated. I don't think it is an option,
    at this point, to add a new chip. Which is why I'm only looking for a
    software (USB2) stack. I only need support for the mass storage class
    and bulk transfers (don't know if the other transfer modes are required
    for normal operation).

    I find it strange that there are very good TCP/IP open source libraries,
    but that I can't find a portable, open source USB stack for embedded
    systems with "powerful" CPUs (powerful compared to micro-controllers,
    i.e. roughly equivalent to the first Pentium III variant Katmai.)

    I'll try looking harder. I encourage everyone to jump in the fray
    if you know something that might prove useful.

    Regards.
    Noob, Apr 4, 2012
    #5
  6. Noob

    Tim Wescott Guest

    On Wed, 04 Apr 2012 10:20:23 +0200, Noob wrote:

    > Tim Wescott wrote:
    >
    >> Noob wrote:
    >>
    >>> I work for a small set-top box manufacturer. Our boxes have a 450-MHz
    >>> SH-4 CPU and typically 128/256 MB of RAM, running a proprietary RTOS.
    >>>
    >>> At the moment, we are using a proprietary third-party USB stack, which
    >>> is mostly a binary release. The source code I do have is of fairly low
    >>> quality... :-(
    >>>
    >>> I'm looking for an open source USB stack which would be easily ported
    >>> to an SH-4 platform with an RTOS.
    >>>
    >>> I've just finished integrating lwip, and it was a great experience.
    >>> The documentation is a little lacking, but they've managed to make
    >>> porting very clean, with a clear separation of arch files, and core
    >>> files.
    >>>
    >>> Would such a beast exist for USB?
    >>> I only need the mass storage class.
    >>>
    >>> I did stumble upon LUFA, but it seems very AVR-specific. (Although it
    >>> seems to have been ported to ARM recently.)
    >>>
    >>> http://www.fourwalledcubicle.com/LUFA.php
    >>>
    >>> Are there other options out there?

    >>
    >> You might try these guys:
    >>
    >> http://en.wikipedia.org/wiki/File:Pietenpol.air.camper.g-buco.arp.jpg

    >
    > [Picture of a home-built aircraft]
    >
    > I don't understand.
    >
    >> Not open source, but when I integrated uC/OS-II into a product they
    >> were very cost-effective and supplied nicely compilable source code.

    >
    > Do you have a link? How long have they been selling their USB stack?
    >
    > Regards.


    Whoops! That was supposed to be a link to the Micrium website -- they're
    the folks that do Micro-C/OS-II (and -III).

    http://micrium.com/page/products/rtos/usb

    As I said, I had good experiences with them 10 years ago; it's a nice
    little OS, but we didn't use any of their add-on stuff.

    Should you decide to build a plane in your spare time, the Piet is
    certainly popular (if slow), and you can still get rebuildable Model A
    engines fairly cheap if you want to be nostalgic -- but that has nothing
    to do with what you asked.

    --
    Tim Wescott
    Control system and signal processing consulting
    www.wescottdesign.com
    Tim Wescott, Apr 4, 2012
    #6
  7. Noob

    Rob Gaddi Guest

    On Wed, 04 Apr 2012 10:46:04 +0200
    Noob <root@127.0.0.1> wrote:

    > David Brown wrote:
    >
    > > Noob wrote:
    > >
    > >> I work for a small set-top box manufacturer. Our boxes have
    > >> a 450-MHz SH-4 CPU and typically 128/256 MB of RAM, running
    > >> a proprietary RTOS.
    > >>


    [snip]

    >
    > Hmmm... The chipset we use provides its own USB controller, and the
    > board layout has already been validated. I don't think it is an option,
    > at this point, to add a new chip. Which is why I'm only looking for a
    > software (USB2) stack. I only need support for the mass storage class
    > and bulk transfers (don't know if the other transfer modes are required
    > for normal operation).
    >
    > I find it strange that there are very good TCP/IP open source libraries,
    > but that I can't find a portable, open source USB stack for embedded
    > systems with "powerful" CPUs (powerful compared to micro-controllers,
    > i.e. roughly equivalent to the first Pentium III variant Katmai.)
    >
    > I'll try looking harder. I encourage everyone to jump in the fray
    > if you know something that might prove useful.
    >
    > Regards.


    Have you tried pinging your local Renesas FAE? They might have app
    notey sorts of things with already working code.

    --
    Rob Gaddi, Highland Technology -- www.highlandtechnology.com
    Email address domain is currently out of order. See above to fix.
    Rob Gaddi, Apr 4, 2012
    #7
  8. Noob

    Tim Wescott Guest

    On Wed, 04 Apr 2012 10:46:04 +0200, Noob wrote:

    > David Brown wrote:
    >
    >> Noob wrote:
    >>
    >>> I work for a small set-top box manufacturer. Our boxes have a 450-MHz
    >>> SH-4 CPU and typically 128/256 MB of RAM, running a proprietary RTOS.
    >>>
    >>> At the moment, we are using a proprietary third-party USB stack, which
    >>> is mostly a binary release. The source code I do have is of fairly low
    >>> quality... :-(
    >>>
    >>> I'm looking for an open source USB stack which would be easily ported
    >>> to an SH-4 platform with an RTOS.
    >>>
    >>> I've just finished integrating lwip, and it was a great experience.
    >>> The documentation is a little lacking, but they've managed to make
    >>> porting very clean, with a clear separation of arch files, and core
    >>> files.
    >>>
    >>> Would such a beast exist for USB?
    >>> I only need the mass storage class.
    >>>
    >>> I did stumble upon LUFA, but it seems very AVR-specific. (Although it
    >>> seems to have been ported to ARM recently.)
    >>>
    >>> http://www.fourwalledcubicle.com/LUFA.php
    >>>
    >>> Are there other options out there?

    >>
    >> If you don't need maximal speed,

    >
    > USB 2.0 "Hi-Speed" mode is 480 Mbit/s. My goal is 30 MB/s (240 Mbit/s)
    > of "useful" bandwidth (i.e. considering actual data transferred only).
    > IIUC, the overhead in the USB protocol is fairly significant.
    >
    >> then maybe you can use something like these:
    >>
    >> <http://www.ftdichip.com/Products/ICs/VNC2.htm>
    >>
    >> There is firmware available for these chips for USB mass storage device
    >> interfacing, amongst others.
    >>
    >> It would mean another chip on the board - but no royalties and probably
    >> easier development.

    >
    > Hmmm... The chipset we use provides its own USB controller, and the
    > board layout has already been validated. I don't think it is an option,
    > at this point, to add a new chip. Which is why I'm only looking for a
    > software (USB2) stack. I only need support for the mass storage class
    > and bulk transfers (don't know if the other transfer modes are required
    > for normal operation).
    >
    > I find it strange that there are very good TCP/IP open source libraries,
    > but that I can't find a portable, open source USB stack for embedded
    > systems with "powerful" CPUs (powerful compared to micro-controllers,
    > i.e. roughly equivalent to the first Pentium III variant Katmai.)
    >
    > I'll try looking harder. I encourage everyone to jump in the fray if you
    > know something that might prove useful.
    >
    > Regards.


    Have you checked with your chipset vendor to see if they've got support?
    I see more and more chips coming out with on-board IP to run their
    Ethernet or USB ports stashed away in ROM someplace.

    Of course, you're then depending on code that's written by a group of
    people who are viewed as an "expense" by company bean-counters. But you
    might luck out.

    --
    My liberal friends think I'm a conservative kook.
    My conservative friends think I'm a liberal kook.
    Why am I not happy that they have found common ground?

    Tim Wescott, Communications, Control, Circuits & Software
    http://www.wescottdesign.com
    Tim Wescott, Apr 4, 2012
    #8
  9. In article <jlh1o9$h7l$>, root@127.0.0.1 says...
    >
    > David Brown wrote:
    >
    > > Noob wrote:
    > >
    > >> I work for a small set-top box manufacturer. Our boxes have
    > >> a 450-MHz SH-4 CPU and typically 128/256 MB of RAM, running
    > >> a proprietary RTOS.
    > >>
    > >> At the moment, we are using a proprietary third-party USB stack,
    > >> which is mostly a binary release. The source code I do have is
    > >> of fairly low quality... :-(
    > >>
    > >> I'm looking for an open source USB stack which would be easily
    > >> ported to an SH-4 platform with an RTOS.
    > >>
    > >> I've just finished integrating lwip, and it was a great experience.
    > >> The documentation is a little lacking, but they've managed to make
    > >> porting very clean, with a clear separation of arch files, and core
    > >> files.
    > >>
    > >> Would such a beast exist for USB?
    > >> I only need the mass storage class.
    > >>
    > >> I did stumble upon LUFA, but it seems very AVR-specific.
    > >> (Although it seems to have been ported to ARM recently.)
    > >>
    > >> http://www.fourwalledcubicle.com/LUFA.php
    > >>
    > >> Are there other options out there?

    > >
    > > If you don't need maximal speed,

    >
    > USB 2.0 "Hi-Speed" mode is 480 Mbit/s. My goal is 30 MB/s (240 Mbit/s)
    > of "useful" bandwidth (i.e. considering actual data transferred only).
    > IIUC, the overhead in the USB protocol is fairly significant.


    That seems to be a pretty ambitious target. Where is all that data
    going to go (or come from)? Do you want that rate in continuous
    transfer, or only in bursts? Given the overhead and the possibility
    of other USB traffic, that seems a lot to ask.
    >
    > > then maybe you can use something like these:
    > >
    > > <http://www.ftdichip.com/Products/ICs/VNC2.htm>
    > >
    > > There is firmware available for these chips for USB mass storage device
    > > interfacing, amongst others.
    > >
    > > It would mean another chip on the board - but no royalties and probably
    > > easier development.

    >
    > Hmmm... The chipset we use provides its own USB controller, and the
    > board layout has already been validated. I don't think it is an option,
    > at this point, to add a new chip. Which is why I'm only looking for a
    > software (USB2) stack. I only need support for the mass storage class
    > and bulk transfers (don't know if the other transfer modes are required
    > for normal operation).


    Are you doing high-speed transfers now? Do you get anything like
    30MB/second?
    >
    > I find it strange that there are very good TCP/IP open source libraries,
    > but that I can't find a portable, open source USB stack for embedded
    > systems with "powerful" CPUs (powerful compared to micro-controllers,
    > i.e. roughly equivalent to the first Pentium III variant Katmai.)


    The variations in USB peripherals may be larger than that for Ethernet
    controllers. In addition, Ethernet and TCP/IP are ancient when
    compared to USB 2.0.
    >
    > I'll try looking harder. I encourage everyone to jump in the fray
    > if you know something that might prove useful.
    >
    > Regards.


    Mark Borgerson
    Mark Borgerson, Apr 5, 2012
    #9
  10. Noob

    Noob Guest

    Mark Borgerson wrote:

    > Noob wrote:
    >
    >> USB 2.0 "Hi-Speed" mode is 480 Mbit/s. My goal is 30 MB/s (240 Mbit/s)
    >> of "useful" bandwidth (i.e. considering actual data transferred only).
    >> IIUC, the overhead in the USB protocol is fairly significant.

    >
    > That seems to be a pretty ambitious target.


    I can live with 20-25 MB/s ;-)

    > Where is all that data going to go (or come from)?


    A recent 3.5" HDD in a USB2 enclosure (nowadays, 3.5" HDDs
    sport 64 MB of cache, and can sustain 50 MB/s over SATA)

    > Do you want that rate in continuous transfer, or only in bursts?


    The worst-case scenario (in terms of required performance)
    recording (writing) 4 HD programs (say 4x20 Mb/s) while
    playing one back (20 Mbit/s).

    I.e. 100 Mbit/s (12.5 MB/s) of continuous bandwidth.
    Being able to sustain bursts at 30 MB/s would minimize
    time spent waiting for the bus.

    > Given the overhead and the possibility
    > of other USB traffic, that seems a lot to ask.


    What other USB traffic?

    >> Hmmm... The chipset we use provides its own USB controller, and the
    >> board layout has already been validated. I don't think it is an option,
    >> at this point, to add a new chip. Which is why I'm only looking for a
    >> software (USB2) stack. I only need support for the mass storage class
    >> and bulk transfers (don't know if the other transfer modes are required
    >> for normal operation).

    >
    > Are you doing high-speed transfers now? Do you get anything like
    > 30MB/second?


    With the current stack, I've measured 18-20 MB/s sustained.
    But there are a lot of unnecessary copies because whoever
    ported the library was clueless about cached/uncached memory
    zones and DMA.

    >> I find it strange that there are very good TCP/IP open source libraries,
    >> but that I can't find a portable, open source USB stack for embedded
    >> systems with "powerful" CPUs (powerful compared to micro-controllers,
    >> i.e. roughly equivalent to the first Pentium III variant Katmai.)

    >
    > The variations in USB peripherals may be larger than that for Ethernet
    > controllers. In addition, Ethernet and TCP/IP are ancient when
    > compared to USB 2.0.


    :-(
    Noob, Apr 5, 2012
    #10
  11. Noob

    Noob Guest

    Tim Wescott wrote:

    > Have you checked with your chipset vendor to see if they've got support?


    The chipsets are from ST. They do provide TCP/IP and USB stacks but
    only as (expensive) options (high up-front cost + per-unit fees).
    My bean-counters have deemed these costs unacceptable :)

    Which is why I've integrated the BSD-licensed lwip TCP/IP stack,
    which is quite adequate. I was hoping to find the same quality
    of software in an free USB stack.

    > I see more and more chips coming out with on-board IP to run their
    > Ethernet or USB ports stashed away in ROM someplace.
    >
    > Of course, you're then depending on code that's written by a group of
    > people who are viewed as an "expense" by company bean-counters. But you
    > might luck out.


    Open source is here to stay. Companies that do not provide source
    code need to die a quick death.
    Noob, Apr 5, 2012
    #11
  12. Noob

    Noob Guest

    Rob Gaddi wrote:

    > Have you tried pinging your local Renesas FAE? They might have app
    > notey sorts of things with already working code.


    Do you think I can contact Renesas for ST gear?

    The only thing I want to do with the ST support team
    involves voodoo dolls and large needles.
    Noob, Apr 5, 2012
    #12
  13. Noob

    Paul Guest

    In article <jlk459$3n2$>, root@127.0.0.1 says...
    >
    > Mark Borgerson wrote:
    >
    > > Noob wrote:
    > >
    > >> USB 2.0 "Hi-Speed" mode is 480 Mbit/s. My goal is 30 MB/s (240 Mbit/s)
    > >> of "useful" bandwidth (i.e. considering actual data transferred only).
    > >> IIUC, the overhead in the USB protocol is fairly significant.

    > >
    > > That seems to be a pretty ambitious target.

    >
    > I can live with 20-25 MB/s ;-)


    Might be lucky.

    > > Where is all that data going to go (or come from)?

    >
    > A recent 3.5" HDD in a USB2 enclosure (nowadays, 3.5" HDDs
    > sport 64 MB of cache, and can sustain 50 MB/s over SATA)


    SATA is 1.5Gbps max burst speed

    SATA II is 3Gbps

    SATA is point to point not daisy chain/star or other type of BUS

    > > Do you want that rate in continuous transfer, or only in bursts?

    >
    > The worst-case scenario (in terms of required performance)
    > recording (writing) 4 HD programs (say 4x20 Mb/s) while
    > playing one back (20 Mbit/s).
    >
    > I.e. 100 Mbit/s (12.5 MB/s) of continuous bandwidth.
    > Being able to sustain bursts at 30 MB/s would minimize
    > time spent waiting for the bus.
    >
    > > Given the overhead and the possibility
    > > of other USB traffic, that seems a lot to ask.

    >
    > What other USB traffic?


    USB is basically a polled bus with time slices. Even with ine device you
    have root and management after enumeration etc.

    Let alone talking to end points for each block transfer continuous or
    burst. And of course files system handling.

    > >> Hmmm... The chipset we use provides its own USB controller, and the
    > >> board layout has already been validated. I don't think it is an option,
    > >> at this point, to add a new chip. Which is why I'm only looking for a
    > >> software (USB2) stack. I only need support for the mass storage class
    > >> and bulk transfers (don't know if the other transfer modes are required
    > >> for normal operation).

    > >
    > > Are you doing high-speed transfers now? Do you get anything like
    > > 30MB/second?

    >
    > With the current stack, I've measured 18-20 MB/s sustained.
    > But there are a lot of unnecessary copies because whoever
    > ported the library was clueless about cached/uncached memory
    > zones and DMA.


    May well be best you get with USB.

    Ever considered SATA( or II) or eSATA( or II) may be easier
    Also allow any size mass storage, just have many filesystems to support.

    --
    Paul Carpenter |
    <http://www.pcserviceselectronics.co.uk/> PC Services
    <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font
    <http://www.gnuh8.org.uk/> GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
    <http://www.badweb.org.uk/> For those web sites you hate
    Paul, Apr 5, 2012
    #13
  14. Noob

    Paul Guest

    In article <jlk5cm$9jt$>, root@127.0.0.1 says...
    >
    > Rob Gaddi wrote:
    >
    > > Have you tried pinging your local Renesas FAE? They might have app
    > > notey sorts of things with already working code.

    >
    > Do you think I can contact Renesas for ST gear?
    >
    > The only thing I want to do with the ST support team
    > involves voodoo dolls and large needles.


    Well easy mistake to make as SH-4 architecture also sold by Renesas
    (ex Hitachi division). May still be worth looking at their app notes
    anyway.

    --
    Paul Carpenter |
    <http://www.pcserviceselectronics.co.uk/> PC Services
    <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font
    <http://www.gnuh8.org.uk/> GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
    <http://www.badweb.org.uk/> For those web sites you hate
    Paul, Apr 5, 2012
    #14
  15. In article <jlk459$3n2$>, root@127.0.0.1 says...
    >
    > Mark Borgerson wrote:
    >
    > > Noob wrote:
    > >
    > >> USB 2.0 "Hi-Speed" mode is 480 Mbit/s. My goal is 30 MB/s (240 Mbit/s)
    > >> of "useful" bandwidth (i.e. considering actual data transferred only).
    > >> IIUC, the overhead in the USB protocol is fairly significant.

    > >
    > > That seems to be a pretty ambitious target.

    >
    > I can live with 20-25 MB/s ;-)
    >
    > > Where is all that data going to go (or come from)?

    >
    > A recent 3.5" HDD in a USB2 enclosure (nowadays, 3.5" HDDs
    > sport 64 MB of cache, and can sustain 50 MB/s over SATA)


    That's fine for SATA. Have you measured the sustained throughput
    with USB?
    >
    > > Do you want that rate in continuous transfer, or only in bursts?

    >
    > The worst-case scenario (in terms of required performance)
    > recording (writing) 4 HD programs (say 4x20 Mb/s) while
    > playing one back (20 Mbit/s).


    That sounds like a good recipe for disk thrashing. What kind
    of file system are you planning to use on the HDD? If it's
    FAT32, how will maintaining the FAT for 3 files being written
    affect your throughput? If it's a large disk, caching the
    whole FAT could use up a lot of your RAM.
    >
    > I.e. 100 Mbit/s (12.5 MB/s) of continuous bandwidth.
    > Being able to sustain bursts at 30 MB/s would minimize
    > time spent waiting for the bus.
    >
    > > Given the overhead and the possibility
    > > of other USB traffic, that seems a lot to ask.

    >
    > What other USB traffic?

    Since you hadn't specified a dedicated HDD at that point, I had
    to ask.
    >
    > >> Hmmm... The chipset we use provides its own USB controller, and the
    > >> board layout has already been validated. I don't think it is an option,
    > >> at this point, to add a new chip. Which is why I'm only looking for a
    > >> software (USB2) stack. I only need support for the mass storage class
    > >> and bulk transfers (don't know if the other transfer modes are required
    > >> for normal operation).

    > >
    > > Are you doing high-speed transfers now? Do you get anything like
    > > 30MB/second?

    >
    > With the current stack, I've measured 18-20 MB/s sustained.
    > But there are a lot of unnecessary copies because whoever
    > ported the library was clueless about cached/uncached memory
    > zones and DMA.


    To what degree is the throughput constrained by the HDD and file
    system and not the unnecessary copies?
    >
    > >> I find it strange that there are very good TCP/IP open source libraries,
    > >> but that I can't find a portable, open source USB stack for embedded
    > >> systems with "powerful" CPUs (powerful compared to micro-controllers,
    > >> i.e. roughly equivalent to the first Pentium III variant Katmai.)

    > >
    > > The variations in USB peripherals may be larger than that for Ethernet
    > > controllers. In addition, Ethernet and TCP/IP are ancient when
    > > compared to USB 2.0.

    >
    > :-(

    And just when you thought USB 2.0 was good, there are now HDDs comming
    out with USB 3.0 interfaces! ;-)


    Mark Borgerson
    Mark Borgerson, Apr 5, 2012
    #15
  16. Noob

    Noob Guest

    Paul wrote:

    > Noob wrote:
    >
    >> Rob Gaddi wrote:
    >>
    >>> Have you tried pinging your local Renesas FAE? They might have app
    >>> notey sorts of things with already working code.

    >>
    >> Do you think I can contact Renesas for ST gear?
    >>
    >> The only thing I want to do with the ST support team
    >> involves voodoo dolls and large needles.

    >
    > Well easy mistake to make as SH-4 architecture also sold by Renesas
    > (ex Hitachi division). May still be worth looking at their app notes
    > anyway.


    A USB stack (even one limited to mass storage) is not what I would
    call trivial software. I'm not sure what to expect from app notes.
    Is it common for chip makers to provide full software stacks with
    their app notes?

    Regards.
    Noob, Apr 16, 2012
    #16
  17. Noob

    Noob Guest

    Mark Borgerson wrote:

    > Noob wrote:
    >
    >> Mark Borgerson wrote:
    >>
    >>> Noob wrote:
    >>>
    >>>> USB 2.0 "Hi-Speed" mode is 480 Mbit/s. My goal is 30 MB/s (240 Mbit/s)
    >>>> of "useful" bandwidth (i.e. considering actual data transferred only).
    >>>> IIUC, the overhead in the USB protocol is fairly significant.
    >>>
    >>> That seems to be a pretty ambitious target.

    >>
    >> I can live with 20-25 MB/s ;-)
    >>
    >>> Where is all that data going to go (or come from)?

    >>
    >> A recent 3.5" HDD in a USB2 enclosure (nowadays, 3.5" HDDs
    >> sport 64 MB of cache, and can sustain 50 MB/s over SATA)

    >
    > That's fine for SATA. Have you measured the sustained throughput
    > with USB?


    "With the current stack, I've measured 18-20 MB/s sustained."
    But this stack was compiled with gcc -O0, with message queues
    re-implemented using interrupt masking (!!) instead of using
    the OS implementation, with bounce buffers used everywhere,
    and every dynamic memory block allocated from an uncached
    memory pool.

    > That sounds like a good recipe for disk thrashing. What kind
    > of file system are you planning to use on the HDD? If it's
    > FAT32, how will maintaining the FAT for 3 files being written
    > affect your throughput? If it's a large disk, caching the
    > whole FAT could use up a lot of your RAM.


    FAT sucks. We use ext2 with large blocks.

    > To what degree is the throughput constrained by the HDD and file
    > system and not the unnecessary copies?


    Seriously? Modern HDDs can sustain 100+ MB/s sequential R/W on the
    outer tracks, 50+ MB/s on the inner tracks. Whatever is the bottle
    neck, it's not the HDD.

    > And just when you thought USB 2.0 was good, there are now HDDs comming
    > out with USB 3.0 interfaces! ;-)


    I don't think the higher bandwidth of USB 3 brings anything
    to the table for a PVR product. Can one plug a USB3 enclosure
    into a USB2 port?

    Regards.
    Noob, Apr 16, 2012
    #17
  18. Noob

    Stef Guest

    In comp.arch.embedded,
    Noob <root@127.0.0.1> wrote:
    > Paul wrote:
    >
    >> Noob wrote:
    >>
    >>> Rob Gaddi wrote:
    >>>
    >>>> Have you tried pinging your local Renesas FAE? They might have app
    >>>> notey sorts of things with already working code.
    >>>
    >>> Do you think I can contact Renesas for ST gear?
    >>>
    >>> The only thing I want to do with the ST support team
    >>> involves voodoo dolls and large needles.

    >>
    >> Well easy mistake to make as SH-4 architecture also sold by Renesas
    >> (ex Hitachi division). May still be worth looking at their app notes
    >> anyway.

    >
    > A USB stack (even one limited to mass storage) is not what I would
    > call trivial software. I'm not sure what to expect from app notes.
    > Is it common for chip makers to provide full software stacks with
    > their app notes?


    I don't know if its 'common', but Atmel did supply a working mass storage
    example for their SAM7S controllers.

    --
    Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

    The number of licorice gumballs you get out of a gumball machine
    increases in direct proportion to how much you hate licorice.
    Stef, Apr 16, 2012
    #18
  19. Noob

    Arlet Ottens Guest

    On 04/16/2012 01:41 PM, Stef wrote:
    > In comp.arch.embedded,
    > Noob<root@127.0.0.1> wrote:
    >> Paul wrote:
    >>
    >>> Noob wrote:
    >>>
    >>>> Rob Gaddi wrote:
    >>>>
    >>>>> Have you tried pinging your local Renesas FAE? They might have app
    >>>>> notey sorts of things with already working code.
    >>>>
    >>>> Do you think I can contact Renesas for ST gear?
    >>>>
    >>>> The only thing I want to do with the ST support team
    >>>> involves voodoo dolls and large needles.
    >>>
    >>> Well easy mistake to make as SH-4 architecture also sold by Renesas
    >>> (ex Hitachi division). May still be worth looking at their app notes
    >>> anyway.

    >>
    >> A USB stack (even one limited to mass storage) is not what I would
    >> call trivial software. I'm not sure what to expect from app notes.
    >> Is it common for chip makers to provide full software stacks with
    >> their app notes?

    >
    > I don't know if its 'common', but Atmel did supply a working mass storage
    > example for their SAM7S controllers.
    >


    If you strip it down to a point where the host only works with a single
    mass storage device, without a hub, and you don't worry about current
    consumption, suspend mode, or isochronous endpoints, it's not that hard
    to make a USB stack. The app notes I've seen are not much more than this.
    Arlet Ottens, Apr 16, 2012
    #19
  20. Noob

    Stef Guest

    In comp.arch.embedded,
    Arlet Ottens <> wrote:
    > On 04/16/2012 01:41 PM, Stef wrote:
    >> In comp.arch.embedded,
    >> Noob<root@127.0.0.1> wrote:
    >>> Paul wrote:
    >>>
    >>>> Noob wrote:
    >>>>
    >>>>> Rob Gaddi wrote:
    >>>>>
    >>>>>> Have you tried pinging your local Renesas FAE? They might have app
    >>>>>> notey sorts of things with already working code.
    >>>>>
    >>>>> Do you think I can contact Renesas for ST gear?
    >>>>>
    >>>>> The only thing I want to do with the ST support team
    >>>>> involves voodoo dolls and large needles.
    >>>>
    >>>> Well easy mistake to make as SH-4 architecture also sold by Renesas
    >>>> (ex Hitachi division). May still be worth looking at their app notes
    >>>> anyway.
    >>>
    >>> A USB stack (even one limited to mass storage) is not what I would
    >>> call trivial software. I'm not sure what to expect from app notes.
    >>> Is it common for chip makers to provide full software stacks with
    >>> their app notes?

    >>
    >> I don't know if its 'common', but Atmel did supply a working mass storage
    >> example for their SAM7S controllers.
    >>

    >
    > If you strip it down to a point where the host only works with a single
    > mass storage device, without a hub, and you don't worry about current
    > consumption, suspend mode, or isochronous endpoints, it's not that hard
    > to make a USB stack. The app notes I've seen are not much more than this.


    Whoops, I think missed hte 'host' part somewhere. The Atmel example is
    device only, sorry.

    --
    Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

    A computer without COBOL and Fortran is like a piece of chocolate cake
    without ketchup and mustard.
    Stef, Apr 16, 2012
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff
    Replies:
    6
    Views:
    392
  2. Mark G.
    Replies:
    2
    Views:
    347
  3. Per G. Østerlie
    Replies:
    1
    Views:
    463
    Robert Akins
    Apr 18, 2005
  4. RobR
    Replies:
    2
    Views:
    818
  5. EM van Rijk

    USB FX2 Mass Storage Implementation

    EM van Rijk, May 13, 2004, in forum: Embedded
    Replies:
    2
    Views:
    507
    EM van Rijk
    May 17, 2004
Loading...

Share This Page