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:
- Ctrl + click on USB_HostMsdTask(&g_MsdFatfsInstance);

[app.c file in host_msd_fatfs_bm SDK example]
- Then in the function search for USB_HostMsdFatfsTest(msdFatfsInstance); and ctrl + click on it.

[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.
- Nonetheless, the file opening and writing is almost at the end of the function. You may want to search for the following line that starts the open/create a file test: usb_echo("file operation:\r\n");

[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.