-
Notifications
You must be signed in to change notification settings - Fork 26
Memory leak? #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you be more precise to be able to reproduce, please. |
Hardware: Plain Black F407VE with 2MB SD card. Maximum 3 directory levels. If you really want the complete sketch - here it is. /*
SD card test
This example shows how use the utility libraries on which the'
SD library is based in order to get info about your SD card.
Very useful for testing a card when you're not sure whether its working or not.
* SD card attached
*/
// include the SD library:
#include <STM32SD.h>
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
// to ignore it. One other option is to call 'card.init()' without parameter.
#ifndef SD_DETECT_PIN
#define SD_DETECT_PIN SD_DETECT_NONE
#endif
Sd2Card card;
SdFatFs fatFs;
File root; // root made global ***************************************************************
void setup()
{
bool disp = false;
// Open serial communications and wait for port to open:
Serial.begin(115200); // speed up ***********************************************************
while (!Serial);
Serial.print("\nInitializing SD card...");
while(!card.init(SD_DETECT_PIN)) {
if (!disp) {
Serial.println("initialization failed. Is a card inserted?");
disp = true;
}
delay(10);
}
Serial.println("A card is present.");
// print the type of card
Serial.print("\nCard type: ");
switch (card.type()) {
case SD_CARD_TYPE_SD1:
Serial.println("SD1");
break;
case SD_CARD_TYPE_SD2:
Serial.println("SD2");
break;
case SD_CARD_TYPE_SDHC:
Serial.println("SDHC");
break;
default:
Serial.println("Unknown");
}
// Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
if (!fatFs.init()) {
Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
return;
}
// print the type and size of the first FAT-type volume
uint64_t volumesize;
Serial.print("\nVolume type is FAT");
Serial.println(fatFs.fatType(), DEC);
Serial.println();
volumesize = fatFs.blocksPerCluster(); // clusters are collections of blocks
volumesize *= fatFs.clusterCount(); // we'll have a lot of clusters
volumesize *= 512; // SD card blocks are always 512 bytes
Serial.print("Volume size (bytes): ");
Serial.println(volumesize);
Serial.print("Volume size (Kbytes): ");
volumesize /= 1024;
Serial.println(volumesize);
Serial.print("Volume size (Mbytes): ");
volumesize /= 1024;
Serial.println(volumesize);
Serial.println("\nFiles found on the card (name, date and size in bytes): ");
root = SD.openRoot(); // root made global ***************************************************************
// list all files in the card with date and size
root.ls(LS_R | LS_DATE | LS_SIZE);
Serial.println("###### End of the SD tests ######");
}
void loop(void) {
// ******************************************* added *************************************************
root.ls(LS_R | LS_DATE | LS_SIZE);
root.rewindDirectory();
// ******************************************* added *************************************************
} Compiled wit 'Newlib standard' just stops somewhen without message. |
Ok thanks for the feedback. |
After some investigations, I've found the issue. |
@AnHardt |
And running all the night ;) |
Uh oh!
There was an error while loading. Please reload this page.
Take CardInfo.ino
Make
root
global.Add
to loop().
Compile. Run.
Runs for a while, than finishes with:
The text was updated successfully, but these errors were encountered: