Firmware for the EVK525

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Freaks,

I'm currently looking for the source to the firmware demonstrated in the latest AVRTV episode, on the STK525/EVK525. That's the USB firmware with host capabilities, which allowed the program to transfer a file onto an attached USB disk.

Does anyone know where to download the source? I can't seem to find it on the Atmel website. I want it to examine its algorithms, and see if I can spot what is causing some memory sticks (in particular, the non-branded Chinese ones) to fail on my MyUSB Mass Storage Host demonstration application, while the standards compliant sticks work fine.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nevermind - Eivind tell me it is licensed, requiring ownership of an actual EVK525 - what a draconian requirement! ;)

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey, then ask him for one! With all your contributions to the AVR community
so far, I'd wholeheartedly support them sending you a gift like that one.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Actually, he just offered. However I don't have a STK525 either - I've been developing on the USBKEY. No matter; all I really wanted was to peek at the Mass Storage Host code to see if I can spot any workarounds they used for dodgy USB sticks.

So as to not waste the thread: does anyone know of a good way to get started in writing USB drivers for the host PC?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree with Jörg, Atmel should send you one. If not give you one then at least have the local Atmel office give you a loaner for a few weeks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Dean,
Guess what arrived in the mail today at work; the EVK525.
have only had the afternoon to have a little bit of a play with it. but its pretty neat. Documentation is limited for it, and knowledge thats out there is too. I guess cause its all licensed huh.

Anyway, I haven't had a good read through the code --> there is ALOT of it, as its also got atmels own fat system on too, which can handle fat 12/16/32 and also long file names and has a neat little console put together also albeit with some commands which dont work as specified! [anyone else know about that???]

To the point however: USB MS host mode
after finding the thread and wanting to avoid reading through that .c file to find an issue I went around the office collecting USB sticks from everyone and giving them a go in it to see if they would enumerate correctly and if i would be able to perform the basic commands on them with the console provided.
And they all worked.
How cheap and crappy are these USB sticks that you are using Dean?
I tried the following sticks, some crap, some not so crap.
256 sandisk cruzer
1gb imation
2gb lexar
1gb sony microvault (contains some other odd compression software that i thought might bugger it up--didnt)
1gb farnell promo stick <<
2gb farnell promo stick <<

now, yeah most are of decent quality, but i was expecting the farnell ones to pose a problem if there was going to be one...

Considering that you can get the code b/c of licensing and your MYUSB code is GCC then I guess when i get a chance I can have a look at the two side by side and see if there is anything of significant difference there, an extra little trick.

On another note however. I think Atmel should send you the EVK525 also, and considering you don't have the STK252 to go with it, one of them too! collect the whole series!

Hope this is of some help!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Michael,

Great, then at least Atmel's system is robust, so any issues can be worked around.

Since my last post in this thread I overhauled the MS Host Demo code in my MyUSB library, and it now performs much better - I can't get it to fail. Needs more testing with other's sticks however, and more testing on the STK525.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

i have been looking around for a device that could be used to read from a USB memory stick and then stream that data to an MP3 decoder. Has anybody got one of these kits working and if so does it do the following:-

Open a file ?
Read xNumber of bytes from the file ?
Read from xlocation within the file?

I was looking at using this device with a VS1001k SPI MP3 decoder, and i think all i would have to do is stream an mp3 file to the decoder using the USB host/FAT firmware. the only problems i can see are : -

I am new to writing any code for USB devices so my knowledge is limited and also very limited as regards to FAT filling systems, so if the Atmel firmware requires lot's of modifications on that front, i will be unable to get the system working.

And i am also not sure how the mp3 decoder functions (i will start a new thread for this)

The other option is to use :-

An FTDI chip

or

uALFAT USB IC and MAXIM USB Host

Both of these chips have all the code written and working and it is simply a case of sending the IC a request over the SPI/UART/I2C. But add cost to the design (£6/$12).

IF anybody has one of these working can: -

IS the code easily to implement and get working?

(Note i am new to AVR's but not C, i use to play around with PSoC's, but now i have seen the light and mostly use ATmega's, but have never written code for USB host or FAT systems. Just simple UART and byte-by-byte access to flash memory (using my own filling system (e.g a record is fixed at 16bytes)

Regards,

Andy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Andy,

It's an AWFUL lot easier to make AVRs read from SD memory cards than from USB memory sticks - have you considered that for the MP3 storage rather than USB?

To read from a memory stick wil require the minimum of USB-OTG support in the AVR

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

It must be a USB Stick. I have done loads of reading and i am slowly losing the will to live. The Atmel USB host software looks horrible.

now there is talk of using an ARM and doing the MP3 decoding in software :roll: and getting the ARM to act as a USB host and FAT filling system. I can see this taking a year to develop and never working very well/if at all.

Andy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Useful info here:

http://www.myplace.nu/mp3/index2...

But, as you'll see, he went for the easy option - SD

Oh but I just noticed yampp-7 has been added since I last looked - that's probably close to what you want?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MyUSB Mass Storage Host demo allows you to read and write raw blocks off any USB stick (now works fine for all sticks). Just add a FAT driver.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi abcminiuser,

Could you point me in the direction of the MyUSB Mass Storage Host code?

Also is there some pdf/doc/websites you can point me to so i can get a general understanding of how the code is working? (as i see not point in copying code with out understanding it) and anyway i would like to understand how the USB host is working.

How would i add a FAT system to this? is it a simple case of finding one (i.e a free one) on swapping the link to a SD card to the USB mass storeage? I ask as i am not sure how the FAT system works.

Does it simpe read certain bytes from the memoery device and from that can tell you how many files etc

OH and which IC are you using so i can order a dev board and play with the code you have written (Many thansk for sharing the code)

Again many thanks for your help,

Andy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Could you point me in the direction of the MyUSB Mass Storage Host code?

All demos are located in the /Demos/ directory of the MyUSB download package.

Quote:

Also is there some pdf/doc/websites you can point me to so i can get a general understanding of how the code is working? (as i see not point in copying code with out understanding it) and anyway i would like to understand how the USB host is working.

This page is a good overview, and contains a few links to relevant specifications/code samples/etc.

I also wrote up an overview of the separate layers required for a Mass Storage Device -- the host is similar, except it has to be able to talk to the various layers.

You will need to read up on:
1) The USB specification -- particularly/mainly chapter 9, which deals with control transfers
2) The USB Bulk-Only Transport
3) The SCSI primary/block command set specification

