diff --git a/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h b/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h index 4c67d6b694..63125644be 100644 --- a/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h +++ b/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h @@ -15,17 +15,27 @@ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + #ifdef TARGET_STM32F303ZE #include "USBHAL_STM32F303ZE.h" #endif -#if defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F446ZE) || defined(TARGET_STM32F207ZG) \ -|| defined(TARGET_STM32F767ZI) || defined (TARGET_STM32F746ZG) || defined(TARGET_STM32F411RE) \ -|| defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE) + +#if defined(TARGET_STM32F207ZG) || \ + defined(TARGET_STM32F401RE) || \ + defined(TARGET_STM32F407VG) || \ + defined(TARGET_STM32F411RE) || \ + defined(TARGET_STM32F412ZG) || \ + defined(TARGET_STM32F429ZI) || \ + defined(TARGET_STM32F446ZE) || \ + defined(TARGET_STM32F746ZG) || \ + defined(TARGET_STM32F767ZI) #include "USBHAL_STM_144_64pins.h" #endif + #ifdef TARGET_STM32L476VG #include "USBHAL_STM32L476VG.h" #endif + #ifdef TARGET_STM32F769NI #include "USBHAL_STM32F769NI.h" #endif diff --git a/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp b/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp index 4c4f44ca01..a7ef57a6ea 100644 --- a/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp +++ b/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp @@ -48,7 +48,7 @@ USBHAL::USBHAL(void) { // Enable power and clocking RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN; -#if defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE) || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F429ZI) +#if defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE) || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F412ZG) || defined(TARGET_STM32F429ZI) pin_function(PA_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); pin_function(PA_9, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLDOWN, GPIO_AF10_OTG_FS)); pin_function(PA_10, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)); diff --git a/features/unsupported/USBHost/USBHost/TARGET_STM/USBHALHost_STM_TARGET.h b/features/unsupported/USBHost/USBHost/TARGET_STM/USBHALHost_STM_TARGET.h index 1cde2f384d..a7515ecd47 100644 --- a/features/unsupported/USBHost/USBHost/TARGET_STM/USBHALHost_STM_TARGET.h +++ b/features/unsupported/USBHost/USBHost/TARGET_STM/USBHALHost_STM_TARGET.h @@ -18,7 +18,7 @@ /* 144 pins boards */ #if defined(TARGET_NUCLEO_F429ZI) || defined(TARGET_NUCLEO_F446ZE) || defined(TARGET_NUCLEO_F207ZG) \ -|| defined(TARGET_NUCLEO_F767ZI) || defined(TARGET_NUCLEO_F746ZG) +|| defined(TARGET_NUCLEO_F767ZI) || defined(TARGET_NUCLEO_F746ZG) || defined(TARGET_NUCLEO_F412ZG) #include "USBHALHost_STM_144_64pins.h" #endif diff --git a/targets/targets.json b/targets/targets.json index c6c453a304..5c5bcd1142 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -857,7 +857,7 @@ "supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"], "inherits": ["Target"], "detect_code": ["0826"], - "macros": ["TRANSACTION_QUEUE_SIZE_SPI=2"], + "macros": ["TRANSACTION_QUEUE_SIZE_SPI=2", "USB_STM_HAL", "USBHOST_OTHER"], "device_has": ["ANALOGIN", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "TRNG"], "release_versions": ["2", "5"], "device_name": "STM32F412ZG" diff --git a/tools/build_travis.py b/tools/build_travis.py index 0ba0db3c79..7e461176c2 100644 --- a/tools/build_travis.py +++ b/tools/build_travis.py @@ -54,7 +54,7 @@ build_list = ( { "target": "NUCLEO_F401RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat", "usb_host"] }, { "target": "NUCLEO_F410RB", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, { "target": "NUCLEO_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat", "usb_host"] }, - { "target": "NUCLEO_F412ZG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, + { "target": "NUCLEO_F412ZG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat", "usb_host"] }, { "target": "NUCLEO_L432KC", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, { "target": "NUCLEO_L476RG", "toolchains": "GCC_ARM", "libs": ["dsp", "fat", "rtos", "usb_host"] }, { "target": "NUCLEO_L011K4", "toolchains": "GCC_ARM", "libs": ["dsp"] }, @@ -194,6 +194,7 @@ linking_list = [ "toolchains": "GCC_ARM", "tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_16"], "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"], + "usb" : ["USB_1", "USB_2" ,"USB_3", "USB_10", "USB_11"], } }, {"target": "NUCLEO_F429ZI",