🛠 MicroPython sur le Nucleo STM32H743ZI : le REPL 480 MHz via le port série ST-LINK

STM32H7 Nucleo-144 (porte-drapeau : NUCLEO-H743ZI) · debutant · Schéma : IMG-stm32h7-nucleo-debutant-3-stm32h743zi-micropython-repl.svg — Nucleo-144 STM32H743ZI reliée en USB à un ordinateur portable, fenêtre de REPL MicroPython affichant « >>> », LED verte de la carte allumée, câble USB unique vers le connecteur ST-LINK, flat vector style, étiquettes en français, fond blanc.

What you will build

Run MicroPython interactively on the STM32H743ZI — an official port exists in the upstream MicroPython repository under ports/stm32/boards/NUCLEO_H743ZI (an NUCLEO_H743ZI2 port directory exists too). You get a Python 3 prompt at 480 MHz over the ST-LINK virtual COM port: perfect for quick sensor experiments before committing to C.

Hardware

Step 1 — Get the firmware

The official port lives at github.com/micropython/micropython/tree/master/ports/stm32/boards/NUCLEO_H743ZI. Build it from the MicroPython sources (make in ports/stm32 with the board set to NUCLEO_H743ZI), then flash it through the on-board ST-LINK/V2-1 — the same programmer path used by STM32CubeProgrammer and OpenOCD, no external probe needed.

Step 2 — Open the REPL

  1. Plug the board's ST-LINK USB socket ; a virtual COM port appears (the same VCP used as console at 115200 8N1 in the Zephyr mapping).
  2. Open it at 115200 baud and press Ctrl-C — the >>> prompt answers.

Step 3 — First commands

>>> import machine, time
>>> led = machine.Pin("LED_GREEN", machine.Pin.OUT)  # board-name alias per the
...                                                  # MicroPython board definition
>>> while True:
...     led.value(not led.value)
...     time.sleep_ms(250)
...

Try the analog side too — the H743 has 3 ADCs (16-bit) and 2 DACs:

>>> from machine import ADC, Pin
>>> a = ADC(Pin('A0'))          # the STM32 silicon offers 36 ADC channels
>>> a.read_u16                # 16-bit-ish sampling on the 480 MHz M7

Step 4 — Make it permanent

Drop a main.py on the filesystem (the port ships with a flash filesystem) and your script runs at every power-up — the classic embedded workflow: prototype in the REPL, freeze into main.py, later port to C if you need the last microsecond.

Expected result

The green LED pulses at 2 Hz from the REPL loop ; Ctrl-C returns you to >>>. Everything runs on the Cortex-M7 at up to 480 MHz with its double-precision FPU — float-heavy MicroPython code is unusually fast on this port.

Common pitfalls

Autres tutoriels pour cette carte

Exemples de code pour cette carte

← Retour à la fiche 🛠 Tous les tutoriels