2022-06-30 06:08 PM
2022-06-30 09:36 PM
The hardware doesn't need it, it uses clock ratios.
Might find in a variable or structure held in Memory..
2022-06-30 10:05 PM
In what structure?
Where can I find the current UART baud rate in memory?
2022-06-30 11:22 PM
It is little bit strange request (your program writes some value into BRR, you should be able to find that value in your source code). But, simple, connect oscilloscope to UART TX signal, send some unambiguous character (like 0x00, or 0xFF etc.) and measure bit time duration from oscilloscope trace.
2022-07-01 01:04 AM
It's your software that configures the UART - including setting the baud rate - so your software must know what baud rate it set!
2022-07-01 01:06 AM
@Michal Dudka "It is little bit strange request (your program writes some value into BRR, you should be able to find that value in your source code)"
Absolutely!
"send some unambiguous character"
Best choice would be uppercase 'U' - that should give a square wave with 1 start & 1 stop bit ...
2022-07-01 01:36 AM
I understand that my code says what should be the data transfer rate.
But if I don't want to analyze a very large code, but just want to see the UART baud rate.
2022-07-01 01:40 AM
>It's your software that configures the UART
software?? You probably meant code.
I am not writing about a program on a computer that receives data from a UART.
The program on the computer is simply tuned to the data transfer frequency indicated in the code, the data transfer rate does not depend on the program.
2022-07-01 02:02 AM
@Community member - No, I meant your software (aka "firmware" or "code") that's running on the STM32.
"I don't want to analyze a very large code"
Are you talking about some 3rd-party code, then?
As @Michal Dudka said, it's a strange request - so hard to know what you're actually trying to achieve.
"just want to see the UART baud rate"
Then, as @Michal Dudka said, the easiest way is to just measure it externally.
2022-07-01 03:31 AM
You do seem to struggle with very basic methods here.
https://community.st.com/s/question/0D53W00001db87nSAA/what-is-written-to-the-usartbrr-register
The machine uses relative clock ratios to relate one clockable source to another.
The machine doesn't keep a record of your "baud rate", it only knows that it is some fraction of the bus clock rate. ie Baud Rate = APBxCLK / USARTx->BRR
Will be in structure hUart,
ie hUart->Init.BaudRate where UART_HandleTypeDef *hUart;