Read/Write an SD/MMC SPI card with AT32UC3L0 (x-Plained)

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

Hi,

 

i'm trying to use an SD card with a AT32UC3L0 (through the X-Plained board).

I have to use it as a logging disk.

Could someone give me some suggestions on which File System service is best suited for this?

Also, I noted that the FatFS example is not available for UC3, someone know why?

 

Cheers,

Daniele.

This topic has a solution.

Do, or do not, there is no try.

Last Edited: Fri. Oct 27, 2017 - 08:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DBarzo wrote:
I noted that the FatFS example is not available for UC3

If it's a rich support "ecosystem" you want - then why are you using an AVR32?

 

cheeky

 

Anyhow, the only bit of FatFs that's specific to the target microcontroller is the SPI hardware driver - it is very easy to port.

 

If you're not familiar with the SPI on the UC3, then it's probably best to get familiar first - before trying to do FatFs.

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

There is is the ASF 'service' called "FAT file system" which is quite something to behold.
Unfortunately, the Studio examples are written for the AT45DBxxx flash memory.


ChaN's FatFs would be the one I use.

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

awneil wrote:

DBarzo wrote:

I noted that the FatFS example is not available for UC3

 

If it's a rich support "ecosystem" you want - then why are you using an AVR32?

 

cheeky

 

Mmmm.. TBH I don't know what you mean exactly cheeky

Which uP you suggest me to use?

 

 

awneil wrote:

Anyhow, the only bit of FatFs that's specific to the target microcontroller is the SPI hardware driver - it is very easy to port.

If you're not familiar with the SPI on the UC3, then it's probably best to get familiar first - before trying to do FatFs.

 

Yes, I saw and I know wink

My question was only to have a "confirm" since I never use a file system on a uP before. smiley

 

Thanks for your answer awneil. yes

Cheers! 

 

 

Do, or do not, there is no try.

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

mikech wrote:
There is is the ASF 'service' called "FAT file system" which is quite something to behold. Unfortunately, the Studio examples are written for the AT45DBxxx flash memory.
ChaN's FatFs would be the one I use.

 

Thanks a lot mikech!

In fact I'm watching FatFS yes

 

Cheers,

Daniele.

Do, or do not, there is no try.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DBarzo wrote:
Also, I noted that the FatFS example is not available for UC3, someone know why?
Because UC3 isn't very popular (I thought it was "end of line" too?). But if you look at ffexample.zip from the FatFs site you will see ports for all kinds of micros. The reason there are many others is that because of the way Chan has structured it the code is easy to port to new hardware. All the hardware interaction is localized into a small set of disk_*() routines and at the end of the day the only interactions with the hardware are:

 

1) an SPI port

2) a couple of I/O lines for the  Write Protect and Card Present sensing

3) a timer to deliver a 100Hz interrupt that FatFs uses for timeouts and things

 

So you could take the existing AVR8 port (for example), identify where it is interacting with SPI, IO and timers. (first two in mmc_avr.c) and the replace that stuff with UC3 focussed code and you'd be done.

 

You might even contact Chan and get him to add the UC3 code as a porting example to the next issue of ffexample.zip

 

Lack of any interest in UC3 and lack of huge numbers of users of it means that presumably no one has ever done this so far.

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

Thanks a lot for your explanation clawson!

You're been very clear yes

Do, or do not, there is no try.

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

awneil wrote:

 

DBarzo wrote:

I noted that the FatFS example is not available for UC3

 

If it's a rich support "ecosystem" you want - then why are you using an AVR32?

 

cheeky

 

DBarzo wrote:
 Mmmm.. TBH I don't know what you mean exactly cheeky 

Explained here: http://www.avrfreaks.net/comment...

 

See also clawson's comments:

UC3 isn't very popular (I thought it was "end of line" too?).

Lack of any interest in UC3 and lack of huge numbers of users 

 

DBarzo wrote:
 Which uP you suggest me to use?

Well, I have no idea what your requirements are - so what made you choose AVR32?

 

If you really need 32-bit, then ARM Cortex-M is the obvious answer

 

http://www.atmel.com/products/microcontrollers/arm/default.aspx

 

If you don't, then look at the AVR8.

 

Perhaps look at the available ports of FatFs, and pick one suitable to the rest of your requirements.

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

awneil wrote:

DBarzo wrote:

 Mmmm.. TBH I don't know what you mean exactly cheeky 

 

Explained here: http://www.avrfreaks.net/comment...

 

See also clawson's comments:

UC3 isn't very popular (I thought it was "end of line" too?).

Lack of any interest in UC3 and lack of huge numbers of users 

 

Oh, ok! Now I got it, thanks awneil wink

 

 

awneil wrote:

DBarzo wrote:

 Which uP you suggest me to use?

 

 

Well, I have no idea what your requirements are - so what made you choose AVR32?

 

If you really need 32-bit, then ARM Cortex-M is the obvious answer

 

http://www.atmel.com/products/microcontrollers/arm/default.aspx

 

If you don't, then look at the AVR8.

 

Perhaps look at the available ports of FatFs, and pick one suitable to the rest of your requirements.

 

Sorry, you're right, I asked which to use without giving infos, my fault sad

Substantially what I have to to is very simple: receive NMEA sentences from a GPS and store them into a flash. 

 

So, maybe, an 8-bit should be enough.

Do, or do not, there is no try.

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

DBarzo wrote:
what I have to to is very simple: receive NMEA sentences from a GPS and store them into a flash. 

 

So, maybe, an 8-bit should be enough.

Yes - an AVR8 should be sufficient for that.