mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 15:50:28 +08:00
[bsp/stm32] add usbcdc for openmv (#5702)
This commit is contained in:
parent
cff34466b0
commit
c4b62a9161
@ -187,6 +187,7 @@ CONFIG_RT_MMCSD_THREAD_PREORITY=22
|
||||
CONFIG_RT_MMCSD_MAX_PARTITION=16
|
||||
# CONFIG_RT_SDIO_DEBUG is not set
|
||||
CONFIG_RT_USING_SPI=y
|
||||
# CONFIG_RT_USING_SPI_BITOPS is not set
|
||||
CONFIG_RT_USING_QSPI=y
|
||||
# CONFIG_RT_USING_SPI_MSD is not set
|
||||
CONFIG_RT_USING_SFUD=y
|
||||
@ -209,9 +210,26 @@ CONFIG_RT_SFUD_SPI_MAX_HZ=50000000
|
||||
#
|
||||
# Using USB
|
||||
#
|
||||
# CONFIG_RT_USING_USB is not set
|
||||
CONFIG_RT_USING_USB=y
|
||||
# CONFIG_RT_USING_USB_HOST is not set
|
||||
# CONFIG_RT_USING_USB_DEVICE is not set
|
||||
CONFIG_RT_USING_USB_DEVICE=y
|
||||
CONFIG_RT_USBD_THREAD_STACK_SZ=4096
|
||||
CONFIG_USB_VENDOR_ID=0x0FFE
|
||||
CONFIG_USB_PRODUCT_ID=0x0001
|
||||
# CONFIG_RT_USB_DEVICE_COMPOSITE is not set
|
||||
# CONFIG__RT_USB_DEVICE_NONE is not set
|
||||
CONFIG__RT_USB_DEVICE_CDC=y
|
||||
# CONFIG__RT_USB_DEVICE_MSTORAGE is not set
|
||||
# CONFIG__RT_USB_DEVICE_HID is not set
|
||||
# CONFIG__RT_USB_DEVICE_WINUSB is not set
|
||||
# CONFIG__RT_USB_DEVICE_AUDIO is not set
|
||||
CONFIG_RT_USB_DEVICE_CDC=y
|
||||
CONFIG_RT_VCOM_TASK_STK_SIZE=512
|
||||
CONFIG_RT_CDC_RX_BUFSIZE=128
|
||||
# CONFIG_RT_VCOM_TX_USE_DMA is not set
|
||||
CONFIG_RT_VCOM_SERNO="32021919830108"
|
||||
CONFIG_RT_VCOM_SER_LEN=14
|
||||
CONFIG_RT_VCOM_TX_TIMEOUT=1000
|
||||
|
||||
#
|
||||
# POSIX layer and C standard library
|
||||
@ -473,6 +491,7 @@ CONFIG_RT_USING_POSIX_FS=y
|
||||
# CONFIG_PKG_USING_SOLAR_TERMS is not set
|
||||
# CONFIG_PKG_USING_GAN_ZHI is not set
|
||||
# CONFIG_PKG_USING_FDT is not set
|
||||
# CONFIG_PKG_USING_CBOX is not set
|
||||
|
||||
#
|
||||
# system packages
|
||||
@ -719,7 +738,7 @@ CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_UART1_RX_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_UART2 is not set
|
||||
# CONFIG_BSP_USING_LPUART1 is not set
|
||||
CONFIG_BSP_USING_QSPI=y
|
||||
# CONFIG_BSP_USING_QSPI is not set
|
||||
# CONFIG_BSP_USING_CRC is not set
|
||||
# CONFIG_BSP_USING_RNG is not set
|
||||
# CONFIG_BSP_USING_UDID is not set
|
||||
@ -730,3 +749,4 @@ CONFIG_BSP_USING_QSPI=y
|
||||
CONFIG_BSP_USING_SDRAM=y
|
||||
# CONFIG_BSP_USING_QSPI_FLASH is not set
|
||||
# CONFIG_BSP_USING_SDMMC is not set
|
||||
# CONFIG_BSP_USING_USBD is not set
|
||||
|
@ -42,6 +42,7 @@ OPENMV4-H7-PLUS 是 OPENMV公司推出的一款针对 STM32H7系列设计的 Cor
|
||||
| SDRAM | 支持 | IS42S32800 BANK1 |
|
||||
| QSPI FLASH | 支持 | W25Q256JV |
|
||||
| SDIO | 支持 | USD-1040310811 |
|
||||
| USBCDC | 支持 | |
|
||||
|
||||
## 使用说明
|
||||
|
||||
@ -99,7 +100,7 @@ msh >
|
||||
|
||||
|
||||
|
||||
5. USBD CDC使用,参考文章[STM32L496 USB CDC适配](https://club.rt-thread.org/ask/article/2959.html)
|
||||
5. USBD CDC使用,参考文章[STM32L496 USB CDC适配](https://club.rt-thread.org/ask/article/2959.html)(bsp已配置引脚和修改Kconfig)
|
||||
|
||||
## 注意事项
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -80,7 +80,7 @@
|
||||
/* #define HAL_IRDA_MODULE_ENABLED */
|
||||
/* #define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
/* #define HAL_WWDG_MODULE_ENABLED */
|
||||
/* #define HAL_PCD_MODULE_ENABLED */
|
||||
#define HAL_PCD_MODULE_ENABLED
|
||||
/* #define HAL_HCD_MODULE_ENABLED */
|
||||
/* #define HAL_DFSDM_MODULE_ENABLED */
|
||||
/* #define HAL_DSI_MODULE_ENABLED */
|
||||
|
@ -56,6 +56,8 @@ void DebugMon_Handler(void);
|
||||
void PendSV_Handler(void);
|
||||
void SysTick_Handler(void);
|
||||
void SDMMC1_IRQHandler(void);
|
||||
void OTG_FS_EP1_OUT_IRQHandler(void);
|
||||
void OTG_FS_EP1_IN_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
@ -46,6 +46,8 @@ SD_HandleTypeDef hsd1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
PCD_HandleTypeDef hpcd_USB_OTG_FS;
|
||||
|
||||
SDRAM_HandleTypeDef hsdram1;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
@ -59,6 +61,7 @@ static void MX_USART1_UART_Init(void);
|
||||
static void MX_FMC_Init(void);
|
||||
static void MX_QUADSPI_Init(void);
|
||||
static void MX_SDMMC1_SD_Init(void);
|
||||
static void MX_USB_OTG_FS_PCD_Init(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
@ -106,6 +109,7 @@ int main(void)
|
||||
MX_FMC_Init();
|
||||
MX_QUADSPI_Init();
|
||||
MX_SDMMC1_SD_Init();
|
||||
MX_USB_OTG_FS_PCD_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* USER CODE END 2 */
|
||||
@ -141,8 +145,9 @@ void SystemClock_Config(void)
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48|RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 3;
|
||||
@ -290,6 +295,42 @@ static void MX_USART1_UART_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief USB_OTG_FS Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_USB_OTG_FS_PCD_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN USB_OTG_FS_Init 0 */
|
||||
|
||||
/* USER CODE END USB_OTG_FS_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN USB_OTG_FS_Init 1 */
|
||||
|
||||
/* USER CODE END USB_OTG_FS_Init 1 */
|
||||
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
|
||||
hpcd_USB_OTG_FS.Init.dev_endpoints = 9;
|
||||
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL;
|
||||
hpcd_USB_OTG_FS.Init.dma_enable = DISABLE;
|
||||
hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
|
||||
hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE;
|
||||
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
|
||||
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
|
||||
hpcd_USB_OTG_FS.Init.battery_charging_enable = DISABLE;
|
||||
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = DISABLE;
|
||||
hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE;
|
||||
if (HAL_PCD_Init(&hpcd_USB_OTG_FS) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN USB_OTG_FS_Init 2 */
|
||||
|
||||
/* USER CODE END USB_OTG_FS_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/* FMC initialization function */
|
||||
static void MX_FMC_Init(void)
|
||||
{
|
||||
@ -351,10 +392,10 @@ static void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOI_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
|
@ -353,6 +353,91 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PCD MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
* @param hpcd: PCD handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
if(hpcd->Instance==USB_OTG_FS)
|
||||
{
|
||||
/* USER CODE BEGIN USB_OTG_FS_MspInit 0 */
|
||||
|
||||
/* USER CODE END USB_OTG_FS_MspInit 0 */
|
||||
/** Initializes the peripherals clock
|
||||
*/
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
|
||||
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Enable USB Voltage detector
|
||||
*/
|
||||
HAL_PWREx_EnableUSBVoltageDetector();
|
||||
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
/**USB_OTG_FS GPIO Configuration
|
||||
PA12 ------> USB_OTG_FS_DP
|
||||
PA11 ------> USB_OTG_FS_DM
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_11;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
|
||||
/* USB_OTG_FS interrupt Init */
|
||||
HAL_NVIC_SetPriority(OTG_FS_EP1_OUT_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(OTG_FS_EP1_OUT_IRQn);
|
||||
HAL_NVIC_SetPriority(OTG_FS_EP1_IN_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(OTG_FS_EP1_IN_IRQn);
|
||||
/* USER CODE BEGIN USB_OTG_FS_MspInit 1 */
|
||||
|
||||
/* USER CODE END USB_OTG_FS_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PCD MSP De-Initialization
|
||||
* This function freeze the hardware resources used in this example
|
||||
* @param hpcd: PCD handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_PCD_MspDeInit(PCD_HandleTypeDef* hpcd)
|
||||
{
|
||||
if(hpcd->Instance==USB_OTG_FS)
|
||||
{
|
||||
/* USER CODE BEGIN USB_OTG_FS_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END USB_OTG_FS_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_USB_OTG_FS_CLK_DISABLE();
|
||||
|
||||
/**USB_OTG_FS GPIO Configuration
|
||||
PA12 ------> USB_OTG_FS_DP
|
||||
PA11 ------> USB_OTG_FS_DM
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_12|GPIO_PIN_11);
|
||||
|
||||
/* USB_OTG_FS interrupt DeInit */
|
||||
HAL_NVIC_DisableIRQ(OTG_FS_EP1_OUT_IRQn);
|
||||
HAL_NVIC_DisableIRQ(OTG_FS_EP1_IN_IRQn);
|
||||
/* USER CODE BEGIN USB_OTG_FS_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END USB_OTG_FS_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static uint32_t FMC_Initialized = 0;
|
||||
|
||||
static void HAL_FMC_MspInit(void){
|
||||
|
@ -28,84 +28,87 @@ Mcu.IP4=RCC
|
||||
Mcu.IP5=SDMMC1
|
||||
Mcu.IP6=SYS
|
||||
Mcu.IP7=USART1
|
||||
Mcu.IPNb=8
|
||||
Mcu.IP8=USB_OTG_FS
|
||||
Mcu.IPNb=9
|
||||
Mcu.Name=STM32H743IIKx
|
||||
Mcu.Package=UFBGA176
|
||||
Mcu.Pin0=PE1
|
||||
Mcu.Pin1=PE0
|
||||
Mcu.Pin10=PD1
|
||||
Mcu.Pin11=PI3
|
||||
Mcu.Pin12=PI2
|
||||
Mcu.Pin13=PI9
|
||||
Mcu.Pin14=PI4
|
||||
Mcu.Pin15=PD2
|
||||
Mcu.Pin16=PH15
|
||||
Mcu.Pin17=PI1
|
||||
Mcu.Pin18=PF0
|
||||
Mcu.Pin19=PI10
|
||||
Mcu.Pin10=PI5
|
||||
Mcu.Pin11=PD1
|
||||
Mcu.Pin12=PI3
|
||||
Mcu.Pin13=PI2
|
||||
Mcu.Pin14=PA11
|
||||
Mcu.Pin15=PI9
|
||||
Mcu.Pin16=PI4
|
||||
Mcu.Pin17=PD2
|
||||
Mcu.Pin18=PH15
|
||||
Mcu.Pin19=PI1
|
||||
Mcu.Pin2=PC12
|
||||
Mcu.Pin20=PH13
|
||||
Mcu.Pin21=PH14
|
||||
Mcu.Pin22=PI0
|
||||
Mcu.Pin23=PC9
|
||||
Mcu.Pin24=PH0-OSC_IN (PH0)
|
||||
Mcu.Pin25=PC8
|
||||
Mcu.Pin26=PH1-OSC_OUT (PH1)
|
||||
Mcu.Pin27=PF2
|
||||
Mcu.Pin28=PF1
|
||||
Mcu.Pin29=PG8
|
||||
Mcu.Pin20=PF0
|
||||
Mcu.Pin21=PI10
|
||||
Mcu.Pin22=PH13
|
||||
Mcu.Pin23=PH14
|
||||
Mcu.Pin24=PI0
|
||||
Mcu.Pin25=PC9
|
||||
Mcu.Pin26=PH0-OSC_IN (PH0)
|
||||
Mcu.Pin27=PC8
|
||||
Mcu.Pin28=PH1-OSC_OUT (PH1)
|
||||
Mcu.Pin29=PF2
|
||||
Mcu.Pin3=PG15
|
||||
Mcu.Pin30=PF3
|
||||
Mcu.Pin31=PF4
|
||||
Mcu.Pin32=PG6
|
||||
Mcu.Pin33=PF7
|
||||
Mcu.Pin34=PF6
|
||||
Mcu.Pin35=PF5
|
||||
Mcu.Pin36=PH12
|
||||
Mcu.Pin37=PG5
|
||||
Mcu.Pin38=PG4
|
||||
Mcu.Pin39=PF10
|
||||
Mcu.Pin30=PF1
|
||||
Mcu.Pin31=PG8
|
||||
Mcu.Pin32=PF3
|
||||
Mcu.Pin33=PF4
|
||||
Mcu.Pin34=PG6
|
||||
Mcu.Pin35=PF7
|
||||
Mcu.Pin36=PF6
|
||||
Mcu.Pin37=PF5
|
||||
Mcu.Pin38=PH12
|
||||
Mcu.Pin39=PG5
|
||||
Mcu.Pin4=PD0
|
||||
Mcu.Pin40=PF9
|
||||
Mcu.Pin41=PF8
|
||||
Mcu.Pin42=PH11
|
||||
Mcu.Pin43=PH10
|
||||
Mcu.Pin44=PD15
|
||||
Mcu.Pin45=PC0
|
||||
Mcu.Pin46=PG1
|
||||
Mcu.Pin47=PH8
|
||||
Mcu.Pin48=PH9
|
||||
Mcu.Pin49=PD14
|
||||
Mcu.Pin40=PG4
|
||||
Mcu.Pin41=PF10
|
||||
Mcu.Pin42=PF9
|
||||
Mcu.Pin43=PF8
|
||||
Mcu.Pin44=PH11
|
||||
Mcu.Pin45=PH10
|
||||
Mcu.Pin46=PD15
|
||||
Mcu.Pin47=PC0
|
||||
Mcu.Pin48=PG1
|
||||
Mcu.Pin49=PH8
|
||||
Mcu.Pin5=PC11
|
||||
Mcu.Pin50=PC4
|
||||
Mcu.Pin51=PF13
|
||||
Mcu.Pin52=PG0
|
||||
Mcu.Pin53=PE13
|
||||
Mcu.Pin54=PD10
|
||||
Mcu.Pin55=PC5
|
||||
Mcu.Pin56=PF12
|
||||
Mcu.Pin57=PF15
|
||||
Mcu.Pin58=PE8
|
||||
Mcu.Pin59=PE9
|
||||
Mcu.Pin50=PH9
|
||||
Mcu.Pin51=PD14
|
||||
Mcu.Pin52=PC4
|
||||
Mcu.Pin53=PF13
|
||||
Mcu.Pin54=PG0
|
||||
Mcu.Pin55=PE13
|
||||
Mcu.Pin56=PD10
|
||||
Mcu.Pin57=PC5
|
||||
Mcu.Pin58=PF12
|
||||
Mcu.Pin59=PF15
|
||||
Mcu.Pin6=PC10
|
||||
Mcu.Pin60=PE11
|
||||
Mcu.Pin61=PE14
|
||||
Mcu.Pin62=PD9
|
||||
Mcu.Pin63=PD8
|
||||
Mcu.Pin64=PA7
|
||||
Mcu.Pin65=PF11
|
||||
Mcu.Pin66=PF14
|
||||
Mcu.Pin67=PE7
|
||||
Mcu.Pin68=PE10
|
||||
Mcu.Pin69=PE12
|
||||
Mcu.Pin7=PI7
|
||||
Mcu.Pin70=PE15
|
||||
Mcu.Pin71=PB14
|
||||
Mcu.Pin72=PB15
|
||||
Mcu.Pin73=VP_SYS_VS_Systick
|
||||
Mcu.Pin8=PI6
|
||||
Mcu.Pin9=PI5
|
||||
Mcu.PinsNb=74
|
||||
Mcu.Pin60=PE8
|
||||
Mcu.Pin61=PE9
|
||||
Mcu.Pin62=PE11
|
||||
Mcu.Pin63=PE14
|
||||
Mcu.Pin64=PD9
|
||||
Mcu.Pin65=PD8
|
||||
Mcu.Pin66=PA7
|
||||
Mcu.Pin67=PF11
|
||||
Mcu.Pin68=PF14
|
||||
Mcu.Pin69=PE7
|
||||
Mcu.Pin7=PA12
|
||||
Mcu.Pin70=PE10
|
||||
Mcu.Pin71=PE12
|
||||
Mcu.Pin72=PE15
|
||||
Mcu.Pin73=PB14
|
||||
Mcu.Pin74=PB15
|
||||
Mcu.Pin75=VP_SYS_VS_Systick
|
||||
Mcu.Pin8=PI7
|
||||
Mcu.Pin9=PI6
|
||||
Mcu.PinsNb=76
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32H743IIKx
|
||||
@ -117,12 +120,22 @@ NVIC.ForceEnableDMAVector=true
|
||||
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
|
||||
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
|
||||
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
|
||||
NVIC.OTG_FS_EP1_IN_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||
NVIC.OTG_FS_EP1_OUT_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
|
||||
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
|
||||
NVIC.SDMMC1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
|
||||
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:true
|
||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
|
||||
PA11.GPIOParameters=GPIO_Speed
|
||||
PA11.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
PA11.Mode=Device_Only
|
||||
PA11.Signal=USB_OTG_FS_DM
|
||||
PA12.GPIOParameters=GPIO_Speed
|
||||
PA12.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
PA12.Mode=Device_Only
|
||||
PA12.Signal=USB_OTG_FS_DP
|
||||
PA7.GPIOParameters=GPIO_PuPd
|
||||
PA7.GPIO_PuPd=GPIO_PULLUP
|
||||
PA7.Locked=true
|
||||
@ -381,7 +394,7 @@ ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=MDK-ARM V5.32
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_FMC_Init-FMC-false-HAL-true,5-MX_QUADSPI_Init-QUADSPI-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_FMC_Init-FMC-false-HAL-true,5-MX_QUADSPI_Init-QUADSPI-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
|
||||
QUADSPI.ChipSelectHighTime=QSPI_CS_HIGH_TIME_2_CYCLE
|
||||
QUADSPI.ClockPrescaler=1
|
||||
QUADSPI.FifoThreshold=3
|
||||
@ -429,7 +442,7 @@ RCC.HRTIMFreq_Value=200000000
|
||||
RCC.HSE_VALUE=12000000
|
||||
RCC.I2C123Freq_Value=100000000
|
||||
RCC.I2C4Freq_Value=100000000
|
||||
RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,D1PPRE,D2PPRE1,D2PPRE2,D3PPRE,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVN1,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,HPRE,HRTIMFreq_Value,HSE_VALUE,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL3FRACN,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI23Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
|
||||
RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,D1PPRE,D2PPRE1,D2PPRE2,D3PPRE,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVN1,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,HPRE,HRTIMFreq_Value,HSE_VALUE,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL3FRACN,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI23Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBCLockSelection,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
|
||||
RCC.LPTIM1Freq_Value=100000000
|
||||
RCC.LPTIM2Freq_Value=100000000
|
||||
RCC.LPTIM345Freq_Value=100000000
|
||||
@ -461,7 +474,8 @@ RCC.Tim2OutputFreq_Value=200000000
|
||||
RCC.TraceFreq_Value=64000000
|
||||
RCC.USART16Freq_Value=100000000
|
||||
RCC.USART234578Freq_Value=100000000
|
||||
RCC.USBFreq_Value=200000000
|
||||
RCC.USBCLockSelection=RCC_USBCLKSOURCE_HSI48
|
||||
RCC.USBFreq_Value=48000000
|
||||
RCC.VCO1OutputFreq_Value=800000000
|
||||
RCC.VCO2OutputFreq_Value=48375000
|
||||
RCC.VCO3OutputFreq_Value=48375000
|
||||
@ -580,6 +594,8 @@ SH.FMC_SDNWE.0=FMC_SDNWE,12b-sda1
|
||||
SH.FMC_SDNWE.ConfNb=1
|
||||
USART1.IPParameters=VirtualMode-Asynchronous
|
||||
USART1.VirtualMode-Asynchronous=VM_ASYNC
|
||||
USB_OTG_FS.IPParameters=VirtualMode
|
||||
USB_OTG_FS.VirtualMode=Device_Only
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
board=custom
|
||||
|
@ -78,6 +78,11 @@ menu "Hardware Drivers Config"
|
||||
select RT_USING_DFS_ELMFAT
|
||||
default n
|
||||
|
||||
config BSP_USING_USBD
|
||||
bool "Enable OTGFS as USB device"
|
||||
select RT_USING_USB_DEVICE
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
endmenu
|
||||
|
@ -28,14 +28,15 @@ void SystemClock_Config(void)
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48|RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 3;
|
||||
RCC_OscInitStruct.PLL.PLLN = 200;
|
||||
RCC_OscInitStruct.PLL.PLLP = 2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
RCC_OscInitStruct.PLL.PLLR = 2;
|
||||
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
|
||||
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
|
||||
|
@ -124,6 +124,18 @@
|
||||
|
||||
/* Using USB */
|
||||
|
||||
#define RT_USING_USB
|
||||
#define RT_USING_USB_DEVICE
|
||||
#define RT_USBD_THREAD_STACK_SZ 4096
|
||||
#define USB_VENDOR_ID 0x0FFE
|
||||
#define USB_PRODUCT_ID 0x0001
|
||||
#define _RT_USB_DEVICE_CDC
|
||||
#define RT_USB_DEVICE_CDC
|
||||
#define RT_VCOM_TASK_STK_SIZE 512
|
||||
#define RT_CDC_RX_BUFSIZE 128
|
||||
#define RT_VCOM_SERNO "32021919830108"
|
||||
#define RT_VCOM_SER_LEN 14
|
||||
#define RT_VCOM_TX_TIMEOUT 1000
|
||||
|
||||
/* POSIX layer and C standard library */
|
||||
|
||||
@ -230,7 +242,6 @@
|
||||
#define BSP_USING_GPIO
|
||||
#define BSP_USING_UART
|
||||
#define BSP_USING_UART1
|
||||
#define BSP_USING_QSPI
|
||||
|
||||
/* Onboard Peripheral Drivers */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user