4
.config
4
.config
@@ -707,7 +707,9 @@ CONFIG_BSP_USING_GPIO=y
|
|||||||
CONFIG_BSP_USING_UART=y
|
CONFIG_BSP_USING_UART=y
|
||||||
CONFIG_BSP_USING_UART1=y
|
CONFIG_BSP_USING_UART1=y
|
||||||
# CONFIG_BSP_UART1_RX_USING_DMA is not set
|
# CONFIG_BSP_UART1_RX_USING_DMA is not set
|
||||||
# CONFIG_BSP_USING_UART2 is not set
|
CONFIG_BSP_USING_UART2=y
|
||||||
|
CONFIG_BSP_UART2_RX_USING_DMA=y
|
||||||
|
CONFIG_BSP_UART2_TX_USING_DMA=y
|
||||||
# CONFIG_BSP_USING_UART3 is not set
|
# CONFIG_BSP_USING_UART3 is not set
|
||||||
# CONFIG_BSP_USING_SPI is not set
|
# CONFIG_BSP_USING_SPI is not set
|
||||||
# CONFIG_BSP_USING_I2C1 is not set
|
# CONFIG_BSP_USING_I2C1 is not set
|
||||||
|
@@ -8,17 +8,20 @@ Mcu.IP0=NVIC
|
|||||||
Mcu.IP1=RCC
|
Mcu.IP1=RCC
|
||||||
Mcu.IP2=SYS
|
Mcu.IP2=SYS
|
||||||
Mcu.IP3=USART1
|
Mcu.IP3=USART1
|
||||||
Mcu.IPNb=4
|
Mcu.IP4=USART2
|
||||||
|
Mcu.IPNb=5
|
||||||
Mcu.Name=STM32F413V(G-H)Tx
|
Mcu.Name=STM32F413V(G-H)Tx
|
||||||
Mcu.Package=LQFP100
|
Mcu.Package=LQFP100
|
||||||
Mcu.Pin0=PH0 - OSC_IN
|
Mcu.Pin0=PH0 - OSC_IN
|
||||||
Mcu.Pin1=PH1 - OSC_OUT
|
Mcu.Pin1=PH1 - OSC_OUT
|
||||||
Mcu.Pin2=PA9
|
Mcu.Pin2=PA2
|
||||||
Mcu.Pin3=PA10
|
Mcu.Pin3=PA3
|
||||||
Mcu.Pin4=PA13
|
Mcu.Pin4=PA9
|
||||||
Mcu.Pin5=PA14
|
Mcu.Pin5=PA10
|
||||||
Mcu.Pin6=VP_SYS_VS_Systick
|
Mcu.Pin6=PA13
|
||||||
Mcu.PinsNb=7
|
Mcu.Pin7=PA14
|
||||||
|
Mcu.Pin8=VP_SYS_VS_Systick
|
||||||
|
Mcu.PinsNb=9
|
||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32F413VGTx
|
Mcu.UserName=STM32F413VGTx
|
||||||
@@ -41,6 +44,10 @@ PA13.Mode=Serial_Wire
|
|||||||
PA13.Signal=SYS_JTMS-SWDIO
|
PA13.Signal=SYS_JTMS-SWDIO
|
||||||
PA14.Mode=Serial_Wire
|
PA14.Mode=Serial_Wire
|
||||||
PA14.Signal=SYS_JTCK-SWCLK
|
PA14.Signal=SYS_JTCK-SWCLK
|
||||||
|
PA2.Mode=Asynchronous
|
||||||
|
PA2.Signal=USART2_TX
|
||||||
|
PA3.Mode=Asynchronous
|
||||||
|
PA3.Signal=USART2_RX
|
||||||
PA9.Mode=Asynchronous
|
PA9.Mode=Asynchronous
|
||||||
PA9.Signal=USART1_TX
|
PA9.Signal=USART1_TX
|
||||||
PH0\ -\ OSC_IN.Mode=HSE-External-Oscillator
|
PH0\ -\ OSC_IN.Mode=HSE-External-Oscillator
|
||||||
@@ -122,6 +129,8 @@ RCC.VCOInputFreq_Value=1000000
|
|||||||
RCC.VCOOutputFreq_Value=200000000
|
RCC.VCOOutputFreq_Value=200000000
|
||||||
USART1.IPParameters=VirtualMode
|
USART1.IPParameters=VirtualMode
|
||||||
USART1.VirtualMode=VM_ASYNC
|
USART1.VirtualMode=VM_ASYNC
|
||||||
|
USART2.IPParameters=VirtualMode
|
||||||
|
USART2.VirtualMode=VM_ASYNC
|
||||||
VP_SYS_VS_Systick.Mode=SysTick
|
VP_SYS_VS_Systick.Mode=SysTick
|
||||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||||
board=custom
|
board=custom
|
||||||
|
@@ -109,6 +109,30 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
|
|||||||
|
|
||||||
/* USER CODE END USART1_MspInit 1 */
|
/* USER CODE END USART1_MspInit 1 */
|
||||||
}
|
}
|
||||||
|
else if(huart->Instance==USART2)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN USART2_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END USART2_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_USART2_CLK_ENABLE();
|
||||||
|
|
||||||
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
|
/**USART2 GPIO Configuration
|
||||||
|
PA2 ------> USART2_TX
|
||||||
|
PA3 ------> USART2_RX
|
||||||
|
*/
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
|
||||||
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN USART2_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END USART2_MspInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +162,24 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
|
|||||||
|
|
||||||
/* USER CODE END USART1_MspDeInit 1 */
|
/* USER CODE END USART1_MspDeInit 1 */
|
||||||
}
|
}
|
||||||
|
else if(huart->Instance==USART2)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN USART2_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END USART2_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_USART2_CLK_DISABLE();
|
||||||
|
|
||||||
|
/**USART2 GPIO Configuration
|
||||||
|
PA2 ------> USART2_TX
|
||||||
|
PA3 ------> USART2_RX
|
||||||
|
*/
|
||||||
|
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN USART2_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END USART2_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -44,6 +44,11 @@ menu "On-chip Peripheral Drivers"
|
|||||||
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
|
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config BSP_UART2_TX_USING_DMA
|
||||||
|
bool "Enable UART2 TX DMA"
|
||||||
|
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
|
||||||
|
default n
|
||||||
|
|
||||||
config BSP_USING_UART3
|
config BSP_USING_UART3
|
||||||
bool "Enable UART3"
|
bool "Enable UART3"
|
||||||
default y
|
default y
|
||||||
|
@@ -205,6 +205,9 @@
|
|||||||
#define BSP_USING_GPIO
|
#define BSP_USING_GPIO
|
||||||
#define BSP_USING_UART
|
#define BSP_USING_UART
|
||||||
#define BSP_USING_UART1
|
#define BSP_USING_UART1
|
||||||
|
#define BSP_USING_UART2
|
||||||
|
#define BSP_UART2_RX_USING_DMA
|
||||||
|
#define BSP_UART2_TX_USING_DMA
|
||||||
|
|
||||||
/* Board extended module Drivers */
|
/* Board extended module Drivers */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user