0

Hy, i am working on STM32f401 Controller. I am facing an issue with the UART controller. I am sending Command from PC to STM32 board. Command Consists of 4 BYTES. like PCLI(which is PC Login). while testing the Code, after and around 15 mins or sometimes less.. the uart is stuck. I am debugging with KEIL, in this i saw the registers(RXNE,IDLE,ORE) these three registers are simultaneously high(when the data arrives). i am using rxcpltcallback function. when i get PCLI from UART i will do my event.uart_registers_img My Code Looks Like

i will get the command from rx Callback function.

2
  • This is very likely caused by bugs in the code which you didn't post. Or less likely hardware problems like baudrate inaccuracy, missing signal ground etc. Commented Mar 4, 2022 at 9:20
  • Please provide enough code so others can better understand or reproduce the problem. Commented Mar 5, 2022 at 20:24

1 Answer 1

1

Did you read the manual to see what ORE means? It is overrun error. You received another byte before your software had processed the previous one.

The simple solution is to either send the bytes more slowly, or else process them more quickly.

If you can't do either of these things then you need to read the bytes from the UART quickly and store them somewhere without processing them, and them process them later when you have time.

Sign up to request clarification or add additional context in comments.

1 Comment

If you halt the CPU but the UART keeps running, you'll get overrun errors for that reason alone though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.