2013-04-11 10:58 PM
Hello,
i have a little problem. I have adaptet the stm_Host_MSC example on my board. I use the USB_HS_Core with the internal FS-phy. I can communicate and wirte on my usb-stick. my question mow is: What i have to do, that i can wite additional data in an existing file?? Thanks for your help.2013-04-11 11:02 PM
You'll likely need to layer on a file system, like FatFs, and access/modify the files that way.
2013-04-12 12:05 AM
I have added the files for the file-system to my project, but i'm confused where I have to modify.
Can you give me an example or something like that?2013-04-12 06:41 AM
Can I send you a bill for my time?
The sector reading and writing routines for FatFs are abstracted in diskio.cFRESULT res;
FIL fil;
FATFS fs32;
..
memset(&fs32, 0, sizeof(FATFS));
res = f_mount(0, &fs32);
if (res != FR_OK)
printf(''res = %d f_mount
'', res);
..
// Incremental write test
if (f_open(&fil, ''LOG.TXT'', FA_OPEN_ALWAYS | FA_WRITE) == FR_OK)
{
UINT BytesWritten;
const char string[] = ''Another line gets added
'';
f_lseek(&fil, fil.fsize); // Seek to tail
f_write(&fil, string, strlen(string), &BytesWritten); // Add new data
f_close(&fil);
}
2013-04-14 10:13 PM
THX clive.
Fanally it works. :)2013-08-28 12:28 PM
Hello Stephan,
I am new in USB interfacing can you help me how i can interface USB for transferring File in .txt format from STM32F303 to USB stick by giving an example.Thanks in advance