From 4fcd0c4d0d18c6bfb0f610c02ad56a150a354207 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 2 Feb 2018 23:59:40 +0300 Subject: [PATCH] add: add interrupt-based demo for F429 add: add doxygen description for USBD_SOF_OUT preprocessor variable rmv: remove MCO clockout for F429 in cdc_startup.c (was added for debug purposes) upd: update makefile for F429 Github issue #9 --- Makefile | 2 ++ demo/cdc_loop.c | 3 +++ demo/cdc_startup.c | 6 +----- inc/usbd_core.h | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 70dbc0b..860029a 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,8 @@ help all: @echo ' 32l476rg-nucleo' @echo ' stm32l476rg CDC loopback demo for STM32L476xG based boards' @echo ' stm32l052x8 CDC loopback demo for STM32L052x8 based boards' + @echo ' 32f429zi-nucleo' + @echo ' stm32f429xi CDC loopback demo for STM32F429xI based boards' @echo ' doc DOXYGEN documentation' @echo ' module static library module using following envars (defaults)' @echo ' MODULE module name (libusb.a)' diff --git a/demo/cdc_loop.c b/demo/cdc_loop.c index 454a3ff..649659d 100644 --- a/demo/cdc_loop.c +++ b/demo/cdc_loop.c @@ -297,6 +297,9 @@ static void cdc_init_usbd(void) { #elif defined(STM32F103x6) #define USB_HANDLER USB_LP_CAN1_RX0_IRQHandler #define USB_NVIC_IRQ USB_LP_CAN1_RX0_IRQn +#elif defined(STM32F429xx) + #define USB_HANDLER OTG_FS_IRQHandler + #define USB_NVIC_IRQ OTG_FS_IRQn #else #error Not supported #endif diff --git a/demo/cdc_startup.c b/demo/cdc_startup.c index 3cd7270..119777b 100644 --- a/demo/cdc_startup.c +++ b/demo/cdc_startup.c @@ -109,11 +109,7 @@ static void cdc_init_rcc (void) { _BST(RCC->AHB1ENR, RCC_AHB1ENR_GPIOAEN); _BST(GPIOA->AFR[1], (0x0A << 12) | (0x0A << 16)); _BMD(GPIOA->MODER, (0x03 << 22) | (0x03 << 24), (0x02 << 22) | (0x02 << 24)); - - _BST(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - _BMD(GPIOC->MODER, (0x03 << 18), (0x02 << 18)); - _BMD(RCC->CFGR, RCC_CFGR_MCO2, RCC_CFGR_MCO2PRE_2); - +#endif #else #error Not supported #endif diff --git a/inc/usbd_core.h b/inc/usbd_core.h index ccbfd9c..9eacf99 100644 --- a/inc/usbd_core.h +++ b/inc/usbd_core.h @@ -25,9 +25,10 @@ /**\name Compile-time control macros * @{ */ #define USBD_SOF_DISABLED /**<\brief Disables SOF handling.*/ -#define USBD_VBUS_DETECT /**<\brief Enables Vbus detection for V2 driver.*/ +#define USBD_VBUS_DETECT /**<\brief Enables Vbus detection for L4/F4 driver.*/ #define USBD_DP_PORT /**<\brief DP pullup port for F103/F303 driver.*/ #define USBD_DP_PIN /**<\brief DP pullup pin for F103/F303 driver.*/ +#define USBD_SOF_OUT /**<\brief Enables SOF output pin for F4 OTGFS. */ /** @} */ #endif