Skip to main content
SWoon
Associate II
Feb 20, 2019 8:28 AM UTC
Question

STM32F401 FATFS + USB HOST MSC Error.

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.

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Feb 20, 2019 8:36 AM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
SWoon
SWoonAuthor
Associate II
Feb 20, 2019 9:03 AM UTC

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?