# Sam3x new SD driver

**URL:** <https://forums.freertos.org/t/sam3x-new-sd-driver/5249>\
**Category:** Kernel\
**Created:** [November 26, 2012, 2:24pm UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249 "2012-11-26T14:24:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 26, 2012, 2:24pm UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249/1 "2012-11-26T14:24:51Z")

</div>

**anonymous** wrote on [Monday, November 26, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/e75ca83c/#4658):

I have been working with a SAM3X-ek and the new SD card driver that was just released in asf 3.5.&nbsp; The included demo works fine but I am receiving “CMD55 Fail” errors when I try to use the sd card in Free RTOS.(timing error, my thought)&nbsp; None of the Atmel guys have done any testing with FreeRTOS and the sd card driver so I was just wondering if anyone in the FreeRTOS community had tried this?

Thanks,  
Seth

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 26, 2012, 3:04pm UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249/2 "2012-11-26T15:04:07Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, November 26, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/e75ca83c/#132b):

Not yet, but it is currently second on the list to do so.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 5, 2012, 2:38pm UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249/3 "2012-12-05T14:38:09Z")

</div>

**anonymous** wrote on [Wednesday, December 05, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/e75ca83c/#a0d1):

I am new to FreeRTOS but is there anyway I can help?  
Thanks,  
Seth

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 7, 2012, 9:25pm UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249/4 "2012-12-07T21:25:34Z")

</div>

**anonymous** wrote on [Friday, December 07, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/e75ca83c/#5c85):

I have done some testing with getting creating a sd card program from scratch similar to the demo.&nbsp; I figured out all of the various sd/fatfs compiler flags then I moved on to importing FreeRTOS.&nbsp; Once the FreeRTOS\_used flag is enabled,&nbsp; f\_open fails and throws a 3(FR\_NOT\_READY) error.&nbsp; If the SD card debug flag is turned on then you can see that CMD 55 is failing.&nbsp; I think this has to do with the Freertos timers that get enabled in the sd card driver once the flag is used but that is the extent of my knowledge/troubleshooting.

Hope that helps.  
Seth

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [December 8, 2012, 10:16am UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249/5 "2012-12-08T10:16:04Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Saturday, December 08, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/e75ca83c/#e9c6):

On the SAM4X-EK I have been able to use the ASF wizard inside Atmel Studio 6 to create the FreeRTOS peripheral control demo, then use the ASF Wizard to bring in the MMC driver and file system server.&nbsp; I had to uncomment a couple of items in the generated conf\_example.h header file (generated by the ASF wizard) to enable the MMC if I recall correctly.&nbsp; After that I was able to successfully read and write to an SD card from a task.

The project will get released eventually, but I am adding a few other things to it first.&nbsp; I think all you need is in the ASF already though.&nbsp; If you are using Atmel Studio 6 then you can use the wizards in the IDE if you have the latest ASF version (the latest version can be downloaded from [http://gallery.atmel.com).](http://gallery.atmel.com%29.)

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 8, 2012, 7:18pm UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249/6 "2012-12-08T19:18:29Z")

</div>

**anonymous** wrote on [Saturday, December 08, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/e75ca83c/#824d):

I think I figured out the issue at least academically.&nbsp; I haven’t verified it yet.&nbsp; In the FreeRTOS PC demo, the FREERTOS\_USED flag is not defined.&nbsp; So my guess is that is why it works.&nbsp; I am trying to integrate the sd card functionality into the lwip demo and it does have the flag defined.&nbsp; I am going to try to create a demo and modifiy the flag in the sdcard files and see if it works.&nbsp; That might be a temporary solution but at least it will allow me to move on to the next step.

Thanks for the help.  
Seth

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 11, 2012, 7:11pm UTC](https://forums.freertos.org/t/sam3x-new-sd-driver/5249/7 "2012-12-11T19:11:13Z")

</div>

**anonymous** wrote on [Tuesday, December 11, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/e75ca83c/#c260):

So I have made positive progress over the weekend.&nbsp; I was able to create a project from scratch with the asf wizard.&nbsp; I added FreeRTOS 7.3 and ported a simplified version of the basic example.&nbsp; I added the sd card/fatfs drivers with the wizard and set the correct flags in the configuration files.

I created a task that detects the sd card, writes a string to the card then reads it back out.&nbsp; I think this is solid progress&nbsp;&nbsp; The next big task I think will be adding ethernet functionality.&nbsp; Is there a plan to add this to the asf wizard in the future?

Thanks,  
Seth
