cancel
Showing results for 
Search instead for 
Did you mean: 

UART reception isssue

Nour
Associate III

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

22 REPLIES 22

@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
 

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.

 

Nour
Associate III

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 ?
Capture d'écran 2024-06-10 161844.png

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

 

Here is  Input frequency.. you can change it according to yours requirements.

HCLK frequencyHCLK frequencyInput frequencyInput frequency

Nour
Associate III

I am sorry, here is the full page (tell me if you can't see well).

 Capture d'écran 2024-06-10 163450.pngCapture d'écran 2024-06-10 163514.png

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

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

Nour
Associate III

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 

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.