Looking for USB stack with permissive licence (mass storage)

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.)

formatting link

Are there other options out there?

Regards.

Reply to
Noob
Loading thread data ...

You might try these guys:

formatting link

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
Reply to
Tim Wescott

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

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.

Reply to
David Brown

[Picture of a home-built aircraft]

I don't understand.

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

Regards.

Reply to
Noob

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.

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.

Reply to
Noob

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

formatting link

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
Reply to
Tim Wescott

[snip]

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.
Reply to
Rob Gaddi

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
Reply to
Tim Wescott

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.

Are you doing high-speed transfers now? Do you get anything like

30MB/second?

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.

Mark Borgerson

Reply to
Mark Borgerson

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

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)

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.

What other USB traffic?

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.

:-(

Reply to
Noob

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.

Open source is here to stay. Companies that do not provide source code need to die a quick death.

Reply to
Noob

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.

Reply to
Noob

Might be lucky.

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

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.

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          | paul@pcserviceselectronics.co.uk
    PC Services
 Timing Diagram Font
  GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
 For those web sites you hate
Reply to
Paul

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          | paul@pcserviceselectronics.co.uk
    PC Services
 Timing Diagram Font
  GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
 For those web sites you hate
Reply to
Paul

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

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.

Since you hadn't specified a dedicated HDD at that point, I had to ask.

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

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

Mark Borgerson

Reply to
Mark Borgerson

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.

Reply to
Noob

"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.

FAT sucks. We use ext2 with large blocks.

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.

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.

Reply to
Noob

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.
Reply to
Stef

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.

Reply to
Arlet Ottens

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.
Reply to
Stef

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.