Vaso
Vaso

Reputation: 991

Debug semihosting printf function on stm32

I am trying to enable printing on host machine using printf() function and rdimon library.

My hardware is:
-STM32F103C8T6
-ST-Link V2

In order to enable printf() on host, I use:

-specs=nano.specs -specs=rdimon.specs -lc -lrdimon as linker flags

extern void initialise_monitor_handles(void);  
initialise_monitor_handles(); for initialization at the beginning of main()  

arm semihosting enable option in OpenOCD cfg file in order to enable semihosting in OpenOCD

But its not working. Can you tell me how I can debug it, or maybe some suggestions, how should I approach this problem?

Upvotes: 0

Views: 2083

Answers (1)

somanyquestions
somanyquestions

Reputation: 52

I'm sorry, are you trying to printf to the SWO line for debug?

Here is a useful thread on that (they approach two different ways, I'm more familiar wiht the second): https://www.openstm32.org/forumthread2893

There are also some useful tutorials:

When you say it isn't working, there is a lot of things that could be going on. Implementation can be wrong for your board. Your setup on your debugger could be wrong. Also hardware could be setup or connected wrong. Without knowing exactly what you have done and setup and tested, it is hard for me to tell. But the great news is if you look up your processor, STM32 products tend to have a ton of tutorials and support. (they have a few communities that support just that and know how to support the hardware and software)

Upvotes: 1

Related Questions