Changed parity flag after calling HAL_TIM_PWM_Start_IT()
Hello,
I found a strange behaviour now in my code. When I initialize my UART3, I can communicate with my terminal as expected. During runtime, I call the function HAL_TIM_PWM_Start_IT() to start timer 1. After this call, the received characters are not same as before. When I step through the code, I found within the HAL_TIM_PWM_Start_IT() function the call to enable the timer (line 1623), which causes this change of my parity settings.
This is my function call.
printf("\033[2;1H ==>> Correct output");
if(HAL_OK != HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_1))
Error_Handler();
printf("\033[3;1H ==>> What happend now?");
When I start debugging, it ends here in stm32h7xx_hal_tim.c (lines are added by me, just for this box).
1620 tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
1621 if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
1622 {
1623 __HAL_TIM_ENABLE(htim);
1624 }Register from UART3 before
and after the function call.
Here are my settings for the UART
huart3.Instance = USART3;
huart3.Init.BaudRate = 115200;
huart3.Init.WordLength = UART_WORDLENGTH_8B;
huart3.Init.StopBits = UART_STOPBITS_1;
huart3.Init.Parity = UART_PARITY_NONE;
huart3.Init.Mode = UART_MODE_TX_RX;
huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart3.Init.OverSampling = UART_OVERSAMPLING_16;
huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart3.Init.ClockPrescaler = UART_PRESCALER_DIV1;
huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;It would be great, if someone has a good idea, what happen. Unfortunately, I cannot go deeper in the code, it ends with the call of __HAL_TIM_ENABLE().
Thanks,
Jan
