`void usart3_send_str(char *str)
{
for (; *str != ‘\0’;str++)
{
printf(“111\r\n”);
while((USART3->STS & USART_FLAG_TXBE) == RESET);//卡在这里
USART3->DATA = *str;
printf(“222\r\n”);
}
}
void USART3_Init(uint32_t baudRate)
{
GPIO_Config_T GPIO_configStruct;
USART_Config_T usartConfigStruct;
RCM_EnableAHB1PeriphClock(RCM_AHB1_PERIPH_GPIOC);
RCM_DisableAPB1PeriphClock(RCM_APB1_PERIPH_USART3);
USART_Reset(USART3);
/* Connect PXx to USARTx_Tx */
GPIO_ConfigPinAF(GPIOC, GPIO_PIN_SOURCE_10, GPIO_AF_USART3);
/* Connect PXx to USARTx_Rx */
GPIO_ConfigPinAF(GPIOC, GPIO_PIN_SOURCE_11, GPIO_AF_USART3);
/* Configure USART Tx as alternate function push-pull */
GPIO_configStruct.mode = GPIO_MODE_AF;
GPIO_configStruct.pin = GPIO_PIN_10;
GPIO_configStruct.speed = GPIO_SPEED_50MHz;
GPIO_Config(GPIOC, &GPIO_configStruct);
/* Configure USART Rx as input floating */
GPIO_configStruct.mode = GPIO_MODE_AF;
GPIO_configStruct.pin = GPIO_PIN_11;
GPIO_Config(GPIOC, &GPIO_configStruct);
usartConfigStruct.baudRate = baudRate;
usartConfigStruct.hardwareFlow = USART_HARDWARE_FLOW_NONE;
usartConfigStruct.mode = USART_MODE_TX_RX;
usartConfigStruct.parity = USART_PARITY_NONE;
usartConfigStruct.stopBits = USART_STOP_BIT_1;
usartConfigStruct.wordLength = USART_WORD_LEN_8B;
/* USART configuration */
USART_Config(USART3, &usartConfigStruct);
/* Enable USART1 RXBNE interrput */
USART_ClearStatusFlag(USART3,USART_FLAG_TXBE);
USART_ClearStatusFlag(USART3,USART_FLAG_TXC);
USART_ClearStatusFlag(USART3, USART_FLAG_RXBNE);
USART_EnableInterrupt(USART3, USART_INT_RXBNE);
NVIC_EnableIRQRequest(USART3_IRQn,3,0);
/* Enable USART */
USART_Enable(USART3);
printf("USART3_Init\r\n");
}`
PC10,PC11用作串口3发送数据得时候卡在while((USART3->STS & USART_FLAG_TXBE) == RESET);
请教一下,是哪里原因呢,感谢