diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 910922000b..d6c5fcc8b7 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -6828,6 +6828,15 @@ config STM32_OTGFS_SOFINTR ---help--- Enable SOF interrupts. Why would you ever want to do that? +config STM32_OTGFS_VBUS_CONTROL + bool "Enable VBus Control" + default y + depends on USBHOST && STM32_OTGFS + ---help--- + Enable VBus control. Used when the board has VBus sensing and + a power switch for the OTG FS USB port. Disable this config + if the board lacks this USB VBus control circuitry. + endmenu menu "USB HS Host Configuration" diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index bf3bbc8b91..ed31cac037 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -5012,9 +5012,11 @@ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) { uint32_t regval; +#ifdef CONFIG_STM32_OTGFS_VBUS_CONTROL /* Enable/disable the external charge pump */ stm32_usbhost_vbusdrive(0, state); +#endif /* Turn on the Host port power. */ @@ -5280,7 +5282,7 @@ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) /* Deactivate the power down */ regval = (OTGFS_GCCFG_PWRDWN | OTGFS_GCCFG_VBUSASEN | OTGFS_GCCFG_VBUSBSEN); -#ifndef CONFIG_USBDEV_VBUSSENSING +#if !defined(CONFIG_USBDEV_VBUSSENSING) && !defined(CONFIG_STM32_OTGFS_VBUS_CONTROL) regval |= OTGFS_GCCFG_NOVBUSSENS; #endif #ifdef CONFIG_STM32_OTGFS_SOFOUTPUT @@ -5383,7 +5385,9 @@ FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller) stm32_configgpio(GPIO_OTGFS_DM); stm32_configgpio(GPIO_OTGFS_DP); +#ifdef CONFIG_USBDEV stm32_configgpio(GPIO_OTGFS_ID); /* Only needed for OTG */ +#endif /* SOF output pin configuration is configurable */ diff --git a/arch/arm/src/stm32/stm32_usbhost.h b/arch/arm/src/stm32/stm32_usbhost.h index 04a64190be..e4aab465f8 100644 --- a/arch/arm/src/stm32/stm32_usbhost.h +++ b/arch/arm/src/stm32/stm32_usbhost.h @@ -280,7 +280,9 @@ extern "C" * ***********************************************************************************/ +#ifdef CONFIG_STM32_OTGFS_VBUS_CONTROL void stm32_usbhost_vbusdrive(int iface, bool enable); +#endif #undef EXTERN #if defined(__cplusplus) diff --git a/configs/b-l475e-iot01a/README.txt b/configs/b-l475e-iot01a/README.txt index f5a4e1c2f1..5b2ec631f3 100644 --- a/configs/b-l475e-iot01a/README.txt +++ b/configs/b-l475e-iot01a/README.txt @@ -553,6 +553,9 @@ Configuration sub-directories One remaining issue with the above is that when we fail to go to the TX state, there is a lot of warning debug output. ANY debug output while the Spirit is heavily loaded WILL cause failures and packet loss! - Perhaps using a RAMLOG would remedy this. But, even with these debug- - induced failures, all tests are running properly without application - level errors. + Perhaps using a RAMLOG would remedy this. + + The TCP test beats the radio very hard and it is actually heartening + that there are no failures that lead to data loss in this environment. + I would say it is functional but fragile in this usage, but probably + robust in a less busy environment.