@hukai The test code is what I have attached before, However I've attached here. I should mention that I tried to write 10K file, the file is created but either it's empty or file format is unreadable ( I've attached the error once I try to open the file in my computer). I wasn't able to attached the written file here, if you give me an email I can email it to you. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <devices.h> #include <filesystem.h> #include <storage/sdcard.h> #include "project_cfg.h" handle_t install_sdcard() { handle_t spi, gpio; configASSERT(spi = io_open("/dev/spi0")); configASSERT(gpio = io_open("/dev/gpio0")); handle_t sd0 = spi_sdcard_driver_install(spi, gpio, 7); io_close(spi); io_close(gpio); return sd0; } //char buffer[size]; int main() { printf("Hello sd\n"); int size = 10000; char *msg = NULL ;//="k233333333333333333"; msg = (char *) malloc(size); if (!msg) printf("errorrrrr\n"); else { memset(msg,'A',size); *(msg+size-1) = NULL; // handle_t sd0 = install_sdcard(); configASSERT(sd0); configASSERT(filesystem_mount("/fs/0/", sd0) == 0); io_close(sd0); /************************* test syscalls ************************************/ FILE *stream; if((stream=fopen("/fs/0/testlagefile.txt","wb"))==NULL) { fprintf(stderr,"Can not open file.\n"); exit(-1); } printf("fwrite\n"); uint16_t ret= fwrite(msg, 1, size, stream); fclose(stream); printf("done %d\n",ret); } while (1) ; } Error message in opening file: