usart3 on nucleo-h753 not work fine
I have been trying to transmit and receive from putty through the USB virtual com (CN1) of the core board, I tried with different baud rates and the result is always the same, garbage arrives at the putty, and I am not receiving anything either, it is my configuration and tks in advance =
static void MX_USART3_UART_Init(void)
{ 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_MSBFIRST_INIT;
huart3.AdvancedInit.MSBFirst = UART_ADVFEATURE_MSBFIRST_ENABLE;
if (HAL_UART_Init(&huart3) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetTxFifoThreshold(&huart3, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetRxFifoThreshold(&huart3, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_DisableFifoMode(&huart3) != HAL_OK)
{
Error_Handler();
}
}
Call to send
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) //
{
if(htim->Instance == TIM1)
{
cada2segundos();
}
}
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
if (huart->Instance == USART3) {
HAL_GPIO_TogglePin(GPIOB, LD1_Pin);
}
}
void cada2segundos(void)
{
HAL_GPIO_TogglePin(GPIOE, LD2_Pin);// ambar
HAL_UART_Receive_DMA(&huart3, rx_buffer,RX_BUFFER_SIZE);
uint8_t mensaje[] = "Hola de nuevo";
HAL_UART_Transmit_IT(&huart3, mensaje, sizeof(mensaje) - 1);
}
