You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/08/15 15:49:42 UTC
[mynewt-core] branch master updated (aae5ce9 -> 32df27f)
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.
from aae5ce9 hw/mcu/da1469x: Fix PLL enable procedure
new 0681a31 tinyusb: Make use of USB ID pin
new f04aeab tinyusb: Update VBUS detection for stm32f7
new 32df27f tinyusb: Fix stm32f4 VBUS detection
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
hw/usb/tinyusb/synopsys/src/synopsys.c | 20 ++++++++++++++++++--
hw/usb/tinyusb/synopsys/syscfg.yml | 5 +++++
2 files changed, 23 insertions(+), 2 deletions(-)
[mynewt-core] 03/03: tinyusb: Fix stm32f4 VBUS detection
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 32df27f8b62499164af4e808065faf4b0f9fef6c
Author: Jerzy Kasenberg <je...@apache.org>
AuthorDate: Sat Aug 14 19:54:44 2021 +0200
tinyusb: Fix stm32f4 VBUS detection
VBUS detection A9 pin should be set as input not AF10.
Bit USB_OTG_GCCFG_VBUSASEN was not set instead all others
were which does not make sense.
---
hw/usb/tinyusb/synopsys/src/synopsys.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/usb/tinyusb/synopsys/src/synopsys.c b/hw/usb/tinyusb/synopsys/src/synopsys.c
index 84298f8..6bcaf1e 100755
--- a/hw/usb/tinyusb/synopsys/src/synopsys.c
+++ b/hw/usb/tinyusb/synopsys/src/synopsys.c
@@ -69,8 +69,8 @@ tinyusb_hardware_init(void)
#else
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN;
- USB_OTG_FS->GCCFG |= ~USB_OTG_GCCFG_VBUSASEN;
- hal_gpio_init_af(MCU_GPIO_PORTA(9), GPIO_AF10_OTG_FS, GPIO_NOPULL, GPIO_MODE_AF_PP);
+ USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSASEN;
+ hal_gpio_init_in(MCU_GPIO_PORTA(9), HAL_GPIO_PULL_NONE);
#endif
#elif USB_OTG_GCCFG_VBDEN
#if MYNEWT_VAL(USB_VBUS_DETECTION_ENABLE)
[mynewt-core] 01/03: tinyusb: Make use of USB ID pin
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 0681a31d94a06ca4c612809f3207c9ac658f4dd3
Author: Jerzy Kasenberg <je...@apache.org>
AuthorDate: Sat Aug 14 19:04:50 2021 +0200
tinyusb: Make use of USB ID pin
USB ID pin is a way to change USB role (host/peripheral),
depending on what cable is connected to port.
Now it is possible to enable this instead of forcing
peripheral mode as it used to be.
---
hw/usb/tinyusb/synopsys/src/synopsys.c | 5 +++++
hw/usb/tinyusb/synopsys/syscfg.yml | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/hw/usb/tinyusb/synopsys/src/synopsys.c b/hw/usb/tinyusb/synopsys/src/synopsys.c
index 2300c10..b6b4106 100755
--- a/hw/usb/tinyusb/synopsys/src/synopsys.c
+++ b/hw/usb/tinyusb/synopsys/src/synopsys.c
@@ -52,8 +52,13 @@ tinyusb_hardware_init(void)
* Enable USB OTG clock, force device mode
*/
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
+
+#if MYNEWT_VAL(USB_ID_PIN_ENABLE)
+ hal_gpio_init_af(MCU_GPIO_PORTA(10), GPIO_AF10_OTG_FS, GPIO_PULLUP, GPIO_MODE_AF_OD);
+#else
USB_OTG_FS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
USB_OTG_FS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
+#endif
#ifdef USB_OTG_GCCFG_NOVBUSSENS
#if !MYNEWT_VAL(USB_VBUS_DETECTION_ENABLE)
diff --git a/hw/usb/tinyusb/synopsys/syscfg.yml b/hw/usb/tinyusb/synopsys/syscfg.yml
index 5718df3..d0c265f 100644
--- a/hw/usb/tinyusb/synopsys/syscfg.yml
+++ b/hw/usb/tinyusb/synopsys/syscfg.yml
@@ -31,3 +31,8 @@ syscfg.defs:
description:
Set to 1 when PA9 is connected to detect VBus.
value: 0
+ USB_ID_PIN_ENABLE:
+ description:
+ When set to 1, USB ID pin connected to PA10 is used to select
+ host or device mode.
+ value: 0
[mynewt-core] 02/03: tinyusb: Update VBUS detection for stm32f7
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit f04aeab07417a1a4a24b76670bc6d226c1296226
Author: Jerzy Kasenberg <je...@apache.org>
AuthorDate: Sat Aug 14 19:11:56 2021 +0200
tinyusb: Update VBUS detection for stm32f7
Some register content differs between F4 and F7.
One of the differences is VBUS detection bits in
GOTGCTL and GCCFG.
This adds code for F7 flavour of synopsys module
for VBUS detection.
---
hw/usb/tinyusb/synopsys/src/synopsys.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/usb/tinyusb/synopsys/src/synopsys.c b/hw/usb/tinyusb/synopsys/src/synopsys.c
index b6b4106..84298f8 100755
--- a/hw/usb/tinyusb/synopsys/src/synopsys.c
+++ b/hw/usb/tinyusb/synopsys/src/synopsys.c
@@ -72,5 +72,16 @@ tinyusb_hardware_init(void)
USB_OTG_FS->GCCFG |= ~USB_OTG_GCCFG_VBUSASEN;
hal_gpio_init_af(MCU_GPIO_PORTA(9), GPIO_AF10_OTG_FS, GPIO_NOPULL, GPIO_MODE_AF_PP);
#endif
+#elif USB_OTG_GCCFG_VBDEN
+#if MYNEWT_VAL(USB_VBUS_DETECTION_ENABLE)
+ hal_gpio_init_in(MCU_GPIO_PORTA(9), HAL_GPIO_PULL_NONE);
+ USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
+#else
+ /* PA9- VUSB not used for USB */
+ USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
+ /* B-peripheral session valid override enable */
+ USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
+ USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
+#endif
#endif
}