Hi NXP Team
I am beginner to the NXP controllers,I am currently working on a board OM13098LPCxpresso54628.I am trying create a new txt file write some data on to it in microUSB port J2/J3.I am using the example project provided in the SDK example(host_msd_fatfs_bm).USB Device was connected to the micro AB port to USB(J3) was detected. But i was structed in where to open the file and write the file.
In main function
USB_HostTaskFn(g_HostHandle);
USB_HostMsdTask(&g_MsdFatfsInstance);
function was called but i dont know how to write data onto the file.Is there any function i need to call.
Please provide me the example project which can open the file and write the data onto it or provide how to i start working. what are the procedure i need to follow.
Kindly help me.
Best regards,
A. Ajith Kumar
Hello @aajithkumarr,
The SDK example(host_msd_fatfs_bm) that you are using is the recommended one to start to open, create, write and read files.
Follow the next steps to find the relevant functions to open and write a file to the USB in the example:
[app.c file in host_msd_fatfs_bm SDK example]
[host_msd_fatfs.c file in host_msd_fatfs_bm SDK example]
Now you are in the function that performs all the testing/actions this example mentions in the readme.pdf file.
[host_msd_fatfs.c file in host_msd_fatfs_bm SDK example]
In here you will find the f_open function that is used for open/creating a non-existing file, while f_write is used for writing onto the file.
We recommend you work with the example, and to debug it to see how it works.
Caution: The SDK example erases all the content of the connected USB stick (performs a format).
Best regards, Raul.