Explains how to read and write from/to sdcard.
#include <stm32f4xx.h>
int main(void) {
char buff[20];
UINT totalwrite = 0, totalread = 0, tmpwrite, tmpread;
UINT size;
while (1);
}
}
while (1) {
f_read(&f, buff,
sizeof(buff), &tmpread);
totalread += tmpread;
}
f_write(&f, buff, tmpread, &tmpwrite);
totalwrite += tmpwrite;
}
if (!tmpwrite) {
break;
}
if (totalwrite == size) {
break;
}
}
for (;;) {
}
return 0;
}