cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F072x usart rx interrupt receive what I send to printf

dqdqdq31
Associate II
Posted on December 03, 2014 at 05:10

Hi ST,

I connect my module usart tx/rx with STM32F072x PA10/PA9, and initial PA10&PA9 as usart1 to communicate with my module.

Besides, I use printf to IAR Terminal IO window to debug, not redirect printf to usart1 or other usart ports.

In sometimes, usart1 RX interrupt will receive what I send to printf, like:

c0 4e c0 20 74 69 6d 20 69 6e 69 74 20 63 6f 6d     .N. tim init com

70 6c 65 74 65 0d 0a 00 5b 25 73 3a 25 64 5d 20     plete...[%s:%d] 

73 70 69 20 69 6e 69 74 20 63 6f 6d 70 6c 65 74     spi init complet

Why? And how to prevent it?

That makes me not to communicate with my module.

Thanks.

#stm32f0 #usart #stm32
4 REPLIES 4
Posted on December 03, 2014 at 05:22

May be it's your code?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dqdqdq31
Associate II
Posted on December 03, 2014 at 06:43

Would you give me a hint what will cause this situation?

I can just mark printf, but I need it to debug communication protocol.

Posted on December 03, 2014 at 08:24

Can you look at the Rx pin with an oscilloscope?

JW
dqdqdq31
Associate II
Posted on December 03, 2014 at 11:20

It is solved.

Actually it is not a bug.

It is not the usart rx interrupt really received what printf output.

It is the memory that used by printf before, and be allocated for rx int in after but not be cleared.

Thanks for all replyed.