Skip to content

GD32H759 + fireDAP: build, flash and stop at main on macOS ​

Does a successful flash mean the board is running correctly? This LED example checks four separate things: building a binary, writing Flash, observing execution and stopping at a source line.

The hardware was an Embedfire GD32H759 board and fireDAP probe, with an Apple Silicon Mac. The versions and results below come from the September 11, 2026 session; no vendor IDE was used.

First, identify the target ​

fireDAP connects to the Mac over USB and to the board over SWD. Its CMSIS-DAP v2 bulk endpoint carries debug commands; a separate CDC endpoint exposes /dev/cu.usbmodem* as a virtual serial port.

ItemConfiguration / observation
ProbefireDAP, USB VID:PID 1FB9:5601
MCUGD32H759, Cortex-M7 r1p2, 600MHz
SWD identityDPIDR 0x0bd12477
pyOCD0.45.1, target gd32h759ig, SWD 1MHz
Flash algorithmGigaDevice.GD32H7xx_DFP.1.5.0.pack
Compilerxpack arm-none-eabi-gcc 15.2.1
MemoryFlash 0x08000000 / 3840K; RAM 0x24000000 / 512K

At the time, the public pyOCD pack index did not list GD32H7. The DFP had to be extracted from GigaDevice’s AddOn package and selected with --pack. Detecting a Cortex-M7 proves the debug connection works, not that Flash programming is ready; that also needs the matching algorithm.

A successful build is not a running board ​

The project used a GCC/CMake template. This build took about 9 seconds and produced ELF, hex and bin files, using 2772B of Flash. Keep the ELF: its symbols are needed for debugging.

One template detail was easy to miss: compilation selected -mcpu=cortex-m7, but linking selected cortex-m3. Both had to target M7 before investigating board behavior.

Toolchain downloads were another obstacle: the original source timed out twice, and a roughly 294MB GitHub download ran at about 48KB/s. Caching the downloaded package on our server made it reusable across machines. This is a cache, not a speed guarantee; verify the official SHA256 after downloading.

After flashing, check that it is executing ​

pyOCD erased one sector and programmed one page at about 25–37 kB/s. Reading back the vector table at 0x08000000 gave an initial SP of 0x24080000 and a Reset vector in 0x08000xxx, matching the binary.

That checks the written data, not the LED logic. After resetting and running, we halted roughly every 0.7 seconds, read GPIOC OCTL (0x58020814), then resumed execution.

SampleGPIOC OCTL
10x800
20x200
30x1000
40x400

The four samples captured four LED output states, showing that execution was progressing. They are sparse samples, not a trace of every LED transition. Halting also disturbs timing, so this table does not establish an exact period.

Finish at main, not at “connected” ​

GDB connected to pyOCD gdbserver using extended-remote :3333. With the same symbol-bearing ELF loaded, the first halt showed delay_1ms(count=500) at systick.c:68. Resetting then hit the breakpoint at main.c:60 (address 0x08000494 in this build).

gdb
file build-gcc/gd32H7_gcc.elf
target extended-remote :3333
break main
monitor reset halt
continue
bt
info registers

If execution is already inside while(1), setting break main and continuing will not return it to startup. An apparent hang need not mean the connection has failed.

Appendix: failures encountered and sources
SymptomWhat worked in this session
DebugPortSetup No ACKOpenOCD worked on the same connection; pyOCD succeeded with -O frequency=1000000. This does not rule out wiring faults in other No ACK cases
Unable to open deviceStop the gdbserver holding the probe before flashing
GD32H7 not foundSpecify the DFP pack explicitly instead of relying only on the online index
GCC download blockedCache a verified release. A zig cc detour was abandoned because it required source trimming, linker-script changes and compromises around libc/gdb

This session used pyOCD 0.45.1. OpenOCD 0.12 with stm32h7x.cfg was also used to check connectivity. Addresses, source line numbers and timings belong to this example and environment, not every GD32H7 project.

Something unclear here, or want to talk about similar work?Message me →