USB device stack

Dependents:   mbed-mX-USB-TEST1 USBMSD_SD_HID_HelloWorld HidTest MIDI_usb_bridge ... more

Issue: USBDevice/USBHAL_STM32F4.cpp bad usage of STM_PIN_DATA in lines 58-62 breaks compilation

Trying to compile for an ST32F401RE the above mentioned lines break the compilation.

Actually, after poking around a bit, I think that the #if defined(TARGET_STM32F407VG) should also trigger for the nucleo platforms. I'd suggest removing the #if defined and its #else clause entirely... but I do not know if this will affect other platforms.

Can you please confirm this? Thanks.

Example program

4 comments:

07 Sep 2014

On further inspection, probably just changing the define from STM32F407VG to STM32F401xE would fix the problem, at least for me. I'd suggest using the massive define in lines 71-73 straight from mbed/TARGET_NUCLEO_F401RE/stm32f4xx.h

snippet from stm32f4xx.h

/** @addtogroup Library_configuration_section
 64   * @{
 65   */
 66 
 67 /* Uncomment the line below according to the target STM32 device used in your
 68    application 
 69   */
 70 
 71 #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \
 72     !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \
 73     !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE)
 74   /* #define STM32F405xx */   /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */
 75   /* #define STM32F415xx */   /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */
 76   /* #define STM32F407xx */   /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG  and STM32F407IE Devices */
 77   /* #define STM32F417xx */   /*!< STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */
 78   /* #define STM32F427xx */   /*!< STM32F427VG, STM32F427VI, STM32F427ZG, STM32F427ZI, STM32F427IG and STM32F427II Devices */
 79   /* #define STM32F437xx */   /*!< STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG and STM32F437II Devices */
 80   /* #define STM32F429xx */   /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI, STM32F429NG, 
 81                                    STM32F439NI, STM32F429IG  and STM32F429II Devices */
 82   /* #define STM32F439xx */   /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG, 
 83                                    STM32F439NI, STM32F439IG and STM32F439II Devices */
 84   /* #define STM32F401xC */   /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */
 85 #define STM32F401xE           /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */
 86   /* #define STM32F411xE */   /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */
 87 #endif

06 Oct 2014

I too got this error when trying to compile a simple application based on the USBDevice library for the NUCLEO_F411RE. Will this be fixed in a future release?

10 Nov 2014

Hi

In rev/f85ada5a4cef the following was added/changed:

- #if defined(TARGET_STM32F407VG)
+ #if defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE)

As you can see 401RE was explicitly added as a target. I assume it is safe to add other targets too, such as Hussam's 411RE, so feel free to experiment with this.

19 Dec 2016

Hi

i got same problem, but im using STM32F446RE. i add || defined(TARGET_STM32F446RE). the error disappear, but USB Device not recognized. there is no hardware problem or usb port problem, because i could flash thru USB DFU mode. Anyone please help :( i have to solve this problem, i have to finish my final project