各位老大我碰到了一个不解的问题请各位老大指点下
RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1,ENABLE);
void USART1_Init()
{ GPIO_InitTypeDef GPIO_InitStruct;
USART_InitTypeDef USART_InitStruct;
USART_ClockInitTypeDef USART_ClockInitStruct;
GPIO_InitStruct.GPIO_Pin=GPIO_Pin_9;
GPIO_InitStruct.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Mode=GPIO_Mode_AF_PP;
GPIO_Init( GPIOA, & GPIO_InitStruct);
GPIO_InitStruct.GPIO_Pin=GPIO_Pin_10;
GPIO_InitStruct.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Mode=GPIO_Mode_IN_FLOATING;
GPIO_Init( GPIOA, & GPIO_InitStruct);
// USART_DeInit( USART1);
USART_StructInit(&USART_InitStruct);
USART_Init( USART1, &USART_InitStruct);
USART_ClockStructInit(&USART_ClockInitStruct);
USART_ClockInit(USART1,&USART_ClockInitStruct);
USART_Cmd(USART1,ENABLE);
}
在我的MAIN函数里面 打印printf("hello world!")的时候 用软件仿真可以 在MDK的串口里面看到 但是烧到板子以后 就死活收不到发送出来的数据 JTAG也是跑到printf函数就死了 指点下呀各位老大 问题在哪
|