cancel
Showing results for 
Search instead for 
Did you mean: 

how to learn STM32 Debugger?

AA.21
Associate II

I had one STM32 debugger (ST-LINK-v2). how to learn the STM32 debugger and how to connect the stm32 chip to the debugger. give any solution or tutorial.

I will be waiting for your replays. Thank you.

20 REPLIES 20
Danish1
Lead II

Please tell us more. What stm32 chip do you have? What pcb is it on?

If you have one of ST's nucleo or discovery boards, they come with a built-in ST-Link that connects over USB - just see the User Manual for that board / family-of-boards - so you don't need a separate ST-Link.

If it's your own pcb, you'll connect the ST-Link via the international standard JTAG or ST's own SWD interface; there are standard pin-outs for those interfaces.

And you'll probably want an integrated debugging environment (IDE) to control things. ST's stm32cubeIDE is a great starting position for that.

I doubt there's a tutorial that covers the choice between those, but once we know what hardware you have, we can point you to tutorials.

And if you don't yet have any hardware, we can help you choose what to get.

What is your budget? Are you a student or hobbyist on limited funds, or a professional with a company budget but limited time?

Do you have any experience in

  • electronics
  • (desktop) computer-programming
  • other families of microcontroller

If so we don't want to waste time telling what you already know.

Help us to help you,

Danish

S.Ma
Principal

ST link is a debug probe. The debugger usually reffers to the PC sw. Connect the 3+ SWD debug bus interface to the target mcu board, power both debug probe and target board, and in your IDE, once your project builds without error, then you ca start a debug session which will flah the mcu and hold the code until you launch it.

I am using the STM32WLE5JC chip and the software tool is STM32 Cube IDE. I'm new to debugging with stm32 and I don't know what I'm doing. I watch many tutorial videos on youTube, but I don't understand the debugging concept. Kindly guide me to learn to debug concepts.

'I have one debugger hardware, this support both stm32 to stm8.

You’re using STM32WLE5JC and intend to connect STLINK and debug with Stm32Cube IDE.

I think that processor offers either JTAG or SWD+SWC. Stlink probably prefers SWD+SWC. So you’ll want to connect SWD, SWC, Vdd, Vss and ideally Reset as well between Stlink and processor.

Is the processor on your own pcb? Do you have to design a pcb? That part comes as a bga or very-fine pitch so it’s not for the feint-hearted.

Or is the stm32 in a module? I seem to remember reading Seeed E5 LoRa module has that processor inside.

If possible you might like to play with a NUCLEO-WL55JC2 first if you haven’t yet designed your pcb.

The debugging process:

Unless/until the processor is code-protected, it’s a case of writing your test code, downloading it onto the stm32 and seeing how it behaves. You can usefully start from one of the Stm32-cube Lora examples.

But if you’re using e.g. Seeed E5, you’ll have to read all the Wiki stuff about removing code-protection on it. From memory it’s not trivial but still possible.

Hope this helps,

Danish

@Danish​  I debug the normal interrupt and took the value on the live expression. but the problem was faced it the elf file error. so I re-install the cube ide software and run it. this elf file was generated. what problem occurs, why was the elf file not generated. do you have any other alternate method?

Can you post a screenshot including some of the error messages you get. Maybe they don't translate very well to/from English.

And the result when you build your project.

When you build your project, STM32 Cube IDE should generate an ELF file unless either:

  • there's a problem with the source-code
  • or The IDE doesn't know how to build the code (e.g. "external builder" is selected rather than "internal builder")
  • or the build set-up somehow requests not to generate an elf file.

0693W00000QLU8QQAX.png

Some time did not create the elf file on stm32 cube ide. why this file was not created kindly explain. I attached that image above.

Learn capturing screenshots normally so that those are not resized to ridiculous 11472x5528 pixels. Screenshots should not be resized at all!