nucleo-wb55rg and uart?
I have the following code where the variable string takes on the float value toPC correctly. I step into the HAL_UART_Transmit_IT and step over all the assignments and all looks fine yet I never see the TDR register update with the first value. Furthermore my while loop just hangs. Should I be doing something else for the uart to send data??
I am connected to the STLINK port on the board and have the UART configured for 19200, 8 bit, No parity and I see nothing come over the port. The TE, RE, UE and TXEIE bits in CR register are all set.
Thank you
for (uint8_t k = 0; k < NO_ADC_CH; k++)
{
static char string[7];
ISR.usart_txToPC = F;
/*
* LMT87 linear equation
* T = V - 2.6355 / -13.5mV
* equation represents 0C - 50C
*/
float toPC =(((float)(stream[k]) / 4095 * 3.3) - 2.6355) / (-0.0135);
sprintf(string, "%2.2f\r\n", toPC);
HAL_UART_Transmit_IT(&huart1, (uint8_t*)string, strlen(string));
while(!ISR.usart_txToPC);
}
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
if (huart == &huart1)
{
ISR.usart_txToPC = T;
}
}