2024-01-11 07:07 PM
Hello.
I'm using STM32F407, use usart3 set DMA setting baud rate 9600 and use receive
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
if (huart->Instance == USART3) {
HAL_UARTEx_ReceiveToIdle_DMA(&huart3, RxBuff, Size);
__HAL_DMA_DISABLE_IT(&hdma_usart3_rx, DMA_IT_HT);
}
}
connect to computer using software terminal "HTerm"
Set baud rate 9600 STM32F407 can receive
But i change to other baud rate such as 115200
then i change baud rate 9600 can not receive
Solved! Go to Solution.
2024-01-14 05:16 PM
1. Setting baud rate 9600 HTerm is working
2. Setting baud rate 56000 HTerm is working
3. Setting came back baud rate 9600 HTerm is not working
2024-01-11 08:00 PM
Check if you have any sticky errors in the status register that need clearing.
ie noise, framing, parity, overrun, etc
2024-01-12 01:32 AM - edited 2024-01-12 01:35 AM
I'm Setting USART3 below
static void MX_USART3_UART_Init(void)
{
huart3.Instance = USART3;
huart3.Init.BaudRate = 9600;
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;
if (HAL_UART_Init(&huart3) != HAL_OK)
{
Error_Handler();
}
}
I ever clearing below
"__HAL_UART_CLEAR_PEFLAG(&huart3);"
"__HAL_UART_CLEAR_FEFLAG(&huart3);"
"__HAL_UART_CLEAR_NEFLAG(&huart3);"
"__HAL_UART_CLEAR_OREFLAG(&huart3);"
"__HAL_DMA_DISABLE_IT(&hdma_usart3_rx, DMA_IT_HT);"
"__HAL_UART_CLEAR_FLAG(&huart3, UART_IT_IDLE);"
"__HAL_UART_ENABLE_IT(&huart3, UART_IT_RXNE);"
2024-01-12 01:53 AM
> then i change baud rate 9600 can not receive
How do you change baud rate?
Read out content of UART registers for "working" and "not working" cases, and compare/post.
JW
2024-01-14 05:16 PM
1. Setting baud rate 9600 HTerm is working
2. Setting baud rate 56000 HTerm is working
3. Setting came back baud rate 9600 HTerm is not working
2024-01-14 05:17 PM
1. Setting baud rate 9600 HTerm is working
2. Setting baud rate 56000 HTerm is working
3. Setting came back baud rate 9600 HTerm is not working
Thank you.
2024-01-14 05:17 PM
1. Setting baud rate 9600 HTerm is working
2. Setting baud rate 56000 HTerm is working
3. Setting came back baud rate 9600 HTerm is not working
Thank you
2024-01-21 04:36 PM
Anyone help me ?
2024-01-22 03:18 AM
You've marked your post of 2024-01-14 05:16 PM as the Solution - did you not mean to do that?