05-10-2010 05:58 PM
I am trying to write to a MicroSD card using a derivative board of the MCB2300 from Keil.
I am successfully able to write to the card, but only when the debugging is turned on. My application is eventually going to be a stand alone battery powered application so its pretty important for me to be able to save data on the card without debugging.
This is what my code looks like:
Does anyone have any suggestions as to why this code will not run without debugging?
Thanks.
05-11-2010 10:49 AM
govkid201,
I haven't really seen any issues with turning debugging off. I've seen issues where turning it on makes code larger than the size limit and it won't run but the errors happen at compile. A couple of sanity steps to try would be writing to a different file name (e.g. M:\test.txt), try using a string constant with something simple in it (e.g. "data"), and also starting to write some of the information to the screen for debugging. I would start with outputting your timestamp string to the screen when debugging is turned off and then I would try unbundling the error cluster from each File I/O VI one at a time and write that string to the screen. This will tell us if the string is valid when debugging is turned off for whatever reason and also if the File I/O VI are running into any issues when debugging is turned off. I can't think of any logical reason why this would be happening but I have seen software do weird things so I'm not ruling anything out. I will also bring up the subject with our R&D team and see if they know of any issues or further troubleshooting steps. I assume that the code you posted is the only code that you are running and that it is not in a loop. If not, try just sliming it down to exactly what you posted and see if that works. Let me know what you find from the troubleshooting steps and I will post back when I have more information. Thanks!
05-12-2010 08:49 AM
I have tried different file names, as well as changing the directory. I have used just constants instead of a time stamp or other data.
My board doesn't have a screen, its a bare bones board that I built myself.
I have tried running very basic code, using just open/create file, write to text file (the data was "My VI works"), and close text file. still it only actually wrote to file with debugging on.
05-12-2010 12:26 PM
govkid201,
I'm still waiting on getting feedback from our developers on the issue but I am trying to get hardware setup so I can try to replicate the issue here. I noticed that the MCB2300 has a SD card slot under the screen. Are you using a MicroSD card with a MicroSD to SD adapter or did you mean you are using a SD card? We have both but I just needed to know which to use. Thanks!
05-12-2010 01:26 PM
05-13-2010 05:17 PM
govkid201,
I have been trying to replicate the issue for the past 3 hours with no success. No matter what permutation I try, my code will always write a file whether debugging is on or off. Take a look at my screenshots of my code:
Am I missing anything major that would be causing mine to work and not yours? I have also attached a Project that has my Read and Write applications (I created two separate VIs but I also used a SD card reader to check it on my computer between runs). Check it out and see if it runs on yours (make sure and rebuild the applications). I also wanted to point you to this example because I didn't know if you had tried it either (http://decibel.ni.com/content/docs/DOC-6254). Let me know if you see anything different because I can't seem to get it to break. Thanks!
05-18-2010 09:01 AM
govkid201,
Still having issues with writing to the SD card? Give us a shout out so we know where things stand. Good luck!
05-18-2010 09:18 AM