AnsweredAssumed Answered

Problems with the STM32_USB_HOST_LIBRARY generated by CubeMX

Question asked by Antoine Wajntraub on Jan 12, 2017
Latest reply on Jan 12, 2017 by Jocelyn RICARD

Hi !


First, I use the version 4.18.0 STM32Cube V1.0, and Atollic True Studio 7.0.1, so both are (normally) the last ones.

I try to generate, with CubeMX, a project on STM32F417VG, using several libraries, the STM32_USB_HOST_LIBRARY for MSC being one of them. My problem is that I cannot use this project !


I generate the project -> I compile -> Works !

I generate the project -> I add these lines in the main.h :

#include "usbh_def.h"


USBH_HandleTypeDef hUSBHost;

I doesn't change anything else, and I don't write anything else but it doesn't compile, I have some strange errors.

Four of them are about four different macros (USBH_MAX_DATA_BUFFER, USBH_MAX_NUM_ENDPOINTS, USBH_MAX_NUM_INTERFACES, USBH_MAX_NUM_SUPPORTED_CLASS) in the file "usbh_def.h" with this message :

Macro undeclared here (not in a function)

But those macros are declared in usbh_conf.h which is directly included in usbh_def.h.


Another error is :

USBH_DeviceTypeDef has no member name 'CfgDesc_Raw'

in this line :

And when I go to the definition of USBH_DeviceTypeDef, I have this :

So if we want CfgDesc_Raw, it's because USBH_KEEP_CFG_DESCRIPTOR == 1 (and I checked, it's true), but if we don't have it in the structure, it's because the same macro != 1...


What happened ? Why can't I use this library properly ? Do you have any solution I can try, please ?


Thanks !