cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to debug STM32 code without any hardware (no board, no ST-Link, no QEMU)?

highbariton
Associate

Hello everyone,

I’m working with STM32CubeIDE (v1.19) and STM32 projects, but currently I don’t have any STM32 board or debug probe available.

What I want to achieve is not real hardware simulation, but something like:

  • Step-by-step execution

  • Breakpoints

  • Variable watching

  • Logical flow debugging

Constraints:

  • :cross_mark: No STM32 board

  • :cross_mark: No ST-Link / J-Link

  • :cross_mark: No QEMU / Renode / Proteus

  • :white_heavy_check_mark: Only PC-based development

4 REPLIES 4
Pavel A.
Super User

So why not QEMU? It is pure software and free. ARM (Keil) provides a software simulator that works with their IDE & debugger.

 

mfgkw
Senior III
Andrew Neil
Super User

So long as your code doesn't rely on any STM32 hardware interaction, you could build and run it in a PC native environment.

You can "stub" parts that would rely on STM32 hardware.

This is also a great way to test your embedded code!

(I am currently doing this to test/debug some STM32 accelerometer handling)

 

As @Pavel A. said, Why do you preclude QEMU? It is not a hardware simulator.

 

Anyhow, something like a Nucleo board is cheap - why not just get one?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

@Andrew Neil wrote:

You can "stub" parts that would rely on STM32 hardware.


If you use HAL for all your hardware interactions, you could just "stub" the HAL functions...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.