Site icon Renzo Mischianti

Question about LittleFS on rp2040 system

Hello, one Question about the "integrated LittleFS filesystem – 2" tutorial: I have tested the examples as shown in the tutorial. It seems to work fine. I can read / write files from / to the build in Flash Memory, but when i want to get the info's about the File system, configured in the Settings of Arduino Up-loader i get the wrong data. The same Data as shown in the tutorial.

FSInfo *info;
LittleFS.info(*info);

uint32_t totalBytes 	= info->totalBytes;
uint32_t usedBytes	= info->usedBytes;
uint32_t freeBytes 	= totalBytes-usedBytes;
uint32_t maxPath 	= info->maxPathLength;
uint32_t blockSize 	= info->blockSize;
uint32_t pagesize 	= info->pageSize;
uint32_t maxOpen 	= info->maxOpenFiles;

Serial1.println("File System info:");

Serial1.print("Total space:      ");Serial1.print(totalBytes);Serial1.println("byte");
Serial1.print("Total space used: ");Serial1.print(usedBytes); Serial1.println("byte");
Serial1.print("Total space free: ");Serial1.print(freeBytes); Serial1.println("byte");
Serial1.print("Max path lenght:  ");Serial1.println(maxPath);
Serial1.print("Block size:       ");Serial1.print(blockSize); Serial1.println("byte");
Serial1.print("Page size:        ");Serial1.print(pagesize);  Serial1.println("byte");
Serial1.print("Max open files:   ");Serial1.println(maxOpen);
output is: File System info: Total space: 537140992byte Total space used: 239byte Total space free: 537140753byte Max path lenght: 13107322 Block size: 53byte Page size: 49byte Max open files: 33649997 Test.txt 39 byte What is going wrong here? Its the same values as shown in the tutorial... Thank you for support. Best regards, Horst
Exit mobile version