shahabamo Posted February 27, 2017 Report Share Posted February 27, 2017 Hi. I have ported my custom board to designlab and have run various desginlab examples on it. One problem I could not solve yet is writing files to SD card usign SD examples. The sd card could successfully being initialized and even list the files inside it. but the file open and write fails. any suggestion to solve this is appreciated! Quote Link to comment Share on other sites More sharing options...
shahabamo Posted March 8, 2017 Author Report Share Posted March 8, 2017 any body had tested microSD wing, please let me know if there is any special trick here. regards, Quote Link to comment Share on other sites More sharing options...
alvieboy Posted March 9, 2017 Report Share Posted March 9, 2017 Not that I know of. It should work flawlessly out of the box. Note that often "writing" is disabled, to save code space. What issues are you encountering ? Only write not working? Alvie Quote Link to comment Share on other sites More sharing options...
shahabamo Posted March 25, 2017 Author Report Share Posted March 25, 2017 Alvie, thanks for the replay, yes, Only write is not working. I am able to read the files easily. but I cant open any file for writing. for instance, the "readwrite" example initializes the SD successfully, but it fails at "opening test.txt" step. Although If I manually create the "test.txt" file on the microSD (by connecting it to my PC via a memory-reader), It passes the write step (no write actually!) and reads the contents of test.txt successfully! Quote Note that often "writing" is disabled, to save code space I didn't know that at-all! How can I enable it? Quote Link to comment Share on other sites More sharing options...
alvieboy Posted March 27, 2017 Report Share Posted March 27, 2017 On 25/03/2017 at 5:47 AM, shahabamo said: Alvie, thanks for the replay, yes, Only write is not working. I am able to read the files easily. but I cant open any file for writing. for instance, the "readwrite" example initializes the SD successfully, but it fails at "opening test.txt" step. Although If I manually create the "test.txt" file on the microSD (by connecting it to my PC via a memory-reader), It passes the write step (no write actually!) and reads the contents of test.txt successfully! I didn't know that at-all! How can I enable it? I assume you're using the SD library. If so, try creating a file named "config.h" in your sketch folder, and add the following line: #define SD_WRITE_SUPPORT 1 That should enable write support. Sorry this is not documented anywhere. It should be, but unclear where I'd put such information... Alvie Quote Link to comment Share on other sites More sharing options...
shahabamo Posted March 27, 2017 Author Report Share Posted March 27, 2017 Thank you so much. It solved the issue! Quote Link to comment Share on other sites More sharing options...
alvieboy Posted March 27, 2017 Report Share Posted March 27, 2017 14 minutes ago, shahabamo said: Thank you so much. It solved the issue! Excellent. Now, we should document that somewhere... just unsure where. The code size different is substantial I believe, even if you don't actually use writes. Alvie 1 Quote Link to comment Share on other sites More sharing options...
Felix Posted March 28, 2017 Report Share Posted March 28, 2017 cant annotate in github ? Quote Link to comment Share on other sites More sharing options...
shahabamo Posted March 28, 2017 Author Report Share Posted March 28, 2017 You can also update the sd example sketches. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.