Fix of the OTG FS HOST for nucleo-h743zi
This commit is contained in:
parent
d068713738
commit
c9e40ede2d
|
@ -5482,7 +5482,7 @@ FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller)
|
|||
/* Enable VDD33USB supply level detector */
|
||||
|
||||
regval |= STM32_PWR_CR3_USB33DEN;
|
||||
stm32_putreg(regval, STM32_PWR_CR3);
|
||||
stm32_putreg( STM32_PWR_CR3, regval );
|
||||
|
||||
while ((stm32_getreg(STM32_PWR_CR3) & STM32_PWR_CR3_USB33RDY) == 0)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -44,6 +44,20 @@
|
|||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
#define HAVE_USBHOST 1
|
||||
#define CONFIG_USBMONITOR 1
|
||||
|
||||
#ifdef CONFIG_USBMONITOR
|
||||
#include <nuttx/usb/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_OTGFS
|
||||
#include "stm32_usbhost.h"
|
||||
#include "stm32_usb.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "nucleo-h743zi.h"
|
||||
|
||||
#ifdef CONFIG_BUTTONS
|
||||
|
@ -222,6 +236,35 @@ int stm32_bringup(void)
|
|||
}
|
||||
#endif /* CONFIG_BUTTONS */
|
||||
|
||||
|
||||
#ifdef HAVE_USBHOST
|
||||
|
||||
/* Initialize USB host operation. stm32_usbhost_initialize() starts a thread
|
||||
* will monitor for USB connection and disconnection events.
|
||||
*/
|
||||
|
||||
ret = stm32_usbhost_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to initialize USB host: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to start USB monitor: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_ADC
|
||||
/* Initialize ADC and register the ADC driver. */
|
||||
|
||||
|
|
|
@ -273,9 +273,9 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
|
|||
{
|
||||
DEBUGASSERT(iface == 0);
|
||||
|
||||
/* Set the Power Switch by driving the active low enable pin */
|
||||
/* Set the Power Switch by driving the active high enable pin */
|
||||
|
||||
stm32_gpiowrite(GPIO_OTGFS_PWRON, !enable);
|
||||
stm32_gpiowrite(GPIO_OTGFS_PWRON, enable);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue