Atmel ARM Codes

 

Example AT91SAM7S-128 (64-256) USB Mass Storage Device (MSD) with SD or SDHC card

This example code implements an USB mass storage device on Atmel AT91SAM7-128 (or 64-256). Storage medium is an SD card connected via SPI interface.
The basic hardware example to run the code is show in the schematic which is included in the archive file. Of course some additional work is needed to implement the code in own projects,
especially code related to the power button needs to be changed for your requirements.
The code is well commented and there exist a Doxygen generated documentation.

All USB functions are based on Atmels USB MSD framework. But since the framework is increadible bloated and hard to understand, I reworked it completely and now it is
reduced to a minimum requirment to save resources and make the code more readable.
Transfer rates are not very fast, bottleneck here is the bulk endpoint size of only
64 byte in AT91SAM7 – 1.3MBits/s.

Code uses 23108 bytes program memory and 4312 bytes RAM.
Debugging output for all parts of the code can be configured in file trace.h
Debugging unit is used with parameters 115200 Baud 8N1.

Additional the code uses some peripheral features which may work as it’s own example as well, like:

  • setup and use of interrupts with AIC
  • setup and use of hardware timer for delays
  • setup and use of UDP peripheral
  • setup and use of SPI
  • configurable printf function, from tiny up to floating point output
  • setup of abort handlers
  • FAT32 library
  • SD card library with support for SDHC cards
  • setup and use of debug unit, DBGU
  • configurable trace library

This example code was successfully tested with Mandriva Linux, Windows XP SP2 and Windows Vista.

1.1 MB 611 Downloads Details...

  6 Responses to “Atmel ARM Codes”

  1. Thank you for sharing such a well written project. I had not used Eclipse and the GNU tool-chain, but this was a good excuse to try it. I adjusted your project for our hardware, which uses the Atmel SAM7S64 microcontroller and and SD card, and it works perfectly! PS. I thought your Microkopter project was cool – but so sorry they are so money hungry.

  2. Hi, I am trying to compile your code in Keil uVision. I am working on an university project for my bachelor’s degree. I am unfamiliar with GNU tools or Eclipse, and my mentor wants me to finish the project in Keil uVision. When trying to compile your code I get enormous number of errors, probably because of difference between GNU tools and Keil uVision. Do you perhaps know of any tool that could help me in conversion? Any advice will be appreciated…

    With regards, Marko.

    • Don’t know any kind of tool to perform such conversion. Usually you need to port code by hand from one compiler to another. Shouldn’t be a big deal.

  3. Thank you for your previous reply, but now I have another question :D

    I installed a GNU tool-chain and Eclipse. I am running win7 x64 OS and trying to compile your code, using Eclipse. While building the project I get the following error:

    cc1: error: unrecognized command line option “-fgnu89-inline”
    make: *** [abort.o] Error 1

    I tried to goggle that error, but didn’t get very far. Would you be kind and suggest possible reasons for this error, and perhaps an idea how to fix it?

    With regards, Marko

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Comments will be moderated! Spam deleted immediately!
Before you submit form:
Human test by Not Captcha

My Counter

  • Total Visitors 773,833
  • Visitors today 107

The Archives

© 2010-2012 Mictronics Logo by Cool Text: Logo and Graphics Generator Suffusion theme by Sayontan Sinha