ASF4 MSC slave - mass storage on SD card

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

Hi all,

 

Before I begin - I've raised a ticket with Microchip support and received nothing after 1 week. This is a HUGE stumbling block and any help would be appreciated.

 

I'm trying to change the MSC device drivers such that they use a FATFS formatted SD card rather than exposing 22KB of RAM. It appears that this example/demo code was dropped by Atmel/Microchip as all the functionality to do this is missing.

 

I'm lost with what needs changing to accomplish this. I have a known good SD interface with good FATFS drivers (though f_gets doesnt seem to work correctly).

 

I'm assuming that within the call to "msc_usb_task", I need to read from the SD card via calls to "disk_read" in "sdmmc_diskio.c". I really dont know at which "level" of START I'm supposed to tie all of this together.

 

 

Last Edited: Tue. Dec 3, 2019 - 07:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DFOWE wrote:
I'm trying to change the MSC device drivers

Do they work "as-is" - before any changes?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The example supplied in START would create a 22KB buffer in RAM and this was exposed to the MSC, so to speak. When the device is plugged into my PC, I would receive an error that there was (obviously) no file system available on the 22KB and prompted to format the RAM. This seems to work correctly. As mentioned it appears that some thought was given to tying an external memory to this but was not completed.

 

I've attached the demo I'm working from.

Attachment(s): 

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

There is an option in START, for this example, to use an SD card. Selecting the checkbox to enable that options doesnt seem to do anything!

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

So not an AVR, then?

 

Maybe try: https://community.atmel.com/foru...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...