Basically, the Bulk Only transport serves as the USB wrapper for standard SCSI commands, which deal with the media read/write/etc. commands.

Quote:

How would i add a FAT system to this? is it a simple case of finding one (i.e a free one) on swapping the link to a SD card to the USB mass storeage? I ask as i am not sure how the FAT system works.

FAT drivers should be able to take in blocks of 512 bytes off a disk, and allow you to open/create/delete/move/etc files stored in the filesystem. The MyUSB Mass Storage Host demo contains block read and write commands, which you should be able to interface to any FAT driver.

Quote:

Does it simpe read certain bytes from the memoery device and from that can tell you how many files etc

The demo itself just reads raw bytes off the card. The FAT driver's job is to deal with the raw data and turn it into a usable file structure. The FAT driver just gives you the file and folder transversal and manipulation commands. You would use the FAT driver to create a new file on the disk for datalogging for example (which would return a pointer to the location on the media where the file should be stored), and you would use your own routines for writing the file's contents.

Quote:

OH and which IC are you using so i can order a dev board and play with the code you have written (Many thansk for sharing the code)

Get the USB1287. The USB647 is the only other USB AVR which supports host mode, but you might as well go for the biggest AVR with the most memory available. I personally use the USBKEY board from Atmel, which has a USB1287 mounted.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

So i am guessing that the FAT code would be simple to impliment as all it needs to do for my appliaction is tell me the number of mp3's on the data flash and then i can open one and stream the data to the SPI MP3 decoder.

DO you mean this kit

http://www.atmel.com/dyn/product...

IF so does anybody know where i can get one from (UK) as farnell has none in stock and i cannot find the kit any where else.

Has anybody used or heard of the following product: -

http://www.sigmatel.com/products...

Many Thansk for you help,

EDIT: i am guessing your mass storage code is not written for ICCAVR? So i would need to try and convert it

Andy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Andy,

Do you know that while I have a couple of very expensive MP3 players (including a 60GB Creative Zen Vision W) the one I actually use most of the time is a one I bought for £6 from ebuyer.co.uk which has an empty SD slot. I'll bet that entire MP3/WMA player costs less than the STMP3500 you mention above! In fact my one is now £8.95:

http://www.ebuyer.com/product/10...

It kind of makes you wonder if (a) it's worth trying to design your own or (b) if the cheapest solution (assuming you want to build one) is to buy, then break one of those ones from ebuyer for components. I did have half an idea to buy a second one simply to find what's inside but I'll bet it is something like a PIC or an AVR8 and one of the VS1xxxx series chips. Though, having said that, the thing even has a USB-PC link through which it appears as a USB memory stick. So maybe there's something like an AT90USB in there. If there is it makes you wonder how they can sell them for £8.95 retail and the manufacturer still make enough profit to make it worthwhile. How low must the BOM be? I'll bet it is about £5.30 landed, £4.80 FOB, so maybe £4/$8 for the BOM. (including an (admittedly small) graphic LCD)

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Andy, Dean's MyUSB library is targets avr-gcc.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Clawson i cannot tell you about the product, but it does not have an LCD and is not for the portable market.

kmr : Dam that could take me ages as i am new to ICCAVR (4 months)

Regards,

Andy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

kmr : Dam that could take me ages as i am new to ICCAVR (4 months)

It's portable, but you'd loose a lot of the "clean" event syntax and the like. Why not just stick with the (free) GCC compiler?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
Why not just stick with the (free) GCC compiler?
Good question. Possible answers:
- inertia/didn't think of that
- wants the challenge of porting and maintaining a port
- needs the binary to be produced by ICC for some other reason
- doesn't have enough hard disk space to install winavr
- is against using free software for some other reason

there's probably more possibilities that I didn't think of.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I might consider porting it in the future, although as I said that will require some syntax changes on other compilers that lack the GCC-specific extensions the code uses.

Right now I just want to get the board ports done so that I can get the next release out the door!

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like a good priority, Dean. I did briefly consider contributing IAR compatibility, but then I thought -- why? For my mild USB needs, GCC will work as well as IAR at this point.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I did briefly consider contributing IAR compatibility, but then I thought -- why? For my mild USB needs, GCC will work as well as IAR at this point.

I don't see what IAR's big appeal is. Yes it can compile smaller code, but it costs a bomb (making it unsuitable for large scale open source projects) and has limited useful extensions like the ones used in MyUSB to allow for better program syntax.

But I don't want to start a compiler war. Once MyUSB runs on the STK525 correctly I'll release 1.3.0, and schedule the Bootloader, Still Image Class and any compiler ports for the version following that.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
But I don't want to start a compiler war.
Nor do I. I'll state only that I use and like both AVR-GCC and IAR, I find IAR more powerful, and the money spent on IAR has already been recouped.