Portugal
Offline
Newbie
Karma: 0
Posts: 14
|
 |
« on: October 22, 2012, 03:59:09 pm » |
Hey all. I've just read the Due's specifications page and looked through the Atmel SAM3X8E datasheet and there's something I'm not clear about: is it possible to connect a USB flash drive or a HDD (externaly powered) to the Due's native USB port so that it can read and store data to and from the device? If so what is the maximum memory size of such devices that the Due would be able to address? The info on the datasheet for SAM3X8E is that the external bus interface has 16-bit data, 8 chip selects and 23-bit address. Thank you.
|
|
|
|
|
Logged
|
|
|
|
|
North Queensland, Australia
Online
Edison Member
Karma: 31
Posts: 1195
|
 |
« Reply #1 on: October 22, 2012, 04:25:39 pm » |
The USB port is a host device. It should be able to connect to anything with appropriate software. This is something that will be used extensively if available, I'd imagine you could emulate any address length you want.
|
|
|
|
|
Logged
|
|
|
|
|
Portugal
Offline
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #2 on: October 22, 2012, 06:01:14 pm » |
That's a good point. You mean using virtual addresses right?
|
|
|
|
|
Logged
|
|
|
|
|
North Queensland, Australia
Online
Edison Member
Karma: 31
Posts: 1195
|
 |
« Reply #3 on: October 22, 2012, 06:15:49 pm » |
yeah, I think it would be a serial communication. kind of like talking to LCD's, clocking out 16 or some bit data essentially formatted by the LCD/flash device specifications. EDIT: this seems interesting http://en.wikipedia.org/wiki/USB_mass-storage_device_class
|
|
|
|
« Last Edit: October 22, 2012, 06:17:53 pm by pYro_65 »
|
Logged
|
|
|
|
|
North Queensland, Australia
Online
Edison Member
Karma: 31
Posts: 1195
|
 |
« Reply #4 on: October 22, 2012, 06:36:20 pm » |
It seems there is a mass storage bootloader, so there might be code we can retrofit for general read/write operations.
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Online
God Member
Karma: 35
Posts: 988
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #5 on: October 22, 2012, 07:20:46 pm » |
Well it is supposed to be able to connect to phones (think google ADK2012, the software for which is compatible), so you might be able to find useful code from that - I am not sure whether there is existing code for allowing an android phone to mount as a flash drive, but there is other useful HID stuff.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Portugal
Offline
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #6 on: October 23, 2012, 05:18:08 pm » |
It seems there is a mass storage bootloader, so there might be code we can retrofit for general read/write operations.
What do you mean by retrofitting code, pYro_65? That's what I though too, Tom Carpenter. Since it should be able to connect to phones it should be able to connect to storage devices, I guess... Once I manage to put my hands on a Due I must experiment and see what I can do with that USB port.
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Online
God Member
Karma: 35
Posts: 988
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #7 on: October 23, 2012, 05:33:24 pm » |
Once I manage to put my hands on a Due I must experiment and see what I can do with that USB port.
Me too. Hopefully the arduino store will eventually ship me one - I ordered it within minutes of it appearing on the store  .
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
North Queensland, Australia
Online
Edison Member
Karma: 31
Posts: 1195
|
 |
« Reply #8 on: October 23, 2012, 06:15:44 pm » |
What do you mean by retrofitting code, pYro_65? 'borrowing' then converting to my needs. I've been looking at some examples of mass storage. The library provided with the due has a full CDC layer. On my day off I'll start to implement subclass 01h/50h with the newer 'Bulk-Only Transport', which would be fine with all flash drives and most external HDD cases ( no cd/dvd, floppys, tapes ). It looks challenging, but definitely doable.
|
|
|
|
|
Logged
|
|
|
|
|
Portugal
Offline
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #9 on: October 23, 2012, 06:31:55 pm » |
Once I manage to put my hands on a Due I must experiment and see what I can do with that USB port.
Me too. Hopefully the arduino store will eventually ship me one - I ordered it within minutes of it appearing on the store  . I hope the store nearby successfully ordered some. I sent them an email asking them when they will start selling them. On the arduino store the Due's already sold out atm xD (just noticed)
|
|
|
|
|
Logged
|
|
|
|
|
Portugal
Offline
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #10 on: October 23, 2012, 06:47:03 pm » |
That's more than I can understand right now, pYro_65 haha. I'm a newbie in Arduino matters and I'm only in the first years of electrical engineering course. But maybe you could summarise what the "subclass 01h/50h" and "'Bulk-Only Transport'" are for me?... It's fine if you don't want too  anyway, thank you for your replies to the topic.
|
|
|
|
|
Logged
|
|
|
|
|
North Queensland, Australia
Online
Edison Member
Karma: 31
Posts: 1195
|
 |
« Reply #11 on: October 23, 2012, 06:55:16 pm » |
Yeah they sold out in a handful of hours, had my chance but wasn't going to fork out 112 euro. I doubt they made the same blunder as the R-pi and grossly under estimated their release sales. Apparently the chips are new(er) and may be in high demand with little supply. Some official distributors are reporting 6 weeks to fill the orders received yesterday. 01h is a subclass of MSD ( mass storage ), Reduced Block Commands (RBC) is an interface specification. MSD supports very basic read/write operartions (RBC/01h) all the way up to full SCSI support ( every USB storage device/06h ). BOT is replacing CBI ( transport methods, larger throughput 'bulk' blocks ) May mean flash paging is large, but not too much of a worry. EDIT: AT91 USB MSD http://www.atmel.com/Images/doc6283.pdfUniversal Serial Bus Mass Storage Class: Bulk-Only Transport http://www.usb.org/developers/devclass_docs/usbmassbulk_10.pdf
|
|
|
|
« Last Edit: October 23, 2012, 07:44:57 pm by pYro_65 »
|
Logged
|
|
|
|
|
North Queensland, Australia
Online
Edison Member
Karma: 31
Posts: 1195
|
 |
« Reply #12 on: October 25, 2012, 06:01:44 am » |
After looking for AT91 and USB 'on the go' specifics with little success, I noticed the USBHost library provided in the IDE download uses a library from circuits@home: https://github.com/felis/USB_Host_Shield_2.0There is already a mass storage interface there, weather it works or not I do not know ( someone who has used the USB host shield may be able to answer this. ) Editing it shouldn't be too hard if modifications are needed. It will still need a library on top to provide a 'client' interface. The mass storage interface is just implementing a way of sending/receiving commands/data too and from a USB device that supports the MSD protocol, not much in the way of file system control.
|
|
|
|
|
Logged
|
|
|
|
|
Forum Administrator
Milano, Italy
Offline
Full Member
Karma: 19
Posts: 210
|
 |
« Reply #13 on: October 25, 2012, 09:22:59 am » |
Yes, the actual USBHost library is based on USB Host v2 from circuits@home!
We tried to keep the original API as much as possible, since a lot of USB Devices are supported, and a lot of 3rd party libraries was built on this API. BTW only a minimal part of the library was ported, most is still missing, for example the mass storage support.
USBHost is licensed under GPL, so if you use it on your product you must release your code GPL as well.
|
|
|
|
|
Logged
|
C.
|
|
|
|
Offline
Sr. Member
Karma: 11
Posts: 393
|
 |
« Reply #14 on: October 25, 2012, 10:25:26 am » |
USBHost is licensed under GPL, so if you use it on your product you must release your code GPL as well.
That's, um, important and significant information for developers. Is there a summary of what parts of the codebase is covered by licensing restrictions like GPL 2?
|
|
|
|
|
Logged
|
|
|
|
|
|