I am building a logger with an SDHC card to store sensor data, I am using the SDHCFileSystem library.
I simply use FILE *fp = fopen(filename, "a"); at the top of main. filename is built from a timer.
My problem is that when I shutdown and restart the system, most of the time (not always!) the SD card
does not initialize automatically. I need to physically push the reset button, then it works.
I tried the mbed_reset() function at the top of main, but the Mbed main LED starts blinking and nothing happens.
I pulled nR to low, then back to high, but the SD card does not init.
My questions are:
- what is different between pulling the plug (USB or Vin), and reseting with the button?
- How can I consistently reset on restart in order to start the SD card?
- Is this a problem with Mbed, or rather a timing issue in the SDHC library?
Thanks for any hint you may have.
I am building a logger with an SDHC card to store sensor data, I am using the SDHCFileSystem library. I simply use FILE *fp = fopen(filename, "a"); at the top of main. filename is built from a timer.
My problem is that when I shutdown and restart the system, most of the time (not always!) the SD card does not initialize automatically. I need to physically push the reset button, then it works.
I tried the mbed_reset() function at the top of main, but the Mbed main LED starts blinking and nothing happens. I pulled nR to low, then back to high, but the SD card does not init.
My questions are: - what is different between pulling the plug (USB or Vin), and reseting with the button? - How can I consistently reset on restart in order to start the SD card? - Is this a problem with Mbed, or rather a timing issue in the SDHC library?
Thanks for any hint you may have.