USART3/Serial3 outputting garbage... U575

Post here first, or if you can't find a relevant section!
Post Reply
User avatar
Mangy_Dog
Posts: 133
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

USART3/Serial3 outputting garbage... U575

Post by Mangy_Dog »

Hi again new issue so new thread. we have USART3 on PC10/PC11 for debug output. But for some reason its outputting garbage.

I created a hello world in cubeIDE and it works fine there.
I am using the same clock config as cubeIDE so I know its not some strange clock sync issue.

The output is bad enough that it doesnt even show in my IDE serial out, only in putty.

Set my baud to 115200, and even tried a slower 9600. Neither work.

So is there something else deeper in the variant files that need to be tweaked for this to work correctly?

Any help would be great.
by fpiSTM » Thu Jun 05, 2025 1:39 pm
Mangy_Dog wrote: Thu Jun 05, 2025 12:24 pm Hi again new issue so new thread. we have USART3 on PC10/PC11 for debug output. But for some reason its outputting garbage.

I created a hello world in cubeIDE and it works fine there.
I am using the same clock config as cubeIDE so I know its not some strange clock sync issue.
Is it using HSE? if yes which value?
Default value is:
#define HSE_VALUE 16000000UL /*!< Value of the External oscillator in Hz */
So if you use HSE with another value you have to redefine it else all frequencies computed will be wrong.
Go to full post
Just a dogs body developer, mostly making props and stuff...
fpiSTM
Posts: 1951
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 109
Location: Le Mans
Contact:

Re: USART3/Serial3 outputting garbage... U575

Post by fpiSTM »

Mangy_Dog wrote: Thu Jun 05, 2025 12:24 pm Hi again new issue so new thread. we have USART3 on PC10/PC11 for debug output. But for some reason its outputting garbage.

I created a hello world in cubeIDE and it works fine there.
I am using the same clock config as cubeIDE so I know its not some strange clock sync issue.
Is it using HSE? if yes which value?
Default value is:
#define HSE_VALUE 16000000UL /*!< Value of the External oscillator in Hz */
So if you use HSE with another value you have to redefine it else all frequencies computed will be wrong.
User avatar
Mangy_Dog
Posts: 133
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: USART3/Serial3 outputting garbage... U575

Post by Mangy_Dog »

Im using HSE as the main clock in the clocks setup I have the uarts connected to SYSCLK which is derived from HSE through PLLM /1 X23 /6 to give a target of 32mhz main clock.

Its a 8mhz source.

In what file does "#define HSE_VALUE 16000000UL /*!< Value of the External oscillator in Hz */" go? Looks like that might be the issue...
Just a dogs body developer, mostly making props and stuff...
fpiSTM
Posts: 1951
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 109
Location: Le Mans
Contact:

Re: USART3/Serial3 outputting garbage... U575

Post by fpiSTM »

Simply redefine it in your variant*.h file
Example for NUCLEO_F722ZE:
https://github.com/stm32duino/Arduino_C ... 2ZE.h#L224
User avatar
Mangy_Dog
Posts: 133
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: USART3/Serial3 outputting garbage... U575

Post by Mangy_Dog »

fpiSTM wrote: Thu Jun 05, 2025 2:20 pm Simply redefine it in your variant*.h file
Example for NUCLEO_F722ZE:
https://github.com/stm32duino/Arduino_C ... 2ZE.h#L224
Looking in the file that used to be called variant_generic.h it was never defined to begin with.
Just a dogs body developer, mostly making props and stuff...
User avatar
Mangy_Dog
Posts: 133
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: USART3/Serial3 outputting garbage... U575

Post by Mangy_Dog »

WOOHOO! adding the define worked :)
#define HSE_VALUE 8000000UL
Thank you
Just a dogs body developer, mostly making props and stuff...
fpiSTM
Posts: 1951
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 109
Location: Le Mans
Contact:

Re: USART3/Serial3 outputting garbage... U575

Post by fpiSTM »

If you used the generic and not a dedicated variant then you can use the build_opt.h or the hal_conf_extra.h

https://github.com/stm32duino/Arduino_C ... uild_opt.h
https://github.com/stm32duino/Arduino_C ... definition
Post Reply

Return to “General discussion”