We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi guys, So I'm facing an annoying issue using printf in keil. The IDE does not show what I print, furthermore it just keeps printing continuously random characters like these : ™™™™úú±úy±q±ù±± ± ± ™ú± ± ± ‘±± ™üý™±±ú±úú %±üú©ú±™þ All I did was declare a variable, and then print it : printf(" %d \n", testVariable);
- I included stdio.h - I created a file with the fputc function But still nothing works. Does anyone have any idea?.. Thank you very much !
keil : 5.23 StM32373C eval board.
Hi Andrew, Thanks for your reply ! I just checked and my Baud rate is good (unfortunately).
Amine
How did you check?
I'm using a host application which communicates with my MCU. The BR of both is set to the same value.
However I found my problem , I'm writing the solution here in case it can help someone in the future : I had the change the core Clock in the debug options. Go to project otpions -> debug -> settings ( ST-Link debugger)-> trace-> Core clock This value needs to be the same as your MCU clock ! Hope this helps.
But the setting in your Target was based on a false assumption - so your Target baud rate was wrong.
That's why I asked how you had checked the baud rate!
I'm not quite sure to understand which BR you're talking about? Communication between my computer and the MCU? Where do I set/change this?
The point is that both Baud Rates need to be the same.
I don't quite follow your description of the "solution" but, evidently, one side of the link or the other was not working at the clock speed that you thought it was, so your baud rate calculation was giving the wrong answer - because the baud rate is derived from the clock.
Evidently using the SWV via "Serial debug (printf) viewer", and not a USART
Ok I thought USART BR. So if I understand clearly ( according to that link too : http://www.keil.com/support/man/docs/uv4/uv4_db_dbg_serialwin.htm ) the printf viewer is a serial windows which means it has its own BR ( the one Andrew was talking about previously)?
So my problem was probably that this BR value was(might still be) wrong, which brings me to the following question : where do I set this BR value? Secondly how do I know the correct value to put it ? How do I know the BR of the << device >> the printf is communicating with?
Thank you very much guys !