Serial routine fails for some reason
STM32F429ZIT6 - Nucleo
I am doing some tests with this board, it reads Encoder input in x4 mode, generates TRGO to ITR1 slave TIM1 in One pulse mode when it reaches TIM2->CCR3 value and updates Encoder counts and number of triggers every 15 seconds on serial.
I have observed when encoder count get above a certain threshold (less than 2^32 -1)
this serial routines either stop outputing on serial or get stucks in continuous output.
Is there anything wrong with this ?
counter and i are declared as global variable
volatile uint32_t counter = 0;
uint32_t i = 0; uint8_t data[50] ={'\0'};
uint32_t startTime = HAL_GetTick();
uint32_t waitTime = 15000;
while (1)
{
if(HAL_GetTick()-startTime > waitTime){
startTime = HAL_GetTick();
sprintf(data, "Encoder count : %d Number of triggers : %d \r\n", counter,i);
HAL_UART_Transmit(&huart3,data,sizeof(data),10);
}
}