Best practice for unmounting SD card? #4638
Replies: 1 comment
-
Posted at 2015-04-30 by JackBennett There's an As for how best to use this, I don't know. I can't see a problem with mounting and unmounting all the time. Posted at 2015-05-01 by @gfwilliams No, there shouldn't be a problem with unmounting/re-mounting (there may be a little more SD card wear over just leaving the file open and appending to it though). However it does seem to take a while to re-initialise the SD card (also to open the file), during which time Espruino won't be doing anything else (unless you're able to record using Personally I wouldn't unmount each time because of the above. One potential fix might be to use the 'card detect' switch. It's not wired up on the Espruino board, but you could solder it to a GPIO pin. You could use Whether you can do that quick enough not to cause damage to the SD card, I really don't know I'm afraid. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-04-30 by Dennis
Hi, what's the best practice for making sure the SD card gets properly unmounted? Of course this could be done with a button, but that's cumbersome.
I'm developing a logger for my brainwave recorder which basically is supposed to write data to the SD card for hours at a low data rate. The way I'm currently doing it is I append the new data to a variable and every 5 seconds I append the contents of that variable to a file and immediately unmount the SD. I also turn on an LED while this takes place. That way, the user can easily turn off the device or remove the SD in the 5 second intervals while the LED is off.
Is there anything bad about unmounting and re-mounting the SD all the time? Any other reason why this is bad practice?
Beta Was this translation helpful? Give feedback.
All reactions