Skip to main content
SWoon
Associate II
February 20, 2019
Question

STM32F401 FATFS + USB HOST MSC Error.

  • February 20, 2019
  • 2 replies
  • 988 views

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
February 20, 2019

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
February 20, 2019

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?