BT San Technology

1 May 2026

STM32CubeMX, CubeIDE and ST-LINK: configure, program and debug so problems can be found

2 min read · Automation

Illustration: a hand holding a probe on a board, with a debugger on a ribbon cable
AI-generated illustration

The tools in the STM32 ecosystem each do a different job. CubeMX configures the chip and generates the project code, CubeIDE is used for development and debugging, and CubeProgrammer handles programming and memory management as far as the chip supports. A debugger lets you check real values and the order of execution, but someone still has to understand the generated code, including the clock and the peripherals.

What is taught and the order of the exercises

  1. Create a project for the exact chip part number, set the clock and pins, and read the resource conflict warnings.
  2. Keep the configuration file and separate user code following the generator's guidelines, so your code is not overwritten.
  3. Set breakpoints and watches to prove hypotheses one at a time, then use logs or trace when halting the CPU changes the behavior.
  4. When using DMA, interrupts or an RTOS, check buffer ownership, priorities and shared resource use, and record the firmware package version.

Exercises and applied examples

Exercise: build an example that reads data and sends it over UART, and deliberately introduce one error. Then record how you proved the cause with the debugger.

Limits and what else to check

HAL, LL and register-level programming have different tradeoffs. You do not always need to avoid HAL, and a breakpoint can make the timing differ from a normal run.

Manufacturer documents worth reading

  • STM32CubeIDE
  • STM32 MCU portfolio
  • STM32CubeMX

References

  1. STM32CubeIDE (accessed 2026-11-21)
  2. STM32 MCU portfolio (accessed 2026-11-21)
  3. STM32CubeMX (accessed 2026-11-21)

Add us on LINE

Scan with the LINE app on your phone

QR code to add LINE @Bankoos

LINE ID: @Bankoos

Open LINE on this computer