Hello guys,
I am currently playing with the usbd_msc example from SDK15.3.0 that use USB Class storage module.
I was able to drop some files from my PC to 8MB drive made of external QSPI flash memory on nRF52840-DK board. What confuses me now is how can I read those files by using f_read() function!?
FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br);
I see that the first parameter of f_read() function should be a pointer to the file object. How can I get the file object I want to open? Should I do it by opening directory (f_opendir()) and listing it with f_readdir() or should I use a filename of the file I want to open or something else?
I am aware of some examples that first create the file with f_open() function, write to the file with f_write(), close the file with f_close() and after that read the file with f_read(). They use the same file pointer for f_read() function like they used for creating the file (e.g. here). In my case, I know the file exist, I did not create it through the code and I want to open it. How can I do it?
Thanks in advance for your time and effort. It is really appreciated.
Sincerely,
Bojan.