frdmk64f usb device ramdisk example freertos write file from code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

frdmk64f usb device ramdisk example freertos write file from code

1,908 次查看
theophileleroy
NXP Employee
NXP Employee

Hello,

I've run with success frdmk64f_dev_msc_ramdisk_freertos example:

pastedImage_1.png

pastedImage_2.pngpastedImage_1.png

Next step, I want to write a text file into the ramdisk (from the code) to be read by the user on the host machine. How can I do that?

Thank you,

Théophile

标签 (1)
标记 (5)
0 项奖励
回复
2 回复数

1,701 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Theophile:

You can use f_write API to write a file.

Please refer to below link for f_write

FatFs - f_write 

Here is an example for how to use f_write.

SDK_2.4.1_FRDM-K64F\boards\frdmk64f\usb_examples\usb_host_msd_fatfs\freertos

Regards

Daniel

0 项奖励
回复

1,701 次查看
theophileleroy
NXP Employee
NXP Employee

I agree the problem I have is that in project usb_host_msd_fatfs\freertos the fatfs library is implemented with usb_host and not device stack. In file "diskio.c", low-level function implement function like USB_HostMsdInitializeDisk, USB_HostMsdReadDisk, etc...

In my case, I want to create the file on a USB ramdisk like device. I see that some function are also implemented for that kind of application: ram_disk_read(pdrv, buff, sector, count), ram_disk_write(pdrv, buff, sector, count), ... but I don't find the reference to them in the project

Regards

0 项奖励
回复