Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: usb: usb_dc_stm32: does not compile for stm32f3_disco board #21962

Closed
rckTom opened this issue Jan 15, 2020 · 2 comments · Fixed by #21969
Closed

drivers: usb: usb_dc_stm32: does not compile for stm32f3_disco board #21962

rckTom opened this issue Jan 15, 2020 · 2 comments · Fixed by #21969
Assignees
Labels
area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: high High impact/importance bug

Comments

@rckTom
Copy link
Contributor

rckTom commented Jan 15, 2020

Describe the bug
tests/subsys/usb/device (specifically drivers/usb/device/usb_dc_stm32.c) does not compile for stm32f3_disco board. Bisecting the problem leads to commit 7165803 which introduced a new version of the STM32Cube packages.

To Reproduce
Steps to reproduce the behavior:

  1. cd test/usb/subsys/device
  2. west build -b stm32f3_disco

Expected behavior
USB driver should compile for stm32f3_disco board as it has with older versions of STM32Cube.

@rckTom rckTom added the bug The issue is a bug, or the PR is fixing a bug label Jan 15, 2020
@galak galak added priority: high High impact/importance bug area: USB Universal Serial Bus platform: STM32 ST Micro STM32 labels Jan 15, 2020
@galak
Copy link
Collaborator

galak commented Jan 15, 2020

I think this might be the fix, but need @erwango or someone else more familiar with the usb & stm32 code to verify:

diff --git a/drivers/usb/device/Kconfig b/drivers/usb/device/Kconfig
index 7bca8ccc22..40e5a8f695 100644
--- a/drivers/usb/device/Kconfig
+++ b/drivers/usb/device/Kconfig
@@ -30,7 +30,7 @@ config USB_DC_STM32
        bool "USB device controller driver for STM32 devices"
        depends on SOC_FAMILY_STM32
        select USB_DEVICE_DRIVER
-       select USE_STM32_LL_USB if !SOC_SERIES_STM32F0X && !SOC_SERIES_STM32F3X && !SOC_SERIES_STM32L0X
+       select USE_STM32_LL_USB
        select USE_STM32_HAL_PCD
        select USE_STM32_HAL_PCD_EX
        help
diff --git a/drivers/usb/device/usb_dc_stm32.c b/drivers/usb/device/usb_dc_stm32.c
index eb232422da..4e337743d9 100644
--- a/drivers/usb/device/usb_dc_stm32.c
+++ b/drivers/usb/device/usb_dc_stm32.c
@@ -59,20 +59,6 @@ LOG_MODULE_REGISTER(usb_dc_stm32);
 #error "Only one interface should be enabled at a time, OTG FS or OTG HS"
 #endif
 
-/*
- * USB LL API provides the EP_TYPE_* defines. STM32Cube does not
- * provide USB LL API for STM32F0, STM32F3 and STM32L0 families.
- * Map EP_TYPE_* defines to PCD_EP_TYPE_* defines
- */
-#if defined(CONFIG_SOC_SERIES_STM32F3X) || \
-       defined(CONFIG_SOC_SERIES_STM32F0X) || \
-       defined(CONFIG_SOC_SERIES_STM32L0X)
-#define EP_TYPE_CTRL PCD_EP_TYPE_CTRL
-#define EP_TYPE_ISOC PCD_EP_TYPE_ISOC
-#define EP_TYPE_BULK PCD_EP_TYPE_BULK
-#define EP_TYPE_INTR PCD_EP_TYPE_INTR
-#endif
-
 /*
  * USB and USB_OTG_FS are defined in STM32Cube HAL and allows to distinguish
  * between two kind of USB DC. STM32 F0, F3, L0 and G4 series support USB device

@ydamigos
Copy link
Collaborator

@galak Your patch seems reasonable.

erwango added a commit to erwango/zephyr that referenced this issue Jan 16, 2020
Following update of STM32Cube packages for series F0/L0/F3,
a new file ll_usb.h is now available for these series.
As a consequence, specific hanlding is no more requested for this
series is stm32 usb_device driver.

Fixes zephyrproject-rtos#21962

Signed-off-by: Erwan Gouriou <[email protected]>
nashif pushed a commit that referenced this issue Jan 16, 2020
Following update of STM32Cube packages for series F0/L0/F3,
a new file ll_usb.h is now available for these series.
As a consequence, specific hanlding is no more requested for this
series is stm32 usb_device driver.

Fixes #21962

Signed-off-by: Erwan Gouriou <[email protected]>
galak pushed a commit that referenced this issue Jan 16, 2020
Following update of STM32Cube packages for series F0/L0/F3,
a new file ll_usb.h is now available for these series.
As a consequence, specific hanlding is no more requested for this
series is stm32 usb_device driver.

Fixes #21962

Signed-off-by: Erwan Gouriou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: high High impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants