Tinkering with STM32MP2

2025-12-29

Intro

That post simply describes my tinkering notes on STM32MP2.

I would love to play with Yocto and Embedded kernel builds, as in my job unfortunately we are writing on bare metal, as we yearn energy - our devices needs to work up to 16 years, thus neither Linux nor even RTOS are valid here. Of course there are some disadvantages - we are not even close to real-time, although we do not it.

Nevertheless (too much on my job) - I somehow get STM32MP257F, thus I can play with it!

OpenOCD

Of course - OpenOCD does not support STM32MP2x in apt packed version. When I am writing this package the latest version commit is was authored @ Oct 3, 2024, and latest released OpenOCD version was v0.12.0-rc3, which did not have MP2 support yet.

That leads to me building OpenOCD from scratch.

I needed to install libjim-dev to on Debian Sid to overcome the issue with:

configure: error: jimtcl is required but not found via pkg-config and system includes

After that I was able to connect to my board via:

/usr/local/bin/openocd -f tcl/board/st/stm32mp257f-dk.cfg

Although I was not able to connect with gdb:

Info : accepting 'gdb' connection on tcp/3335
Error: Target not examined yet
Error: [stm32mp25x.m0p] Execution of event gdb-attach failed:
embedded:startup.tcl:1664: Error:
Traceback (most recent call last):
  File "embedded:startup.tcl", line 1664
    halt 1000
Info : New GDB Connection: 1, Target stm32mp25x.m0p, state: examine deferred
Error: [stm32mp25x.m0p] Target not examined yet, refuse gdb connection 1!
Error: attempted 'gdb' connection rejected

To be continued!