cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 FATFS + USB HOST MSC Error.

SWoon
Associate II

Hi.

I am trying to save .txt files to USB memory with USB HOST MSC and FATFS to STM32F401RB.

STM32F4-DISC and examples.

So I wrote the code with reference to CUBEMX and the examples I searched.

I entered USBH_Path in the * path of f_mount.

However, an error occurred during the build.

 f_mount (& USBDISKFatFs, (TCHAR const *) USBH_Path, 0)

The above code is where the error occurs.

Error [Pe020]: identifier "USBH_Path" is undefined.

Please help me.

2 REPLIES 2

And you've defined it where​ in your code?

Look at the examples you copied it from. Grep the source.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
SWoon
Associate II

As in the example, it's in the main function.

In Cubemx generated code "fatfs.c"

char USBHPath [4];

 I found what was declared as.

The file added "ff_gen_drv.h" to usb_host.c.

What files should I include?