From f50f38745b06b2d904cfa45e5a736d1c10027362 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Sun, 27 Oct 2019 21:06:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Perfect=20usb=20driver=20compatible=20with?= =?UTF-8?q?=20HS.|=E5=AE=8C=E5=96=84usb=E9=A9=B1=E5=8A=A8=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=20HS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/stm32/libraries/HAL_Drivers/Kconfig | 25 ++++++++++++ bsp/stm32/libraries/HAL_Drivers/SConscript | 4 +- .../f1/{usbd_fs_config.h => usbd_config.h} | 8 ++-- .../HAL_Drivers/config/f4/usbd_config.h | 40 +++++++++++++++++++ .../HAL_Drivers/config/f4/usbd_fs_config.h | 15 ------- .../HAL_Drivers/config/g4/usbd_config.h | 40 +++++++++++++++++++ .../HAL_Drivers/config/g4/usbd_fs_config.h | 15 ------- .../HAL_Drivers/config/h7/usbd_config.h | 40 +++++++++++++++++++ .../HAL_Drivers/config/l4/usbd_config.h | 40 +++++++++++++++++++ .../HAL_Drivers/config/l4/usbd_fs_config.h | 15 ------- bsp/stm32/libraries/HAL_Drivers/drv_config.h | 9 +++-- .../HAL_Drivers/{drv_usbd_fs.c => drv_usbd.c} | 10 ++--- .../libraries/templates/stm32xx_board_Kconfig | 2 +- bsp/stm32/stm32f429-st-disco/board/Kconfig | 2 +- bsp/stm32/stm32f469-st-disco/board/Kconfig | 2 +- bsp/stm32/stm32l475-atk-pandora/board/Kconfig | 2 +- 16 files changed, 206 insertions(+), 63 deletions(-) rename bsp/stm32/libraries/HAL_Drivers/config/f1/{usbd_fs_config.h => usbd_config.h} (62%) create mode 100644 bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h delete mode 100644 bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_fs_config.h create mode 100644 bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h delete mode 100644 bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_fs_config.h create mode 100644 bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h create mode 100644 bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h delete mode 100644 bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_fs_config.h rename bsp/stm32/libraries/HAL_Drivers/{drv_usbd_fs.c => drv_usbd.c} (97%) diff --git a/bsp/stm32/libraries/HAL_Drivers/Kconfig b/bsp/stm32/libraries/HAL_Drivers/Kconfig index 59f0939245..6dc0c5bcbb 100644 --- a/bsp/stm32/libraries/HAL_Drivers/Kconfig +++ b/bsp/stm32/libraries/HAL_Drivers/Kconfig @@ -1,3 +1,28 @@ +if BSP_USING_USBD + config BSP_USBD_TYPE_FS + bool + # "USB Full Speed (FS) Core" + config BSP_USBD_TYPE_HS + bool + # "USB High Speed (HS) Core" + + config BSP_USBD_SPEED_HS + bool + # "USB High Speed (HS) Mode" + config BSP_USBD_SPEED_HSINFS + bool + # "USB High Speed (HS) Core in FS mode" + + config BSP_USBD_PHY_EMBEDDED + bool + # "Using Embedded phy interface" + config BSP_USBD_PHY_UTMI + bool + # "UTMI: USB 2.0 Transceiver Macrocell Interace" + config BSP_USBD_PHY_ULPI + bool + # "ULPI: UTMI+ Low Pin Interface" +endif config BSP_USING_CRC bool "Enable CRC (CRC-32 0x04C11DB7 Polynomial)" diff --git a/bsp/stm32/libraries/HAL_Drivers/SConscript b/bsp/stm32/libraries/HAL_Drivers/SConscript index 1d37075fcd..02f68afa25 100644 --- a/bsp/stm32/libraries/HAL_Drivers/SConscript +++ b/bsp/stm32/libraries/HAL_Drivers/SConscript @@ -82,8 +82,8 @@ if GetDepend(['BSP_USING_WDT']): if GetDepend(['BSP_USING_SDIO']): src += ['drv_sdio.c'] -if GetDepend(['BSP_USING_USBD_FS']): - src += ['drv_usbd_fs.c'] +if GetDepend(['BSP_USING_USBD']): + src += ['drv_usbd.c'] if GetDepend(['BSP_USING_PULSE_ENCODER']): src += ['drv_pulse_encoder.c'] diff --git a/bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_fs_config.h b/bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h similarity index 62% rename from bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_fs_config.h rename to bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h index 520934aa4b..4ad6540896 100644 --- a/bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_fs_config.h +++ b/bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h @@ -8,11 +8,13 @@ * 2019-04-10 ZYH first version * 2019-07-29 Chinese66 change from f4 to f1 */ -#ifndef __USBD_FS_CONFIG_H__ -#define __USBD_FS_CONFIG_H__ +#ifndef __USBD_CONFIG_H__ +#define __USBD_CONFIG_H__ -#define USBD_FS_IRQ_HANDLER USB_LP_CAN1_RX0_IRQHandler +#define USBD_IRQ_HANDLER USB_LP_CAN1_RX0_IRQHandler #define USBD_INSTANCE USB +#define USBD_PCD_SPEED PCD_SPEED_FULL +#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED #define BSP_USB_CONNECT_PIN -1 #endif diff --git a/bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h b/bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h new file mode 100644 index 0000000000..9714ee4ac5 --- /dev/null +++ b/bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-04-10 ZYH first version + * 2019-10-27 flybreak Compatible with the HS + */ +#ifndef __USBD_CONFIG_H__ +#define __USBD_CONFIG_H__ + +#include + +#ifdef BSP_USBD_TYPE_HS +#define USBD_IRQ_HANDLER OTG_HS_IRQHandler +#define USBD_INSTANCE USB_OTG_HS +#else +#define USBD_IRQ_HANDLER OTG_FS_IRQHandler +#define USBD_INSTANCE USB_OTG_FS +#endif + +#ifdef BSP_USBD_SPEED_HS +#define USBD_PCD_SPEED PCD_SPEED_HIGH +#elif BSP_USBD_SPEED_HSINFS +#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL +#else +#define USBD_PCD_SPEED PCD_SPEED_FULL +#endif + +#ifdef BSP_USBD_PHY_ULPI +#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI +#elif BSP_USBD_PHY_UTMI +#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI +#else +#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED +#endif + +#endif diff --git a/bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_fs_config.h b/bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_fs_config.h deleted file mode 100644 index b987356c7d..0000000000 --- a/bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_fs_config.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2019-04-10 ZYH first version - */ -#ifndef __USBD_FS_CONFIG_H__ -#define __USBD_FS_CONFIG_H__ - -#define USBD_FS_IRQ_HANDLER OTG_FS_IRQHandler -#define USBD_INSTANCE USB_OTG_FS -#endif diff --git a/bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h b/bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h new file mode 100644 index 0000000000..e30f7c11a6 --- /dev/null +++ b/bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-04-10 ZYH first version + * 2019-10-27 flybreak Compatible with the HS + */ +#ifndef __USBD_CONFIG_H__ +#define __USBD_CONFIG_H__ + +#include + +#ifdef BSP_USBD_TYPE_HS +#define USBD_IRQ_HANDLER OTG_HS_IRQHandler +#define USBD_INSTANCE USB_OTG_HS +#else +#define USBD_IRQ_HANDLER OTG_FS_IRQHandler +#define USBD_INSTANCE USB_OTG_FS +#endif + +#ifdef BSP_USBD_SPEED_HS +#define USBD_PCD_SPEED PCD_SPEED_HIGH +#elif BSP_USBD_SPEED_HSINFS +#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL +#else +#define USBD_PCD_SPEED PCD_SPEED_FULL +#endif + +#ifdef BSP_USBD_PHY_ULPI +#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI +#elif BSP_USBD_PHY_UTMI +#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI +#else +#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED +#endif + +#endif diff --git a/bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_fs_config.h b/bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_fs_config.h deleted file mode 100644 index b987356c7d..0000000000 --- a/bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_fs_config.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2019-04-10 ZYH first version - */ -#ifndef __USBD_FS_CONFIG_H__ -#define __USBD_FS_CONFIG_H__ - -#define USBD_FS_IRQ_HANDLER OTG_FS_IRQHandler -#define USBD_INSTANCE USB_OTG_FS -#endif diff --git a/bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h b/bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h new file mode 100644 index 0000000000..9714ee4ac5 --- /dev/null +++ b/bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-04-10 ZYH first version + * 2019-10-27 flybreak Compatible with the HS + */ +#ifndef __USBD_CONFIG_H__ +#define __USBD_CONFIG_H__ + +#include + +#ifdef BSP_USBD_TYPE_HS +#define USBD_IRQ_HANDLER OTG_HS_IRQHandler +#define USBD_INSTANCE USB_OTG_HS +#else +#define USBD_IRQ_HANDLER OTG_FS_IRQHandler +#define USBD_INSTANCE USB_OTG_FS +#endif + +#ifdef BSP_USBD_SPEED_HS +#define USBD_PCD_SPEED PCD_SPEED_HIGH +#elif BSP_USBD_SPEED_HSINFS +#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL +#else +#define USBD_PCD_SPEED PCD_SPEED_FULL +#endif + +#ifdef BSP_USBD_PHY_ULPI +#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI +#elif BSP_USBD_PHY_UTMI +#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI +#else +#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED +#endif + +#endif diff --git a/bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h b/bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h new file mode 100644 index 0000000000..e30f7c11a6 --- /dev/null +++ b/bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-04-10 ZYH first version + * 2019-10-27 flybreak Compatible with the HS + */ +#ifndef __USBD_CONFIG_H__ +#define __USBD_CONFIG_H__ + +#include + +#ifdef BSP_USBD_TYPE_HS +#define USBD_IRQ_HANDLER OTG_HS_IRQHandler +#define USBD_INSTANCE USB_OTG_HS +#else +#define USBD_IRQ_HANDLER OTG_FS_IRQHandler +#define USBD_INSTANCE USB_OTG_FS +#endif + +#ifdef BSP_USBD_SPEED_HS +#define USBD_PCD_SPEED PCD_SPEED_HIGH +#elif BSP_USBD_SPEED_HSINFS +#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL +#else +#define USBD_PCD_SPEED PCD_SPEED_FULL +#endif + +#ifdef BSP_USBD_PHY_ULPI +#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI +#elif BSP_USBD_PHY_UTMI +#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI +#else +#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED +#endif + +#endif diff --git a/bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_fs_config.h b/bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_fs_config.h deleted file mode 100644 index b987356c7d..0000000000 --- a/bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_fs_config.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2019-04-10 ZYH first version - */ -#ifndef __USBD_FS_CONFIG_H__ -#define __USBD_FS_CONFIG_H__ - -#define USBD_FS_IRQ_HANDLER OTG_FS_IRQHandler -#define USBD_INSTANCE USB_OTG_FS -#endif diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_config.h b/bsp/stm32/libraries/HAL_Drivers/drv_config.h index b10628e988..cc1c3f5bde 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_config.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_config.h @@ -33,7 +33,7 @@ extern "C" { #include "f1/tim_config.h" #include "f1/sdio_config.h" #include "f1/pwm_config.h" -#include "f1/usbd_fs_config.h" +#include "f1/usbd_config.h" #include "f1/pulse_encoder_config.h" #elif defined(SOC_SERIES_STM32F2) #include "f2/dma_config.h" @@ -48,7 +48,7 @@ extern "C" { #include "f4/uart_config.h" #include "f4/spi_config.h" #include "f4/qspi_config.h" -#include "f4/usbd_fs_config.h" +#include "f4/usbd_config.h" #include "f4/adc_config.h" #include "f4/tim_config.h" #include "f4/sdio_config.h" @@ -75,7 +75,7 @@ extern "C" { #include "l4/tim_config.h" #include "l4/sdio_config.h" #include "l4/pwm_config.h" -#include "l4/usbd_fs_config.h" +#include "l4/usbd_config.h" #elif defined(SOC_SERIES_STM32G0) #include "g0/dma_config.h" #include "g0/uart_config.h" @@ -88,7 +88,7 @@ extern "C" { #include "g4/uart_config.h" #include "g4/spi_config.h" #include "g4/qspi_config.h" -#include "g4/usbd_fs_config.h" +#include "g4/usbd_config.h" #include "g4/adc_config.h" #include "g4/tim_config.h" #include "g4/sdio_config.h" @@ -103,6 +103,7 @@ extern "C" { #include "h7/tim_config.h" #include "h7/sdio_config.h" #include "h7/pwm_config.h" +#include "h7/usbd_config.h" #endif #ifdef __cplusplus diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_usbd_fs.c b/bsp/stm32/libraries/HAL_Drivers/drv_usbd.c similarity index 97% rename from bsp/stm32/libraries/HAL_Drivers/drv_usbd_fs.c rename to bsp/stm32/libraries/HAL_Drivers/drv_usbd.c index 91371a38ec..1f40117750 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_usbd_fs.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_usbd.c @@ -6,11 +6,12 @@ * Change Logs: * Date Author Notes * 2019-04-10 ZYH first version + * 2019-10-27 flybreak Compatible with the HS */ #include -#ifdef BSP_USING_USBD_FS +#ifdef BSP_USING_USBD #include #include "board.h" #include @@ -32,13 +33,12 @@ static struct ep_id _ep_pool[] = {0xFF, USB_EP_ATTR_TYPE_MASK, USB_DIR_MASK, 0, ID_ASSIGNED }, }; -void USBD_FS_IRQ_HANDLER(void) +void USBD_IRQ_HANDLER(void) { rt_interrupt_enter(); HAL_PCD_IRQHandler(&_stm_pcd); /* leave interrupt */ rt_interrupt_leave(); - } void HAL_PCD_ResetCallback(PCD_HandleTypeDef *pcd) @@ -194,10 +194,10 @@ static rt_err_t _init(rt_device_t device) pcd->Instance = USBD_INSTANCE; memset(&pcd->Init, 0, sizeof pcd->Init); pcd->Init.dev_endpoints = 8; - pcd->Init.speed = PCD_SPEED_FULL; + pcd->Init.speed = USBD_PCD_SPEED; pcd->Init.ep0_mps = DEP0CTL_MPS_64; #if !defined(SOC_SERIES_STM32F1) - pcd->Init.phy_itface = PCD_PHY_EMBEDDED; + pcd->Init.phy_itface = USBD_PCD_PHY_MODULE; #endif /* Initialize LL Driver */ HAL_PCD_Init(pcd); diff --git a/bsp/stm32/libraries/templates/stm32xx_board_Kconfig b/bsp/stm32/libraries/templates/stm32xx_board_Kconfig index d419b4aea9..42c8528c60 100644 --- a/bsp/stm32/libraries/templates/stm32xx_board_Kconfig +++ b/bsp/stm32/libraries/templates/stm32xx_board_Kconfig @@ -171,7 +171,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - config BSP_USING_USBD_FS + config BSP_USING_USBD bool "Enable OTGFS as USB device" select RT_USING_USB_DEVICE default n diff --git a/bsp/stm32/stm32f429-st-disco/board/Kconfig b/bsp/stm32/stm32f429-st-disco/board/Kconfig index 78788870d9..20b1a98ab3 100644 --- a/bsp/stm32/stm32f429-st-disco/board/Kconfig +++ b/bsp/stm32/stm32f429-st-disco/board/Kconfig @@ -76,7 +76,7 @@ menu "On-chip Peripheral Drivers" bool "Enable FMC" default n - config BSP_USING_USBD_FS + config BSP_USING_USBD bool "Enable OTGFS as USB device" select RT_USING_USB_DEVICE default n diff --git a/bsp/stm32/stm32f469-st-disco/board/Kconfig b/bsp/stm32/stm32f469-st-disco/board/Kconfig index 9cf1430600..a1dd9ff7f7 100644 --- a/bsp/stm32/stm32f469-st-disco/board/Kconfig +++ b/bsp/stm32/stm32f469-st-disco/board/Kconfig @@ -149,7 +149,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_DFS default n - config BSP_USING_USBD_FS + config BSP_USING_USBD bool "Enable OTGFS as USB device" select RT_USING_USB_DEVICE default n diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index 16ebda7a35..63c82c08cc 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -300,7 +300,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - config BSP_USING_USBD_FS + config BSP_USING_USBD bool "Enable OTGFS as USB device" select RT_USING_USB_DEVICE default n From 9f8d6557ea9606ab5f388cdbbda1907cbb7eb340 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Sun, 27 Oct 2019 21:15:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[bsp][stm32]=20Add=20USB=20HS=20for=20H7-TO?= =?UTF-8?q?OL.|=E4=B8=BA=20H7-TOOL=20=E6=B7=BB=E5=8A=A0=20USBHS.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/stm32/libraries/STM32H7xx_HAL/SConscript | 2 +- .../board/CubeMX_Config/.mxproject | 11 +- .../board/CubeMX_Config/CubeMX_Config.ioc | 135 ++++++++++++------ .../CubeMX_Config/Inc/stm32h7xx_hal_conf.h | 2 +- .../board/CubeMX_Config/Inc/stm32h7xx_it.h | 1 + .../board/CubeMX_Config/Src/main.c | 41 ++++++ .../CubeMX_Config/Src/stm32h7xx_hal_msp.c | 134 +++++++++++++++++ .../board/CubeMX_Config/Src/stm32h7xx_it.c | 16 ++- .../stm32h750-armfly-h7-tool/board/Kconfig | 8 ++ .../stm32h750-armfly-h7-tool/board/SConscript | 15 +- 10 files changed, 298 insertions(+), 67 deletions(-) diff --git a/bsp/stm32/libraries/STM32H7xx_HAL/SConscript b/bsp/stm32/libraries/STM32H7xx_HAL/SConscript index f1548a3525..a503e3e7f9 100644 --- a/bsp/stm32/libraries/STM32H7xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32H7xx_HAL/SConscript @@ -42,7 +42,7 @@ if GetDepend(['RT_USING_SPI']): src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.c'] if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']): - src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pccard.c'] + # src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pccard.c'] src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c'] src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c'] src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hcd.c'] diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/.mxproject b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/.mxproject index 90a1e4b4c6..6e814f4fde 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/.mxproject +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/.mxproject @@ -1,12 +1,17 @@ [PreviousGenFiles] -HeaderPath=E:/rt-thread/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc +HeaderPath=D:/work/rt-thread-me/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc HeaderFiles=stm32h7xx_it.h;stm32h7xx_hal_conf.h;main.h; -SourcePath=E:/rt-thread/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src +SourcePath=D:/work/rt-thread-me/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src SourceFiles=stm32h7xx_it.c;stm32h7xx_hal_msp.c;main.c; [PreviousLibFiles] -LibFiles=Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_cortex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_qspi.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rng.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_sdmmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_hsem.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mdma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h;Drivers/STM32H7xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_exti.h;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rng.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_sdmmc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_cortex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_qspi.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rng.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_sdmmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_hsem.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mdma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h;Drivers/STM32H7xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_exti.h;Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h750xx.h;Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h;Drivers/CMSIS/Device/ST/STM32H7xx/Include/system_stm32h7xx.h;Drivers/CMSIS/Device/ST/STM32H7xx/Source/Templates/system_stm32h7xx.c; +LibFiles=Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_hsem.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mdma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_cortex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h;Drivers/STM32H7xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_exti.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_qspi.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rng.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_sdmmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pcd.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pcd_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_usb.h;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rng.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_sdmmc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c;Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_usb.c;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_adc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_adc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_hsem.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dma_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mdma.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_cortex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h;Drivers/STM32H7xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_i2c_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_exti.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_crc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dac_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_eth_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_qspi.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rng.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_sdmmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_mmc_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pcd.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pcd_ex.h;Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_usb.h;Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h750xx.h;Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h;Drivers/CMSIS/Device/ST/STM32H7xx/Include/system_stm32h7xx.h;Drivers/CMSIS/Device/ST/STM32H7xx/Source/Templates/system_stm32h7xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h; [] SourceFiles=;; +[PreviousUsedKeilFiles] +SourceFiles=..\Src\main.c;..\Src\stm32h7xx_it.c;..\Src\stm32h7xx_hal_msp.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rng.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_sdmmc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_usb.c;..\\Src/system_stm32h7xx.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rng.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_sdmmc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mmc_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c;..\Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_usb.c;..\\Src/system_stm32h7xx.c;..\Drivers/CMSIS/Device/ST/STM32H7xx/Source/Templates/system_stm32h7xx.c;; +HeaderPath=..\Drivers\STM32H7xx_HAL_Driver\Inc;..\Drivers\STM32H7xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32H7xx\Include;..\Drivers\CMSIS\Include;..\Inc; +CDefines=USE_HAL_DRIVER;STM32H750xx;USE_HAL_DRIVER;USE_HAL_DRIVER; + diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/CubeMX_Config.ioc b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/CubeMX_Config.ioc index a6b6d880ae..2e61077ef5 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/CubeMX_Config.ioc +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/CubeMX_Config.ioc @@ -16,6 +16,7 @@ Mcu.IP10=SYS Mcu.IP11=TIM12 Mcu.IP12=UART4 Mcu.IP13=USART1 +Mcu.IP14=USB_OTG_HS Mcu.IP2=CRC Mcu.IP3=DAC1 Mcu.IP4=ETH @@ -24,54 +25,66 @@ Mcu.IP6=QUADSPI Mcu.IP7=RCC Mcu.IP8=RNG Mcu.IP9=SDMMC1 -Mcu.IPNb=14 +Mcu.IPNb=15 Mcu.Name=STM32H750IBKx Mcu.Package=UFBGA176 Mcu.Pin0=PB8 -Mcu.Pin1=PG14 -Mcu.Pin10=PC14-OSC32_IN (OSC32_IN) -Mcu.Pin11=PH13 -Mcu.Pin12=PH14 -Mcu.Pin13=PA9 -Mcu.Pin14=PC15-OSC32_OUT (OSC32_OUT) -Mcu.Pin15=PC9 -Mcu.Pin16=PH0-OSC_IN (PH0) -Mcu.Pin17=PC8 -Mcu.Pin18=PC7 -Mcu.Pin19=PH1-OSC_OUT (PH1) -Mcu.Pin2=PG13 -Mcu.Pin20=PC6 -Mcu.Pin21=PF3 -Mcu.Pin22=PG6 -Mcu.Pin23=PF7 -Mcu.Pin24=PF8 -Mcu.Pin25=PC1 -Mcu.Pin26=PB2 -Mcu.Pin27=PH9 -Mcu.Pin28=PD13 -Mcu.Pin29=PA1 -Mcu.Pin3=PC12 -Mcu.Pin30=PA4 -Mcu.Pin31=PC4 -Mcu.Pin32=PH7 -Mcu.Pin33=PD12 -Mcu.Pin34=PD11 -Mcu.Pin35=PA2 -Mcu.Pin36=PC5 -Mcu.Pin37=PF12 -Mcu.Pin38=PA7 -Mcu.Pin39=PB14 -Mcu.Pin4=PB9 -Mcu.Pin40=VP_CRC_VS_CRC -Mcu.Pin41=VP_RNG_VS_RNG -Mcu.Pin42=VP_SYS_VS_Systick -Mcu.Pin43=VP_TIM12_VS_ControllerModeReset -Mcu.Pin5=PG11 -Mcu.Pin6=PC11 -Mcu.Pin7=PC10 -Mcu.Pin8=PD2 -Mcu.Pin9=PA10 -Mcu.PinsNb=44 +Mcu.Pin1=PB5 +Mcu.Pin10=PA10 +Mcu.Pin11=PC14-OSC32_IN (OSC32_IN) +Mcu.Pin12=PI11 +Mcu.Pin13=PH13 +Mcu.Pin14=PH14 +Mcu.Pin15=PA9 +Mcu.Pin16=PC15-OSC32_OUT (OSC32_OUT) +Mcu.Pin17=PC9 +Mcu.Pin18=PH0-OSC_IN (PH0) +Mcu.Pin19=PC8 +Mcu.Pin2=PG14 +Mcu.Pin20=PC7 +Mcu.Pin21=PH1-OSC_OUT (PH1) +Mcu.Pin22=PH4 +Mcu.Pin23=PC6 +Mcu.Pin24=PF3 +Mcu.Pin25=PG6 +Mcu.Pin26=PF7 +Mcu.Pin27=PF8 +Mcu.Pin28=PC0 +Mcu.Pin29=PC1 +Mcu.Pin3=PG13 +Mcu.Pin30=PB2 +Mcu.Pin31=PH9 +Mcu.Pin32=PD13 +Mcu.Pin33=PA1 +Mcu.Pin34=PA4 +Mcu.Pin35=PC4 +Mcu.Pin36=PH7 +Mcu.Pin37=PD12 +Mcu.Pin38=PD11 +Mcu.Pin39=PA2 +Mcu.Pin4=PC12 +Mcu.Pin40=PA5 +Mcu.Pin41=PC5 +Mcu.Pin42=PF12 +Mcu.Pin43=PB12 +Mcu.Pin44=PB13 +Mcu.Pin45=PA3 +Mcu.Pin46=PA7 +Mcu.Pin47=PB1 +Mcu.Pin48=PB0 +Mcu.Pin49=PB10 +Mcu.Pin5=PB9 +Mcu.Pin50=PB11 +Mcu.Pin51=PB14 +Mcu.Pin52=VP_CRC_VS_CRC +Mcu.Pin53=VP_RNG_VS_RNG +Mcu.Pin54=VP_SYS_VS_Systick +Mcu.Pin55=VP_TIM12_VS_ControllerModeReset +Mcu.Pin6=PG11 +Mcu.Pin7=PC11 +Mcu.Pin8=PC10 +Mcu.Pin9=PD2 +Mcu.PinsNb=56 Mcu.ThirdPartyNb=0 Mcu.UserConstants= Mcu.UserName=STM32H750IBKx @@ -79,9 +92,11 @@ MxCube.Version=5.3.0 MxDb.Version=DB.5.0.30 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.ForceEnableDMAVector=true NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.OTG_HS_IRQn=true\:0\:0\:false\:false\:true\:true\:true NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false @@ -94,20 +109,40 @@ PA10.Mode=Asynchronous PA10.Signal=USART1_RX PA2.Mode=RMII PA2.Signal=ETH_MDIO +PA3.Mode=Device_HS +PA3.Signal=USB_OTG_HS_ULPI_D0 PA4.Signal=COMP_DAC11_group +PA5.Mode=Device_HS +PA5.Signal=USB_OTG_HS_ULPI_CK PA7.Mode=RMII PA7.Signal=ETH_CRS_DV PA9.Locked=true PA9.Mode=Asynchronous PA9.Signal=USART1_TX +PB0.Mode=Device_HS +PB0.Signal=USB_OTG_HS_ULPI_D1 +PB1.Mode=Device_HS +PB1.Signal=USB_OTG_HS_ULPI_D2 +PB10.Mode=Device_HS +PB10.Signal=USB_OTG_HS_ULPI_D3 +PB11.Mode=Device_HS +PB11.Signal=USB_OTG_HS_ULPI_D4 +PB12.Mode=Device_HS +PB12.Signal=USB_OTG_HS_ULPI_D5 +PB13.Mode=Device_HS +PB13.Signal=USB_OTG_HS_ULPI_D6 PB14.Signal=S_TIM12_CH1 PB2.Locked=true PB2.Mode=Single Bank 1 PB2.Signal=QUADSPI_CLK +PB5.Mode=Device_HS +PB5.Signal=USB_OTG_HS_ULPI_D7 PB8.Mode=mmc_8_bits_Wide_bus PB8.Signal=SDMMC1_D4 PB9.Mode=mmc_8_bits_Wide_bus PB9.Signal=SDMMC1_D5 +PC0.Mode=Device_HS +PC0.Signal=USB_OTG_HS_ULPI_STP PC1.Mode=RMII PC1.Signal=ETH_MDC PC10.Mode=mmc_8_bits_Wide_bus @@ -180,12 +215,16 @@ PH13.Signal=UART4_TX PH14.Locked=true PH14.Mode=Asynchronous PH14.Signal=UART4_RX +PH4.Mode=Device_HS +PH4.Signal=USB_OTG_HS_ULPI_NXT PH7.Locked=true PH7.Signal=SPI5_MISO PH9.Signal=S_TIM12_CH2 +PI11.Mode=Device_HS +PI11.Signal=USB_OTG_HS_ULPI_DIR PinOutPanel.CurrentBGAView=Top PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true +ProjectManager.AskForMigrate=false ProjectManager.BackupPrevious=false ProjectManager.CompilerOptimize=6 ProjectManager.ComputerToolchain=false @@ -211,7 +250,7 @@ ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=MDK-ARM V5 ProjectManager.ToolChainLocation= ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_CRC_Init-CRC-false-HAL-true,5-MX_RNG_Init-RNG-false-HAL-true,6-MX_ADC3_Init-ADC3-false-HAL-true,7-MX_DAC1_Init-DAC1-false-HAL-true,8-MX_ETH_Init-ETH-false-HAL-true,9-MX_QUADSPI_Init-QUADSPI-false-HAL-true,10-MX_SDMMC1_MMC_Init-SDMMC1-false-HAL-true,11-MX_SPI5_Init-SPI5-false-HAL-true,12-MX_UART4_Init-UART4-false-HAL-true +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_CRC_Init-CRC-false-HAL-true,5-MX_RNG_Init-RNG-false-HAL-true,6-MX_ADC3_Init-ADC3-false-HAL-true,7-MX_DAC1_Init-DAC1-false-HAL-true,8-MX_ETH_Init-ETH-false-HAL-true,9-MX_QUADSPI_Init-QUADSPI-false-HAL-true,10-MX_SDMMC1_MMC_Init-SDMMC1-false-HAL-true,11-MX_UART4_Init-UART4-false-HAL-true,12-MX_TIM12_Init-TIM12-false-HAL-true,13-MX_USB_OTG_HS_PCD_Init-USB_OTG_HS-false-HAL-true RCC.ADCFreq_Value=480000000 RCC.AHB12Freq_Value=200000000 RCC.AHB4Freq_Value=200000000 @@ -302,6 +341,8 @@ TIM12.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2 TIM12.IPParameters=Channel-PWM Generation2 CH2 USART1.IPParameters=VirtualMode-Asynchronous USART1.VirtualMode-Asynchronous=VM_ASYNC +USB_OTG_HS.IPParameters=VirtualMode-Device_HS +USB_OTG_HS.VirtualMode-Device_HS=Device_HS VP_CRC_VS_CRC.Mode=CRC_Activate VP_CRC_VS_CRC.Signal=CRC_VS_CRC VP_RNG_VS_RNG.Mode=RNG_Activate diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_hal_conf.h b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_hal_conf.h index b1d0ce1332..2090218bdb 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_hal_conf.h +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_hal_conf.h @@ -72,7 +72,7 @@ /* #define HAL_IRDA_MODULE_ENABLED */ /* #define HAL_SMARTCARD_MODULE_ENABLED */ /* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED /* #define HAL_HCD_MODULE_ENABLED */ /* #define HAL_DFSDM_MODULE_ENABLED */ /* #define HAL_DSI_MODULE_ENABLED */ diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_it.h b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_it.h index d717e42a8e..909793b709 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_it.h +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Inc/stm32h7xx_it.h @@ -56,6 +56,7 @@ void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); +void OTG_HS_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/main.c b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/main.c index 40c0f4c37f..c4a1d097dd 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/main.c +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/main.c @@ -86,6 +86,8 @@ TIM_HandleTypeDef htim12; UART_HandleTypeDef huart4; UART_HandleTypeDef huart1; +PCD_HandleTypeDef hpcd_USB_OTG_HS; + /* USER CODE BEGIN PV */ /* USER CODE END PV */ @@ -103,6 +105,7 @@ static void MX_QUADSPI_Init(void); static void MX_SDMMC1_MMC_Init(void); static void MX_UART4_Init(void); static void MX_TIM12_Init(void); +static void MX_USB_OTG_HS_PCD_Init(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ @@ -151,6 +154,7 @@ int main(void) MX_SDMMC1_MMC_Init(); MX_UART4_Init(); MX_TIM12_Init(); + MX_USB_OTG_HS_PCD_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ @@ -670,6 +674,42 @@ static void MX_USART1_UART_Init(void) } +/** + * @brief USB_OTG_HS Initialization Function + * @param None + * @retval None + */ +static void MX_USB_OTG_HS_PCD_Init(void) +{ + + /* USER CODE BEGIN USB_OTG_HS_Init 0 */ + + /* USER CODE END USB_OTG_HS_Init 0 */ + + /* USER CODE BEGIN USB_OTG_HS_Init 1 */ + + /* USER CODE END USB_OTG_HS_Init 1 */ + hpcd_USB_OTG_HS.Instance = USB_OTG_HS; + hpcd_USB_OTG_HS.Init.dev_endpoints = 9; + hpcd_USB_OTG_HS.Init.speed = PCD_SPEED_HIGH; + hpcd_USB_OTG_HS.Init.dma_enable = DISABLE; + hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_ULPI_PHY; + hpcd_USB_OTG_HS.Init.Sof_enable = DISABLE; + hpcd_USB_OTG_HS.Init.low_power_enable = DISABLE; + hpcd_USB_OTG_HS.Init.lpm_enable = DISABLE; + hpcd_USB_OTG_HS.Init.vbus_sensing_enable = DISABLE; + hpcd_USB_OTG_HS.Init.use_dedicated_ep1 = DISABLE; + hpcd_USB_OTG_HS.Init.use_external_vbus = DISABLE; + if (HAL_PCD_Init(&hpcd_USB_OTG_HS) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN USB_OTG_HS_Init 2 */ + + /* USER CODE END USB_OTG_HS_Init 2 */ + +} + /** * @brief GPIO Initialization Function * @param None @@ -685,6 +725,7 @@ static void MX_GPIO_Init(void) __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOI_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOF_CLK_ENABLE(); diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_hal_msp.c b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_hal_msp.c index 2770e0c2de..f10d9d71fe 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_hal_msp.c +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_hal_msp.c @@ -798,6 +798,140 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) } +/** +* @brief PCD MSP Initialization +* This function configures the hardware resources used in this example +* @param hpcd: PCD handle pointer +* @retval None +*/ +void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(hpcd->Instance==USB_OTG_HS) + { + /* USER CODE BEGIN USB_OTG_HS_MspInit 0 */ + + /* USER CODE END USB_OTG_HS_MspInit 0 */ + + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOI_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**USB_OTG_HS GPIO Configuration + PB5 ------> USB_OTG_HS_ULPI_D7 + PI11 ------> USB_OTG_HS_ULPI_DIR + PH4 ------> USB_OTG_HS_ULPI_NXT + PC0 ------> USB_OTG_HS_ULPI_STP + PA5 ------> USB_OTG_HS_ULPI_CK + PB12 ------> USB_OTG_HS_ULPI_D5 + PB13 ------> USB_OTG_HS_ULPI_D6 + PA3 ------> USB_OTG_HS_ULPI_D0 + PB1 ------> USB_OTG_HS_ULPI_D2 + PB0 ------> USB_OTG_HS_ULPI_D1 + PB10 ------> USB_OTG_HS_ULPI_D3 + PB11 ------> USB_OTG_HS_ULPI_D4 + */ + GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_1 + |GPIO_PIN_0|GPIO_PIN_10|GPIO_PIN_11; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_11; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; + HAL_GPIO_Init(GPIOI, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_4; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; + HAL_GPIO_Init(GPIOH, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_0; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* Peripheral clock enable */ + __HAL_RCC_USB_OTG_HS_CLK_ENABLE(); + __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE(); + /* USB_OTG_HS interrupt Init */ + HAL_NVIC_SetPriority(OTG_HS_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(OTG_HS_IRQn); + /* USER CODE BEGIN USB_OTG_HS_MspInit 1 */ + + /* USER CODE END USB_OTG_HS_MspInit 1 */ + } + +} + +/** +* @brief PCD MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param hpcd: PCD handle pointer +* @retval None +*/ +void HAL_PCD_MspDeInit(PCD_HandleTypeDef* hpcd) +{ + if(hpcd->Instance==USB_OTG_HS) + { + /* USER CODE BEGIN USB_OTG_HS_MspDeInit 0 */ + + /* USER CODE END USB_OTG_HS_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_USB_OTG_HS_CLK_DISABLE(); + __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE(); + + /**USB_OTG_HS GPIO Configuration + PB5 ------> USB_OTG_HS_ULPI_D7 + PI11 ------> USB_OTG_HS_ULPI_DIR + PH4 ------> USB_OTG_HS_ULPI_NXT + PC0 ------> USB_OTG_HS_ULPI_STP + PA5 ------> USB_OTG_HS_ULPI_CK + PB12 ------> USB_OTG_HS_ULPI_D5 + PB13 ------> USB_OTG_HS_ULPI_D6 + PA3 ------> USB_OTG_HS_ULPI_D0 + PB1 ------> USB_OTG_HS_ULPI_D2 + PB0 ------> USB_OTG_HS_ULPI_D1 + PB10 ------> USB_OTG_HS_ULPI_D3 + PB11 ------> USB_OTG_HS_ULPI_D4 + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_5|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_1 + |GPIO_PIN_0|GPIO_PIN_10|GPIO_PIN_11); + + HAL_GPIO_DeInit(GPIOI, GPIO_PIN_11); + + HAL_GPIO_DeInit(GPIOH, GPIO_PIN_4); + + HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0); + + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_3); + + /* USB_OTG_HS interrupt DeInit */ + HAL_NVIC_DisableIRQ(OTG_HS_IRQn); + /* USER CODE BEGIN USB_OTG_HS_MspDeInit 1 */ + + /* USER CODE END USB_OTG_HS_MspDeInit 1 */ + } + +} + /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_it.c b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_it.c index 4314c1a84b..a46865b805 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_it.c +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/CubeMX_Config/Src/stm32h7xx_it.c @@ -56,7 +56,7 @@ /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ - +extern PCD_HandleTypeDef hpcd_USB_OTG_HS; /* USER CODE BEGIN EV */ /* USER CODE END EV */ @@ -197,6 +197,20 @@ void SysTick_Handler(void) /* please refer to the startup file (startup_stm32h7xx.s). */ /******************************************************************************/ +/** + * @brief This function handles USB On The Go HS global interrupt. + */ +void OTG_HS_IRQHandler(void) +{ + /* USER CODE BEGIN OTG_HS_IRQn 0 */ + + /* USER CODE END OTG_HS_IRQn 0 */ + HAL_PCD_IRQHandler(&hpcd_USB_OTG_HS); + /* USER CODE BEGIN OTG_HS_IRQn 1 */ + + /* USER CODE END OTG_HS_IRQn 1 */ +} + /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/Kconfig b/bsp/stm32/stm32h750-armfly-h7-tool/board/Kconfig index 2ce54676f7..0f3d798f71 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/Kconfig +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/Kconfig @@ -128,6 +128,14 @@ menu "On-chip Peripheral Drivers" select RT_USING_DFS default n + config BSP_USING_USBD + bool "Enable OTGHS as USB device" + select RT_USING_USB_DEVICE + select BSP_USBD_TYPE_HS + select BSP_USBD_SPEED_HS + select BSP_USBD_PHY_ULPI + default n + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/board/SConscript b/bsp/stm32/stm32h750-armfly-h7-tool/board/SConscript index 4b57c96e8f..20c211147f 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/board/SConscript +++ b/bsp/stm32/stm32h750-armfly-h7-tool/board/SConscript @@ -9,23 +9,10 @@ src += Glob('CubeMX_Config/Src/stm32h7xx_hal_msp.c') if GetDepend(['BSP_USING_QSPI_FLASH']): src += Glob('ports/drv_qspi_flash.c') - + if GetDepend('BSP_USING_SPI_LCD'): src = src + ['ports/drv_lcd.c'] -if GetDepend(['BSP_USING_SDCARD']): - src += Glob('ports/sdcard_port.c') - -if GetDepend(['BSP_USING_ICM20608']) or GetDepend(['BSP_USING_AHT10']): - src += Glob('ports/sensor_port.c') - -if GetDepend(['BSP_USING_AUDIO']): - src += Glob('ports/audio/drv_es8388.c') - src += Glob('ports/audio/drv_sound.c') - -if GetDepend(['BSP_USING_AUDIO_RECORD']): - src += Glob('ports/audio/drv_mic.c') - path = [cwd] path += [cwd + '/CubeMX_Config/Inc'] From 66be48ddafdaee2dc14988d495b8165edc365a3c Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Sun, 27 Oct 2019 21:32:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[bsp][stm32]=20Add=20USBFS=20for=20F412-Nuc?= =?UTF-8?q?leo.|=E4=B8=BA=20F412-Nucleo=20=E6=B7=BB=E5=8A=A0=20USBFS?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../board/CubeMX_Config/.mxproject | 9 ++++---- .../board/CubeMX_Config/CubeMX_Config.ioc | 22 +++++++++---------- .../board/CubeMX_Config/Inc/stm32f4xx_it.h | 1 + .../board/CubeMX_Config/Src/main.c | 6 ++--- .../CubeMX_Config/Src/stm32f4xx_hal_msp.c | 15 +++++-------- .../board/CubeMX_Config/Src/stm32f4xx_it.c | 15 +++++++++++++ bsp/stm32/stm32f412-st-nucleo/board/Kconfig | 6 +++++ 7 files changed, 47 insertions(+), 27 deletions(-) diff --git a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/.mxproject b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/.mxproject index b011f83e66..e5a9a48a18 100644 --- a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/.mxproject +++ b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/.mxproject @@ -1,17 +1,18 @@ [PreviousGenFiles] -HeaderPath=E:/rt-thread-work/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Inc +HeaderPath=D:/work/rt-thread-me/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Inc HeaderFiles=stm32f4xx_it.h;stm32f4xx_hal_conf.h;main.h; -SourcePath=E:/rt-thread-work/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src +SourcePath=D:/work/rt-thread-me/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src SourceFiles=stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c; [PreviousLibFiles] -LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f412zx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h; +LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f412zx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h; [PreviousUsedIarFiles] SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;null; HeaderPath=..\Drivers\STM32F4xx_HAL_Driver\Inc;..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F4xx\Include;..\Drivers\CMSIS\Include;..\Inc; [PreviousUsedKeilFiles] -SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;null; +SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;..\\Src/system_stm32f4xx.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;..\\Src/system_stm32f4xx.c;..\Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;; HeaderPath=..\Drivers\STM32F4xx_HAL_Driver\Inc;..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F4xx\Include;..\Drivers\CMSIS\Include;..\Inc; +CDefines=USE_HAL_DRIVER;STM32F412Zx;USE_HAL_DRIVER;USE_HAL_DRIVER; diff --git a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc index aaf70612f1..8cf3cdc703 100644 --- a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc +++ b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc @@ -37,16 +37,18 @@ Mcu.UserConstants= Mcu.UserName=STM32F412ZGTx MxCube.Version=5.0.0 MxDb.Version=DB.5.0.0 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.ForceEnableDMAVector=true +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.OTG_FS_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false PA10.GPIOParameters=GPIO_Label PA10.GPIO_Label=USB_ID PA10.Locked=true @@ -74,12 +76,10 @@ PA14.Signal=SYS_JTCK-SWCLK PA8.GPIOParameters=GPIO_Label PA8.GPIO_Label=USB_SOF [TP1] PA8.Locked=true -PA8.Mode=Activate_SOF_FS PA8.Signal=USB_OTG_FS_SOF PA9.GPIOParameters=GPIO_Label PA9.GPIO_Label=USB_VBUS PA9.Locked=true -PA9.Mode=Activate_VBUS PA9.Signal=USB_OTG_FS_VBUS PB14.GPIOParameters=GPIO_Label PB14.GPIO_Label=LD3 [Red] diff --git a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_it.h b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_it.h index 7a788c296b..6774245daa 100644 --- a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_it.h +++ b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Inc/stm32f4xx_it.h @@ -71,6 +71,7 @@ void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); +void OTG_FS_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ diff --git a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/main.c b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/main.c index a4a5778d23..5db22b0cc4 100644 --- a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/main.c +++ b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/main.c @@ -233,11 +233,11 @@ static void MX_USB_OTG_FS_PCD_Init(void) hpcd_USB_OTG_FS.Init.dma_enable = DISABLE; hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_64; hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED; - hpcd_USB_OTG_FS.Init.Sof_enable = ENABLE; + hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE; hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE; hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE; - hpcd_USB_OTG_FS.Init.battery_charging_enable = ENABLE; - hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE; + hpcd_USB_OTG_FS.Init.battery_charging_enable = DISABLE; + hpcd_USB_OTG_FS.Init.vbus_sensing_enable = DISABLE; hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE; if (HAL_PCD_Init(&hpcd_USB_OTG_FS) != HAL_OK) { diff --git a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c index 2ffd0b8ed5..eeccb4e8e6 100644 --- a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c +++ b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c @@ -184,7 +184,6 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd) __HAL_RCC_GPIOA_CLK_ENABLE(); /**USB_OTG_FS GPIO Configuration PA8 ------> USB_OTG_FS_SOF - PA9 ------> USB_OTG_FS_VBUS PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM PA12 ------> USB_OTG_FS_DP @@ -196,13 +195,11 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd) GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - GPIO_InitStruct.Pin = USB_VBUS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(USB_VBUS_GPIO_Port, &GPIO_InitStruct); - /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); + /* USB_OTG_FS interrupt Init */ + HAL_NVIC_SetPriority(OTG_FS_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(OTG_FS_IRQn); /* USER CODE BEGIN USB_OTG_FS_MspInit 1 */ /* USER CODE END USB_OTG_FS_MspInit 1 */ @@ -230,14 +227,14 @@ void HAL_PCD_MspDeInit(PCD_HandleTypeDef* hpcd) /**USB_OTG_FS GPIO Configuration PA8 ------> USB_OTG_FS_SOF - PA9 ------> USB_OTG_FS_VBUS PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM PA12 ------> USB_OTG_FS_DP */ - HAL_GPIO_DeInit(GPIOA, USB_SOF_Pin|USB_VBUS_Pin|USB_ID_Pin|USB_DM_Pin - |USB_DP_Pin); + HAL_GPIO_DeInit(GPIOA, USB_SOF_Pin|USB_ID_Pin|USB_DM_Pin|USB_DP_Pin); + /* USB_OTG_FS interrupt DeInit */ + HAL_NVIC_DisableIRQ(OTG_FS_IRQn); /* USER CODE BEGIN USB_OTG_FS_MspDeInit 1 */ /* USER CODE END USB_OTG_FS_MspDeInit 1 */ diff --git a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_it.c b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_it.c index 5973f7fddb..2fb336776c 100644 --- a/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_it.c +++ b/bsp/stm32/stm32f412-st-nucleo/board/CubeMX_Config/Src/stm32f4xx_it.c @@ -71,6 +71,7 @@ /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ +extern PCD_HandleTypeDef hpcd_USB_OTG_FS; /* USER CODE BEGIN EV */ /* USER CODE END EV */ @@ -211,6 +212,20 @@ void SysTick_Handler(void) /* please refer to the startup file (startup_stm32f4xx.s). */ /******************************************************************************/ +/** + * @brief This function handles USB On The Go FS global interrupt. + */ +void OTG_FS_IRQHandler(void) +{ + /* USER CODE BEGIN OTG_FS_IRQn 0 */ + + /* USER CODE END OTG_FS_IRQn 0 */ + HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS); + /* USER CODE BEGIN OTG_FS_IRQn 1 */ + + /* USER CODE END OTG_FS_IRQn 1 */ +} + /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/bsp/stm32/stm32f412-st-nucleo/board/Kconfig b/bsp/stm32/stm32f412-st-nucleo/board/Kconfig index 48b789dd3a..8eef04ab94 100644 --- a/bsp/stm32/stm32f412-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f412-st-nucleo/board/Kconfig @@ -51,6 +51,12 @@ menu "On-chip Peripheral Drivers" bool "Enable on-chip FLASH" default n + config BSP_USING_USBD + bool "Enable OTGFS as USB device" + select RT_USING_USB_DEVICE + select BSP_USBD_TYPE_FS + default n + endmenu menu "Board extended module Drivers"