GD32470V_START(GD32F470VKT6) UART无法正常运行,逻辑分析仪测试针脚无变化(一直高电平)。
所有函数都使用 GD32470V_START_Demo_Suites 的例子。感谢所有提供帮助的同学。gd_eval_com_init 来自官方教程.
int main(void)
{
/* configure systick */
systick_config();
/* configure EVAL_COM0 */
gd_eval_com_init(EVAL_COM0);
/* enable the LEDs GPIO clock */
rcu_periph_clock_enable(RCU_GPIOC);
/* configure LED2 GPIO port */
gpio_mode_set(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_6);
gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_6);
while(1) {
usart_data_transmit(EVAL_COM0, 'O');
while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE));
usart_data_transmit(EVAL_COM0, 'K');
while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE));
/* wait for completion of USART transmission */
while(RESET == usart_flag_get(EVAL_COM0 ,USART_FLAG_TC)){
}
/* turn on LED2 */
gpio_bit_set(GPIOC, GPIO_PIN_6);
//gpio_bit_set(GPIOA, GPIO_PIN_9);
delay_1ms(100);
gpio_bit_reset(GPIOC, GPIO_PIN_6);
//gpio_bit_reset(GPIOA, GPIO_PIN_9);
delay_1ms(100);
}
}
|