Skip to content
0:00 / 0:00

#stm32#stm32cubeide#swv-trace

STM32CubeIDE: printf Debugging, Live Expressions & SWV Trace Tutorial

ControllersTech

60K subscribers • 4 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.

Intermediate. Assumes working knowledge.

119K views7 years ago2 recommendations

Tools and practiceSystems programmingDebuggingEmbedded systems

How to set up printf debugging via ITM, SWV Trace, and Live Expressions in STM32CubeIDE.

Learn how to use printf debugging via ITM, SWV Trace, and Live Expressions in STM32CubeIDE to efficiently monitor and debug your STM32 microcontroller projects. NOTE: Printf debugging via ITM and SWV Trace may not work for all microcontrollers and setups. For example, it does not work on the STM32F103, and it will also fail if you are using a cloned ST-Link — since cloned debuggers often lack full SWD protocol support and don't reliably handle the ITM stimulus ports required for SWV. Additionally, some low-end or older STM32 variants simply don't have ITM hardware built in. Live Expressions, however, will work for everyone regardless of the microcontroller or debugger being used, as it relies on standard debug halt and memory read operations rather than SWV. The write function is in the pinned comment. 🔔 Subscribe for more STM32 tutorials! 👍 Like & share to help others. #STM32 #STM32CubeIDE #EmbeddedSystems #printf #SWVTrace #LiveExpressions #ITM #Debugging #Microcontroller #EmbeddedProgramming #STM32F4 #Electronics #Programming #CubeMX #ContollersTech ________________________________________________________________________________________ ******* SUPPORT US ******* 🎁 Support My Work on Patreon: patreon.com/5065726/join 🌐 Connect: Facebook: facebook.com/controllerstech Telegram: t.me/controllerstechdiscuss Instagram: instagram.com/controllerstech/ Visit: controllerstech.com

Why it's here

2 people recommend this

What people say. Recommended as a helpful tutorial for setting up printf debugging and SWV trace on STM32.

u/UnicycleBlokeC++ advocatein r/embedded • Recommends

On “Stm32 and printing back out to host terminal.”

The ST-Link is mainly for programming and debugging. There are other ways to get debug messages out of the board, but I've always used a separate UART - it's been more than sufficient, and the same UART is generally used to provide a console on the target device for its users on production boards. One of my colleagues messed about with the SWO capabilities of the chip. He needed a high data rate and what he got was quite impressive - 50MHz. You might be interested in this which seems to be built on that. You are not using HAL/CubeIDE, so this won't be super helpful. Search for SWV (Serial Wire View) Trace. As I said, you should try to work out how printf() or whatever has been implement…

u/MustardOnCheesein r/embedded • Recommends

On “Trying to get SWO working on stm32f3discovery board”

Go to YouTube and search "stm32 prtintf" and you'll see how to do the steps in the stm32 cube ide. link to this video

u/bluecallerin r/embedded • Mentions

Printf debugging using SWV Trace works on Nucleo L476RG but not on L432KC. I'm trying to follow this YouTube video to get printf going. Like the title says, it works fine on a Nucleo L476RG but I can't seem to get it to work on a L432KC. What would be the cause? I'm a total noob who needs training wheels so be easy with me. I initialized both boards with their default peripherals and haven't had trouble using the peripherals between both boards, just can't get printf to work on one. Live expressions work OK on both. I read SWV is not supported on some boards, is this the case here? How can I determine what boards are supported? Other than UART, what would be an alternative for *printf()…