Pages: [1]   Go Down
Author Topic: MINMSC Driver posted for Due Native Port  (Read 1075 times)
0 Members and 1 Guest are viewing this topic.
USA, East Coast
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
Here are the links for the complete driver with doc:-

README.txt 2 KB
https://mega.co.nz/#!eVAliCqR!JGtk3AZ8rOeK6FC1gyYzVxiagyxR6NMF1FZWX4tXXd0

minmsc_2013_11_17_v1_0.zip 9.8 MB
https://mega.co.nz/#!TZQniIhJ!U90u-RzsXLRNUTgkdbnTxWPMDOF7f7yUOTJWInHzbGg

This driver will allow a sketch to do raw read/writes on a thumb drive attached to the Native AB.  A card Reader with any media should also work fine.

This driver can also work with sdfat20130629... the so called "old sdfat".  No shield needed.  Just replace 2 files of old sdfat and the existing sketches packaged with old sdfat should work.  This old sdfat20130629 can be downloaded from google code where fat16lib normally posts his work.

Best speed observed in raw sequential read/writes using a Sandisk Cruzer Fit 16GB:  4 MBytes/sec writes, 10 MBytes/sec reads.  But slower speeds using a IOGEAR Card Reader and a 8GB Class-6 Transcend SD card:  Seq Writes: 43 KBytes/sec, Seq Reads: 7.8 MBytes/sec.

The source code is only 243 KB or so, but the 2 doc files use of 9.8 MB of the zip file.
Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Haturi

I've been looking through the documentation provided, and your approach probably looks like the way I want to go - However, I'm running Windows, so re-compiling libsam would probably be quite a hassle.  Could you post a link to your latest cross-compiled version?  I guess it should work, as the target architecture is the same.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Solved it myself by adding the arm-none-eabi tools to Windows'  Path environment variable, then tweaking the Makefile slightly.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

Not sure if I've duplicated work, but I've modified/added to the SD wrapper code to work with the SD libraries which ship with IDE 1.5.5 rev. 2.  Thought I'd post them here, because GPL.

Changelog:
Code from "replacement Sd2Card" files moved into new "Sd2USB" files, and slightly modified given new data-types.  These define a new Sd2USB class, which largely inherits from the Sd2Card class, but replaces data access methods.

Sd2Card.h modified to allow facilitate inheritance.

SD.h modified to switch to using an Sd2USB object, if the header is #include-d.

* Sd2Card.h (9.39 KB - downloaded 29 times.)
* SD.h (2.99 KB - downloaded 17 times.)
* Sd2USB.cpp (19.34 KB - downloaded 22 times.)
* Sd2USB.h (2.42 KB - downloaded 15 times.)
Logged

USA, East Coast
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi greeTufty,
Sorry I could not reply in time.  For the last few months I've been busy making my project pcb ... routing some 40+ Analog and Digital signals from Due to my not-so-trivial pcb.  And I still have to muck with SCL1/SDA1 later on which I hear the folks are complaining about.  I need I2C!  Nothing is easy....

Your solution is correct ... the path to the executable was necessary.  Normally for command line development environment in Windows, they make a script that sets up the environment and the first thing to do is to run that script in the command box.  Then all the development tools in that environment become available.

The MINMSC driver is under GPL so there should be no concern about modification.

Regards.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all

DUE / MINMSC / sdfatlib / SD
Second time pendrive insertion is not behaving as expected.

Follow the code attached.

I tried four scenarios with two pendrives.
#1 reset
When I insert a pendrive without any file. program writes a test.txt file. I detach pendrive and remove the file in PC.
Second time when I insert the pendrive it goes to the line number 144 and prints error opening test.txt.

#2 reset
When I insert a pendrive without any file. program writes a test.txt file. I detach the pendrive and again insert it.
Second time when I insert the pendrive it goes to the line number 144 and 164 and prints error opening test.txtsmiley-razz

#3 reset
When I insert a pendrive with the file. Program says File already exists. I detach the pendrive and again insert it.
Second time when I insert the pendrive program again says File already exists.

#4 reset
When I insert a pendrive with the file. Program says File already exists.. I detach the pendrive and remove the file in PC.
Second time when I insert the pendrive program again says File already exists. ???

I think problem is with :  if( 0 != sd->exists("test.txt")) but can not find the way out.

Am I missing something?

Thanks.

* ReadWrite.ino (7.81 KB - downloaded 10 times.)
« Last Edit: April 10, 2014, 11:39:19 am by Rahul2047 » Logged

Everything keeps me (learning) teaching new things depending upon my perception at that time, giving infinite ways to think about only one t

USA, East Coast
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pl.excuse the delay.

Now that I am back from spring break...
You see it has been some time I did the MINMSC for SDFAT library.  And I do not remember all the minute details of MINMSC.  It takes time to get your mindset back.  What I can suggest you is this:

1.  Find out where the problem is.  Is it with Plug-n-Play or with file creation/deletion, etc.  MINMSC provides just two things:  A low level interface to the hardware and Plug-n-Play.  All upper level file manipulation is done by SDFAT.

2.  To pinpoint any P-n-P problem, include printfs for every event posted by the driver.  You should see that printf appear for any physical insertion or removal of the device (you are working with a pen-drive.  So, the media and device are all together.  You should get device level insertion/removal events).

The SDFAT library has been around for some time and it is well-tested.  It should not cause a random read/write error.  There is one thing I would check though.  Does the pendrive have a good format?  SDFAT works best with FAT16 or FAT32 but not with FAT24 -- as far as I know.

Hope this helps.
Logged

Pages: [1]   Go Up
Jump to: