2024-06-10 02:15 AM
Hello everyone,
I am working with a STM32WB5MMDK. I want to use the USART to print a message on Tera Term but i just have inversed triangles instead of "Hello world". I checked and both Tera Term and USART1 have the same parameters (baud rate, etc). I find it weird that i have a succession of triangles, and the other subjects related don't mention that.
Does anyone know how to fix this ?
Thank you
2024-06-10 06:58 AM
@Nour wrote:I used an oscilloscope and I've found 1428 bauds.
So there is something wrong with your configuration. That's not a standard baud rate, so it's not going to work with a terminal like Tera Term.
Baud rates need to match within a few percent.
@Nour wrote:The input crystal frequency is in the .ioc ?
Yes - on the 'Clock Configuration' page
2024-06-10 07:12 AM
Yes ... in .ioc CubeMX clock configuration .... HCLK should be maximum frequency supported by yours controller..
And if your using HSE frequency then try input frequency as 8 Mhz.
2024-06-10 07:20 AM
I am sorry, i just want to make sure we are talking about the same thing because i am not sure i am understanding well. I have that in the clock configuration, it 's what i need to change ?
2024-06-10 07:28 AM
You need to show the full 'Clock Configuration' page.
Also tell us what clock source you are using - an external crystal or crystal oscillator would be best to get the accuracy required for async serial comms
2024-06-10 07:31 AM
Here is Input frequency.. you can change it according to yours requirements.
2024-06-10 07:37 AM
I am sorry, here is the full page (tell me if you can't see well).
For the clock, i don't really do anything, i let the seetings by default, i didn't really know how the clock configuration worked...
Thank you @JJhin.1 i will take a look
2024-06-10 07:44 AM
It looks like you're using MSI RC as your clock source? That may not be accurate enough as a baud rate clock.
Again, an external crystal (or crystal oscillator) would be best to get the accuracy required for async serial comms
2024-06-10 07:52 AM
Would you have any ressource on internet where I can find how to configure an external crystal ?
Because, I can't see well the images of @JJhin.1
2024-06-10 07:53 AM
Check you're not using ODD parity, some of ST's examples like to use that.
Some UART can't get to lower baud rates due to the width of the BRR and the clock source. Check you aren't getting errors from HAL_UART_Init(), and perhaps divider UART->BRR back into the bus/uart clock to see the speed.
The logic levels can also be different RS232 != CMOS 3V
2024-06-10 08:00 AM
In PLL Source MUX select HSI instead of MSI ... after again you have to select HCLK as maximum.
To select external crystal frequency
you need to go to RCC setting and select Cystal Resonator for HSE.
For more details I'll suggest you to go through with the Datasheet of yours device.