diff options
author | Dmitry Filimonchuk <dmitrystu@gmail.com> | 2021-11-05 22:59:24 +0300 |
---|---|---|
committer | Dmitry Filimonchuk <dmitrystu@gmail.com> | 2021-11-08 15:39:43 +0300 |
commit | 9a82199f2c925fa9387f018a1db21302a4b96234 (patch) | |
tree | f312cbfba48d7e014c04365343de6ffeeebac115 | |
parent | 75c581119b99c86d302e612fad78b65f492f27eb (diff) |
Add F411E demo, macro fixes
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | demo/cdc_loop.c | 2 | ||||
-rw-r--r-- | src/usbd_stm32f429_otghs.c | 7 | ||||
-rw-r--r-- | src/usbd_stm32f446_otgfs.c | 2 |
4 files changed, 13 insertions, 7 deletions
@@ -279,10 +279,15 @@ stm32f042f6: clean LDSCRIPT='demo/stm32f042x6.ld' \ DEFINES='STM32F0 STM32F042x6 USBD_SOF_DISABLED' \ CFLAGS='-mcpu=cortex-m0 -DUSBD_PINS_REMAP' - + stm32wb55xg: clean @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb55xx_cm4.s' \ LDSCRIPT='demo/stm32wb55xg.ld' \ DEFINES='STM32WB STM32WB55xx USBD_SOF_DISABLED' \ CFLAGS='-mcpu=cortex-m4' - + +stm32f411xe stm32f411e-disco: clean + @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f411xe.s' \ + LDSCRIPT='demo/stm32f401xe.ld' \ + DEFINES='STM32F4 STM32F411xE USBD_SOF_DISABLED' \ + CFLAGS='-mcpu=cortex-m4' diff --git a/demo/cdc_loop.c b/demo/cdc_loop.c index b257640..c0e3a6d 100644 --- a/demo/cdc_loop.c +++ b/demo/cdc_loop.c @@ -488,7 +488,7 @@ static void cdc_init_usbd(void) { #define __WFI __NOP #elif defined(STM32L476xx) || defined(STM32F429xx) || \ defined(STM32F105xC) || defined(STM32F107xC) || \ - defined(STM32F446xx) + defined(STM32F446xx) || defined(STM32F411xE) #define USB_HANDLER OTG_FS_IRQHandler #define USB_NVIC_IRQ OTG_FS_IRQn #elif defined(STM32F103x6) diff --git a/src/usbd_stm32f429_otghs.c b/src/usbd_stm32f429_otghs.c index edab38f..ba21948 100644 --- a/src/usbd_stm32f429_otghs.c +++ b/src/usbd_stm32f429_otghs.c @@ -354,9 +354,10 @@ static int32_t ep_write(uint8_t ep, void *buf, uint16_t blen) { } _BMD(epi->DIEPTSIZ, USB_OTG_DIEPTSIZ_PKTCNT | USB_OTG_DIEPTSIZ_MULCNT | USB_OTG_DIEPTSIZ_XFRSIZ, - _VAL2FLD(USB_OTG_DIEPTSIZ_PKTCNT, 1) | _VAL2FLD(USB_OTG_DIEPTSIZ_MULCNT, 1 ) | _VAL2FLD(USB_OTG_DIEPTSIZ_XFRSIZ, blen)); - _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DOEPCTL_CNAK); - _BST(epi->DIEPCTL, USB_OTG_DOEPCTL_EPENA); + _VAL2FLD(USB_OTG_DIEPTSIZ_PKTCNT, 1) | _VAL2FLD(USB_OTG_DIEPTSIZ_MULCNT, 1 ) | + _VAL2FLD(USB_OTG_DIEPTSIZ_XFRSIZ, blen)); + _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DIEPCTL_CNAK); + _BST(epi->DIEPCTL, USB_OTG_DIEPCTL_EPENA); /* push data to FIFO */ tmp = 0; for (int idx = 0; idx < blen; idx++) { diff --git a/src/usbd_stm32f446_otgfs.c b/src/usbd_stm32f446_otgfs.c index 93cb2c3..7ffeb4f 100644 --- a/src/usbd_stm32f446_otgfs.c +++ b/src/usbd_stm32f446_otgfs.c @@ -345,7 +345,7 @@ static int32_t ep_write(uint8_t ep, void *buf, uint16_t blen) { } epi->DIEPTSIZ = 0; epi->DIEPTSIZ = (1 << 19) + blen; - _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_CNAK); + _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DIEPCTL_EPENA | USB_OTG_DIEPCTL_CNAK); /* push data to FIFO */ tmp = 0; for (int idx = 0; idx < blen; idx++) { |