Compile and Run python code in Mbed OS on STM32H


I am sorry if I’m asking a stupid question but I’m a noob in this forum.
Well, I would like to ask if it possibile to load and run a Python program on an ST board (STM32H747) using Mbed Studio or Mbed online compiler.
Could be very useful for me also if you know any other way to run python programs on such a board, because I’m reading manuals and I understood that only C++ is allowed as programming code.
My problem is that I have developed one huge project in Python and I want to run it on the ST board without translating everything to C++.

Thank you very much to all you!

Mbed OS doesn’t directly support running Python in any way. I think there are some other frameworks (CircuitPython?) that will allow you to do this on certain processors. Also, be careful of tools to convert Python to C++ if that’s what you’re looking into, because a lot of these probably aren’t designed with embedded environments in mind (e.g. using lots of dynamic memory, using OS function calls that don’t exist, etc.

1 Like

Google is you friend, first link that comes up is

Regarding your question, there is no Python runtime I’m aware of that runs on top of Mbed.

1 Like

Thank you Andre for your answer.
I already look at MicroPython but it seems designed expressly for pyboard and anyway as reported in this pictures it was designed to be integrated in STM32Cube but not in the version compatible with my board (STM32H747).
So now I guess that my only way is to re-write the project hoping to find a way to develop machine learning algorithm in c++ as in python.

If you want to run ML inference on a microcontroller you can build the model in tensorflow or keras, convert the model to tflite format and use tflite micro to run the model. The tensorflow repository has examples how to do this.

Or you use a service something like edge impulse.

1 Like

Hello Mario,

This post might help.

1 Like