STM32F4 Python Programming

Language & Programming

STM32F4 Python Programming

After the rather unsuccessful approach of installing an entire NuttX/PX4 ecosystem on an NUCLEO-F446RE, I got a very simple system running on it: MicroPython! Attaching the board via USB, it is only necessary to run the following commands to get a running python shell (in python context it is called REPL):

git clone
cd micropython
cd mpy-cross
cd ../ports/stm32
make submodules
make BOARD=NUCLEO_F446RE deploy-stlink
screen /dev/ttyACM0 115200

Getting stuff blinking is just as fast as the previous commands:

import pyb
led = pyb.LED(1)

Let us test to send some UART data:

from machine import UART
uart = UART(6, 115200) # UART6 can be used
uart.init(115200, bits=8, parity=None, stop=1)

Logging the data with a PicoScope 2205A MSO:

I2C did not work (yet!)

Following up on this with some Rust:

Leave a Reply

Your email address will not be published. Required fields are marked *