Hallo,
habe ein Problem mit FATFs. Lesen funktioniert problemlos, f_mount,
f_open, etc.. geben FR_OK zurück.
Möchte ich jedoch mit f_write schrieben bekomme ich FR_DISK_ERR
Hier mein Testcode:
1 | FRESULT myres = f_mount(&FatFs_SDCARD, "", 0);
|
2 | if(myres == FR_OK)
|
3 | {
|
4 | FIL fp;
|
5 | if(f_open(&fp,"test.txt",FA_CREATE_ALWAYS|FA_WRITE) == FR_OK)
|
6 | {
|
7 | TCHAR * txt ="Das ist ein test";
|
8 | UINT cnt = 0;
|
9 |
|
10 | //__asm volatile("CPSID i"); //disable all interrupts
|
11 | myres = f_write(&fp,txt,17,&cnt);
|
12 | //__asm volatile("CPSIE i"); //enable all interrupts
|
13 |
|
14 | if(myres == FR_OK)
|
15 | {
|
16 | //super
|
17 | }
|
18 | f_close(&fp);
|
19 | }
|
20 | }
|
Habe auch schon versucht alle Interrupts während das Schreibens zu
deaktivieren, leider Erfolglos.
hat jemand eine Idee? Sitze hier seit Stunden und habe keine Ahnung
mehr..
Danke :)