cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F1 USART problem

markus-muc
Associate II
Posted on February 17, 2016 at 18:38

Hi, I am new to the STM32 family and I am stuck with a pretty basic problem. 

My board (STM32F105 CAN study board) came with a basic software in Flash, and I got the sources of that software which I am running from RAM. However, the USART2 does not behave the same from the source code in RAM. I.e., the code should output on USART2:

++++++++++++++++++++++++

  CAN Study Board

++++++++++++++++++++++++

But when I run the program 3 times in the following sequence:

1. From Flash

2. From RAM

3. From Flash (again)

the Putty output looks like this:

++++++++++++++++++++++++

  CAN Study Board

++++++++++++++++++++++++

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒++++++++++++++++++++++++

  CAN Study Board

++++++++++++++++++++++++

So the characters from the RAM implementation are corrupt. Any idea what the problem could be?
2 REPLIES 2
Posted on February 17, 2016 at 18:44

Any idea what the problem could be?

Your RAM based code is built with the wrong HSE_VALUE defined?

HSE_VALUE needs to match the speed of the crystal used in your design.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
markus-muc
Associate II
Posted on February 17, 2016 at 18:58

YESSS! 

Thanks for the extremely quick response, that was it!