From 71bebeb3e0fe12e49814176d96c9e87c0bcda565 Mon Sep 17 00:00:00 2001 From: Tomashevskiy Date: Thu, 26 Sep 2024 18:09:10 +0300 Subject: [PATCH] fix previous problemc --- arch/arm/src/stm32h7/Kconfig | 2 +- .../src/stm32h7/hardware/stm32h7x3xx_pinmap.h | 8 +++--- .../stm32h7/weact-stm32h743/include/board.h | 5 ++++ .../stm32h7/weact-stm32h743/src/stm32_usb.c | 26 ------------------- .../weact-stm32h743/src/weact-stm32h743.h | 26 ------------------- 5 files changed, 10 insertions(+), 57 deletions(-) diff --git a/arch/arm/src/stm32h7/Kconfig b/arch/arm/src/stm32h7/Kconfig index 586ed4cb42d93..15ba5312c547e 100644 --- a/arch/arm/src/stm32h7/Kconfig +++ b/arch/arm/src/stm32h7/Kconfig @@ -616,7 +616,7 @@ config STM32H7_HAVE_GPIOF config STM32H7_HAVE_GPIOG bool - default y + default n config STM32H7_HAVE_SPI4 bool diff --git a/arch/arm/src/stm32h7/hardware/stm32h7x3xx_pinmap.h b/arch/arm/src/stm32h7/hardware/stm32h7x3xx_pinmap.h index fe93ae9afaca5..ae0c89d9d0629 100644 --- a/arch/arm/src/stm32h7/hardware/stm32h7x3xx_pinmap.h +++ b/arch/arm/src/stm32h7/hardware/stm32h7x3xx_pinmap.h @@ -728,10 +728,10 @@ /* USB on-the-go full-speed (OTG_FS) */ -#define GPIO_OTGFS_DM (GPIO_ALT|GPIO_AF10|GPIO_PUSHPULL|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN11) -#define GPIO_OTGFS_DP (GPIO_ALT|GPIO_AF10|GPIO_PUSHPULL|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN12) -#define GPIO_OTGFS_ID (GPIO_ALT|GPIO_AF10|GPIO_OPENDRAIN|GPIO_PULLUP|GPIO_PORTA|GPIO_PIN10) -#define GPIO_OTGFS_SOF (GPIO_ALT|GPIO_AF10|GPIO_PUSHPULL|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN8) +#define GPIO_OTGFS_DM_0 (GPIO_ALT|GPIO_AF10|GPIO_PUSHPULL|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN11) +#define GPIO_OTGFS_DP_0 (GPIO_ALT|GPIO_AF10|GPIO_PUSHPULL|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN12) +#define GPIO_OTGFS_ID_0 (GPIO_ALT|GPIO_AF10|GPIO_OPENDRAIN|GPIO_PULLUP|GPIO_PORTA|GPIO_PIN10) +#define GPIO_OTGFS_SOF_0 (GPIO_ALT|GPIO_AF10|GPIO_PUSHPULL|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN8) /* USB on-the-go high-speed (OTG_HS) */ diff --git a/boards/arm/stm32h7/weact-stm32h743/include/board.h b/boards/arm/stm32h7/weact-stm32h743/include/board.h index c8a4e35099639..c4c79eea94010 100644 --- a/boards/arm/stm32h7/weact-stm32h743/include/board.h +++ b/boards/arm/stm32h7/weact-stm32h743/include/board.h @@ -338,6 +338,11 @@ #define GPIO_USART1_RX (GPIO_USART1_RX_1 | GPIO_SPEED_100MHz) /* PB15 */ #define GPIO_USART1_TX (GPIO_USART1_TX_1 | GPIO_SPEED_100MHz) /* PB14 */ +/* OTGFS */ + +#define GPIO_OTGFS_DM (GPIO_OTGFS_DM_0|GPIO_SPEED_100MHz) /* PA11 */ +#define GPIO_OTGFS_DP (GPIO_OTGFS_DP_0|GPIO_SPEED_100MHz) /* PA12 */ +#define GPIO_OTGFS_ID (GPIO_OTGFS_ID_0|GPIO_SPEED_100MHz) /* PA10 */ /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/boards/arm/stm32h7/weact-stm32h743/src/stm32_usb.c b/boards/arm/stm32h7/weact-stm32h743/src/stm32_usb.c index 506754d6075d1..1510040989810 100644 --- a/boards/arm/stm32h7/weact-stm32h743/src/stm32_usb.c +++ b/boards/arm/stm32h7/weact-stm32h743/src/stm32_usb.c @@ -117,32 +117,6 @@ static int usbhost_waiter(int argc, char *argv[]) * Public Functions ****************************************************************************/ -/**************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called from stm32_usbinitialize very early in inialization to setup - * USB-related GPIO pins for the nucleo-144 board. - * - ****************************************************************************/ - -void stm32_usbinitialize(void) -{ - /* The OTG FS has an internal soft pull-up. - * No GPIO configuration is required - */ - - /* Configure the OTG FS VBUS sensing GPIO, - * Power On, and Overcurrent GPIOs - */ - -#ifdef CONFIG_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); -#endif -} - /**************************************************************************** * Name: stm32_usbhost_initialize * diff --git a/boards/arm/stm32h7/weact-stm32h743/src/weact-stm32h743.h b/boards/arm/stm32h7/weact-stm32h743/src/weact-stm32h743.h index 0666d153f1901..da79f743f6f52 100644 --- a/boards/arm/stm32h7/weact-stm32h743/src/weact-stm32h743.h +++ b/boards/arm/stm32h7/weact-stm32h743/src/weact-stm32h743.h @@ -36,12 +36,8 @@ /* Configuration ************************************************************/ -#define HAVE_PROC 0 #define HAVE_USBDEV 1 #define HAVE_USBHOST 1 -#define HAVE_USBMONITOR 0 -#define HAVE_MTDCONFIG 0 -#define HAVE_PROGMEM_CHARDEV 0 /* procfs File System */ @@ -117,28 +113,6 @@ #define GPIO_BTN_USER (GPIO_INPUT | GPIO_FLOAT | GPIO_EXTI | GPIO_PORTC | GPIO_PIN13) -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) - * PG6 OTG_FS_PowerSwitchOn - * PG7 OTG_FS_Overcurrent - */ - -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz| \ - GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -#define GPIO_OTGFS_PWRON (GPIO_OUTPUT|GPIO_FLOAT|GPIO_SPEED_100MHz| \ - GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN6) - -#ifdef CONFIG_USBHOST -# define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_EXTI|GPIO_FLOAT| \ - GPIO_SPEED_100MHz|GPIO_PUSHPULL| \ - GPIO_PORTG|GPIO_PIN7) -#else -# define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz| \ - GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN7) -#endif - /**************************************************************************** * Public Function Prototypes ****************************************************************************/