STM32 - USART1 & USART2 (USART2 non working)
Hello everyone, I am having a problem with a simple program. My board is a STM32-U575ZITxQ.
Using only the USART1 interface, if I try to print the string: "USART1_READY" on my laptop's serial port, I have no problem. However, as soon as I also enable the USART2, I cannot print anything. Whether with only the USART2 enabled, or with both USART1 and USART2 enabled, if I try to print the string with USART2, I cannot. I checked all the settings of the USART1 and USART2 and they are the same (in GPIO, in Parameter setting, etc.).
/* USER CODE BEGIN PV */
char USART1 = "USART1_READY:\r\n";
char USART2= "USART2_READY:\r\n";
/* USER CODE END PV */
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start_IT(&htim4);//ready for trigger at 1 seconds
/* USER CODE END 2 */
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance == TIM4)
{
//HAL_UART_Transmit(&huart1, &USART1, sizeof(USART1),HAL_MAX_DELAY);
HAL_UART_Transmit(&huart2, &USART2, sizeof(USART2),HAL_MAX_DELAY);
}
}where am I going wrong?
