September 29, 2026

The mac mini -- the STM32H743

I have an STM32H743 Nucleo board and did some work with it about a year ago. I want to see how easy it is to start working with this on the Mac. My work in on Github: So we do the following. (For the record, I do all of this via an ssh terminal connection to the Mac.)
cd Misc
git clone https://github.com/trebisky/H743.git
cd H743
cd blink1
make
arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -Os -c blink.c
arm-none-eabi-as locore.s -o locore.o
arm-none-eabi-ld.bfd -T blink.lds -o blink.elf blink.o locore.o
arm-none-eabi-objdump -d blink.elf >blink.dump
Wow! Would you look at that? It just works! The end product is "blink.elf" and at this point we would like to load that into the board and see if it runs.

The trick now is to pry the board out of the darn blister wrap that ST ships it in and to find a micro-USB cable -- along with a USB-C to USB-A adapter. I do this and plug it in.

We get LED's! Three of them.

A bright green one next to the power select jumpers.
A big red one next to the ST-link USB connector.
A blinking green one among the three user LEDs
The blinking LED is probably blinking because the board is running the code I loaded into it a year ago.

Using OpenOCD to download code

The makefile has a "make flash" entry. It fails because it cannot find the config file I used on my linux system:
/usr/share/openocd/scripts/interface/stlink-v2.cfg
This is not at all surprising. I do some searching and am told that current versions of OpenOCD don't use stlink-v2.cfg but now use a unified file named interface/stlink.cfg. We will also need a target config file
target/stm32f4x.cfg
I eliminate the full path and let OpenOCD do something on its own and use this command:
make flash
openocd -f interface/stlink.cfg -f target/stm32h7x.cfg -c "program blink.elf verify reset exit"
And it works!! I thought there might be some tricky issue of setting up USB drivers or permission -- but it is simple and clean and just works. I get this output, which is familiar and normal:
Open On-Chip Debugger 0.12.0
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1800 kHz
Info : STLINK V3J2M1 (API v3) VID:PID 0483:374E
Info : Target voltage: 3.293173
Info : [stm32h7x.cpu0] Cortex-M7 r1p1 processor detected
Info : [stm32h7x.cpu0] target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32h7x.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000646 msp: 0x20020000
Info : Unable to match requested speed 4000 kHz, using 3300 kHz
Info : Unable to match requested speed 4000 kHz, using 3300 kHz
** Programming Started **
Info : Device: STM32H74x/75x
Info : flash size probed value 2048k
Info : STM32H7 flash has dual banks
Info : Bank (0) size is 1024 kb, base address is 0x08000000
Info : Padding image section 0 at 0x08000108 with 24 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x08000120 .. 0x0801ffff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
The green LED is blinking much faster now. I edit the code and change one parameter to slow down the blinking.
make
make flash
It is all very fast. And the LED blinks at about 1 Hz now.

Conclusion

All of this took me perhaps 20 minutes and there were no tricky issues along the way. This is something entirely new (for me), doing embedded code work using cross compilers hosted on the Mac Mini.

At some point I want to play with the offical "STM32Cube" code tools from ST. The main point of that would be to find out if I can quickly get access to USB and/or ethernet libraries. I have peeked at their code base before and it is intricate and ugly -- but if I stay at a higher level and ignore details (like I think they intend their users to do), It might be useful.


Have any comments? Questions? Drop me a line!