Skip to main content

Firmware Upgrading a NanoVNA-H4 from macOS

· 4 min read
Shaw Innes
Builder of things

Most NanoVNA firmware guides assume you're on Windows with ST's DfuSe utility. You don't need it — the STM32 in the NanoVNA-H4 speaks standard USB DFU, and dfu-util on macOS handles the whole job in one command.

1. Install dfu-util

brew install dfu-util

2. Work out which firmware you need

Flip the unit over and read the sticker on the back. It tells you the hardware revision and the variant — mine says 4.4 ZK. This matters: the H4 has shipped with different displays and RF switch arrangements, and flashing the wrong variant gives you a device that boots but produces garbage sweeps.

Download the matching release from hugen79/NanoVNA-H. For a 4.4 ZK board that's the NanoVNA-H4-ZK_*.dfu file — grab the .dfu, not the .bin.

3. Boot into DFU mode

Power the NanoVNA on while holding the multi-function switch (the little jog stick) pressed in. The screen will stay black — that's correct, it means the ST bootloader is running rather than the application firmware.

Now plug it into the Mac. Use a cable you know carries data, not a charge-only one.

4. Confirm the Mac can see it

dfu-util --list
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [0483:df11] ver=2200, devnum=1, cfg=1, intf=0, path="1-1", alt=1, name="@Option Bytes /0x1FFFF800/01*016 e", serial="…"
Found DFU: [0483:df11] ver=2200, devnum=1, cfg=1, intf=0, path="1-1", alt=0, name="@Internal Flash /0x08000000/128*0002Kg", serial="…"

Two things to note. 0483:df11 is ST's DFU bootloader, so the device is in the right mode. And there are two alternate interfaces — alt=0 is the internal flash you want to write, alt=1 is the option bytes, which you do not want to touch. The .dfu file targets alt 0 itself, which is the main reason to prefer it over a raw .bin.

If nothing shows up, it's almost always the cable or the button hold. Unplug, power cycle with the switch held in, and try again.

5. Flash it

dfu-util --download NanoVNA-H4-ZK_20260516.dfu --reset
dfu-util 0.11

...

Match vendor ID from file: 0483
Match product ID from file: df11
Multiple alternate interfaces for DfuSe file
Opening DFU capable USB device...
Device ID 0483:df11
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #1 ...
Determining device status...
DFU state(10) = dfuERROR, status(10) = Device's firmware is corrupt. It cannot return to run-time (non-DFU) operations
Clearing status
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Option Bytes "
dfu-util: Non-valid multiplier ' ', assuming bytes
DfuSe interface name: "Internal Flash "
File contains 1 DFU images
Parsing DFU image 1
Target name: ST...
Image for alternate setting 0, (1 elements, total size = 87984)
Setting Alternate Interface #0 ...
Parsing element 1, address = 0x08000000, size = 87976
Erase [=========================] 100% 87976 bytes
Erase done.
Download [=========================] 100% 87976 bytes
Download done.

A couple of lines in there look alarming but aren't:

  • Device's firmware is corrupt — this is the bootloader reporting leftover status, not a verdict on your device. dfu-util clears it on the next line and carries on.
  • Non-valid multiplier ' ', assuming bytes — ST pads the interface name with spaces and dfu-util grumbles about parsing it. Harmless.

The --reset flag makes the NanoVNA restart into the new firmware once the download finishes, saving you a power cycle. Don't unplug it while the erase or download bars are moving.

6. Afterwards

The unit should come up with the normal display. Check Config → Version to confirm the build date matches what you downloaded, then re-run your calibration — stored cal data doesn't reliably survive a firmware change, and a stale cal will quietly ruin your measurements.