void SD(int32_t rando, int addr, int bit, int pc) { DXSPISDVOL disk(XPAR_PMODSD_0_AXI_LITE_SPI_BASEADDR, XPAR_PMODSD_0_AXI_LITE_SDCS_BASEADDR); DFILE file; char printline[128]; sprintf(printline, "\nLFSR: %d ", rando); // The drive to mount the SD volume to. // Options are: "0:", "1:", "2:", "3:", "4:" static const char szDriveNbr[] = "0:"; FRESULT fr; u32 bytesWritten = 0; u32 bytesRead, totalBytesRead; u8 buff[12], *buffptr; xil_printf("PmodSD Demo Launched\r\n"); // Mount the disk DFATFS::fsmount(disk, szDriveNbr, 1); xil_printf("Disk mounted\r\n"); fr = file.fsopen("output.txt", FA_OPEN_ALWAYS); if (fr == FR_OK) { file.fsputs(printline); fr = file.fsclose(); } else { xil_printf("Failed to open file to write to\r\n"); } }