Mass Storage class over V-USB

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Saimon

Mass Storage class over V-USB

Post by Saimon » Sun Oct 18, 2009 8:01 pm

I take this code to make my USB flash mass storage
http://depositfiles.com/files/00ar212ls

saimon

Re: Mass Storage class over V-USB

Post by saimon » Sun Oct 18, 2009 8:02 pm

Need help? Ask to me!

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: Mass Storage class over V-USB

Post by christian » Sat Oct 24, 2009 11:07 pm

Has anybody tested this?

If it's indeed a mass storage implementation, I'd like to add it to our products section.

The download via depositfiles.com is a pain. Long time to wait and full screen ads in the background...

Mr.bob

Re: Mass Storage class over V-USB

Post by Mr.bob » Mon Oct 26, 2009 5:01 pm

I've rehosted it in a few places.
I cannot test it myself (I'm not up to speed with Amtels yet) but hoping it might encourage people totry it :)

http://www.mediafire.com/?jezfi2jvwtz - less adverts, no timeout but tries to open a window. Diret link on page.

http://www.filedropper.com/massstoragemega8libusb - even less adverts but need to enter a captcha to download it.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Mass Storage class over V-USB

Post by ulao » Mon Oct 26, 2009 6:11 pm

I would love to test this and have a use for it, but have no clue what r90 files are? If it was in C like all other projects I could have test it.

Saimon

Re: Mass Storage class over V-USB

Post by Saimon » Mon Oct 26, 2009 9:12 pm

This project for IAR compiler. It can be configured by IAR Project manager. And one more: I use my own config for mega8. You can try to use standart IAR config for mega8

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: Mass Storage class over V-USB

Post by maxi » Tue Oct 27, 2009 1:55 am

I am interested in this too and have ported what I think are the necessary bits to avr-gcc and got it to compile with AVR Studio. Unfortunately I don't have a mega8, I do have a mega88 but when I try to compile for that I get an error that GICR is not defined. I'm sure its not insurmountable but for now, if any one else wants to try, I uploaded the files here:

http://www.mediafire.com/?sharekey=cf77db0c8a33b7be6b21be4093fab7ac416059da76f2e19df0a154af670496da

If you try it then do please let me know how it goes.
Last edited by maxi on Tue Oct 27, 2009 3:58 am, edited 1 time in total.

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Re: Mass Storage class over V-USB

Post by Grendel » Tue Oct 27, 2009 2:09 am

On the 88 the GICR bits have moved to EIMSK (INT1, INT0) and MCUCR (IVSEL, IVCE).

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Mass Storage class over V-USB

Post by ulao » Tue Oct 27, 2009 4:56 pm

a few bits have moved see the 88 migration pdf for more info.

I download your file and it compiles on the 88 and the 8. Neither run ( usb error ) but my guess is that its not pinned the same way my usb test board is. Was not sure where the schematic is.. I use pd1 and 2 for usb.

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: Mass Storage class over V-USB

Post by maxi » Tue Oct 27, 2009 5:16 pm

Looking at the code I think the basic setup is D+ on INT1 (Pin 5), D- on INT0 (Pin 4). There also appears to be two LED's, Green on PC2 (Pin 25) and Red on PC3 (Pin 26) Both seem to be active low.
I now see what needs changed for mega88 compilation (Thanks Grendel) I will try it myself later when I have more time.

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: Mass Storage class over V-USB

Post by maxi » Wed Oct 28, 2009 12:32 am

Ok, I have built up a test rig with my mega88. When I first plugged it in things seemed quite promising, the device was recognised as a usb mass-storage device but fails when trying to install the driver. That was Vista so I thought I might have more luck with XP however my old desktop doesn't recognise it at all.

<edit>If it's any help the error is Code 10, device cannot start.</edit>

There could be many things to blame; breadboard construction, mega8-88 conversion, gcc adaptation, using a 12meg xtal instead of 16 (all I got) or a million other things.

I'd still encourage others to give it a shot as I am little more than a beginner at this stuff. I'd be interested to hear if anyone ever gets it to work.

Saimon

Re: Mass Storage class over V-USB

Post by Saimon » Wed Oct 28, 2009 9:45 am

Hi to all. I can show my screeshots and photos of my USB mass storage device. If anyone intresting please, emal me: lleeloo@mail.ru
If anyone has some question by my porject USB mass storage, you may mail me too. Best regards. Saimon

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: Mass Storage class over V-USB

Post by christian » Wed Oct 28, 2009 11:59 am

This can't work on Vista because it uses bulk endpoints. You need a patch in a similar way as for AVR-CDC.

BTW: Why don't you host the project on our wiki at http://vusb.wikidot.com/hosted-projects ?

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: Mass Storage class over V-USB

Post by maxi » Wed Oct 28, 2009 9:18 pm

Just a quick update, I found a slight mistake on my breadboard setup. Basically I had the pull-up resistor on the wrong side of the series resistor.
Still the same under Vista (though this has been explained) but now my XP box correctly identifies the device and it shows up in 'My Computer' as an external drive. Only thing now is that the drive is not formatted and any attempt to do so results in an error. Perhaps more code is required however this is still all a little over my head right now, but many thanks Saimon for sharing this.

Saimon

Re: Mass Storage class over V-USB

Post by Saimon » Thu Oct 29, 2009 7:35 pm

I glad to be usefull! Maxi, error after formating beacouse no data is controlling. It only a full mass storage bulk interface with commands wraping and answering. I working on normal flash card, and i think 5 or 7 days i share my project to all! If anyone test my code and find some problems or errors or have some ideas, please, mail me: lleeloo@mail.ru. Sorry for my English!

Post Reply