1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
19358: sys/usbus/cdc/ecm: fix High-Speed mode r=dylad a=gschorcht

### Contribution description

This PR provides some changes to fix the USBUS CDC ECM interface in High-Speed mode.

In High-Speed mode, the EP data size has to be at least 512 bytes instead of 64 Byte in Full-Speed mode. To be able to define configurations like EP data sizes depending on whether Full-Speed or High-Speed USB device peripherals are used, the feature `periph_usbdev_hs`/`HAD_PERIPH_USBDEV_HS` is introduced.

### Testing procedure

Use `tests/usbus_cdc_ecm`  and any board with USB HS connector, for example:
```
USEMODULE=periph_usbdev_hs_utmi BOARD=stm32f723e-disco make -j8 -C tests/usbus_cdc_ecm flash
```
`ping` command works with this PR but doesn't work without this PR.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
This commit is contained in:
bors[bot] 2023-03-07 20:17:01 +00:00 committed by GitHub
commit 6c1de71606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 0 deletions

View File

@ -22,6 +22,7 @@ config BOARD_STM32F723E_DISCO
select HAS_PERIPH_UART
select HAS_PERIPH_UART_HW_FC
select HAS_PERIPH_USBDEV
select HAS_PERIPH_USBDEV_HS
select HAS_PERIPH_USBDEV_HS_UTMI
# Put other features for this board (in alphabetical order)

View File

@ -11,6 +11,7 @@ FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_uart_hw_fc
FEATURES_PROVIDED += periph_usbdev
FEATURES_PROVIDED += periph_usbdev_hs
FEATURES_PROVIDED += periph_usbdev_hs_utmi
# Put other features for this board (in alphabetical order)

View File

@ -23,6 +23,7 @@ config BOARD_STM32F746G_DISCO
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_PERIPH_USBDEV_HS
select HAS_PERIPH_USBDEV_HS_ULPI
select HAS_TINYUSB_DEVICE

View File

@ -9,5 +9,6 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
FEATURES_PROVIDED += periph_usbdev_hs
FEATURES_PROVIDED += periph_usbdev_hs_ulpi
FEATURES_PROVIDED += tinyusb_device

View File

@ -23,6 +23,7 @@ config BOARD_STM32F7508_DK
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_PERIPH_USBDEV_HS
select HAS_PERIPH_USBDEV_HS_ULPI
select HAS_TINYUSB_DEVICE

View File

@ -142,10 +142,16 @@ endif
ifneq (,$(filter periph_usbdev_hs_ulpi,$(USEMODULE)))
FEATURES_REQUIRED += periph_usbdev_hs_ulpi
USEMODULE += periph_usbdev_hs
endif
ifneq (,$(filter periph_usbdev_hs_utmi,$(USEMODULE)))
FEATURES_REQUIRED += periph_usbdev_hs_utmi
USEMODULE += periph_usbdev_hs
endif
ifneq (,$(filter periph_usbdev_hs,$(USEMODULE)))
FEATURES_REQUIRED += periph_usbdev_hs
endif
ifneq (,$(filter pn532_i2c,$(USEMODULE)))

View File

@ -424,6 +424,11 @@ config HAS_PERIPH_USBDEV
help
Indicates that an USBDEV peripheral is present.
config HAS_PERIPH_USBDEV_HS
bool
help
Indicates that the USBDEV peripheral supports High-Speed.
config HAS_PERIPH_USBDEV_HS_UTMI
bool
help

View File

@ -76,7 +76,11 @@ extern "C" {
*
* Used for the transfer of network frames.
*/
#ifndef MODULE_PERIPH_USBDEV_HS
#define USBUS_CDCECM_EP_DATA_SIZE 64
#else
#define USBUS_CDCECM_EP_DATA_SIZE 512
#endif
/**
* @brief Full ethernet frame rounded up to a whole number of transfers