
FusionFoundry: Adding D-STAR to the Baofeng DM-1701
Table of Contents
In the last post we taught a Baofeng DM-1701 (v1) DMR handheld to speak Yaesu System Fusion. That turned out to be the easy one. C4FM and DMR are close cousins, so the radio’s chips could do most of the work.
D-STAR is Icom’s mode, and it’s a different animal. This post is about getting it onto the same radio, in the same FusionFoundry fork of the open-source RadioFoundry firmware.
If you want the background on the mode itself first, read our How D-STAR works explainer.
Whose code is it?
Credit where it’s due. The D-STAR code itself was written for upstream RadioFoundry by Brian Henderson, in pull request 809. It was written clean room from the JARL D-STAR standard, and it was built for the DM-32UV, whose HR_C7000 chip has flat FM audio paths that suit D-STAR well. That code has already been used on air with Icom radios on the DM-32UV.
The DM-1701 doesn’t have those paths. FusionFoundry’s part was to bring it across to the DM-1701: a new way in and out of the radio for D-STAR’s signal, finding the RAM for it, and testing the result. As with the C4FM work, Claude helped with the port and, most of all, with the test harnesses.
Why D-STAR is harder than C4FM
C4FM worked on the DM-1701 because it shares so much with DMR. D-STAR shares almost nothing:
| DMR | C4FM (DN) | D-STAR | |
|---|---|---|---|
| Modulation | 4-level FSK | 4-level FSK | GMSK, 2 levels |
| Rate | 4,800 symbols/s | 4,800 symbols/s | 4,800 bit/s |
| Pulse shape | root raised cosine | root raised cosine | Gaussian |
| Voice codec | AMBE+2 half-rate | AMBE+2 half-rate | AMBE 3600x2400 (the older AMBE) |
Two problems fall out of that table.
- The modulation. The HR_C6000 is a 4-level FSK chip. It has no GMSK modem, and no setting turns one on.
- The voice codec. D-STAR uses the original AMBE codec, not AMBE+2. The radio’s vocoder only speaks AMBE+2, so for D-STAR it’s no help at all.
The signal path
The trick is the same one C4FM used: stop treating the DMR chip as a DMR chip.
Receiving. The HR_C6000 can hand the processor a copy of the FM discriminator audio, from 0 to 3,400 Hz with every receive filter switched off. That’s raw enough for a GMSK demodulator. The demodulator runs on the STM32: it removes any DC offset from frequency error, finds the bit clock from the zero crossings, and decides each bit in the middle. From there the D-STAR framing takes over: the radio header with its callsigns, the voice frames and the slow data.
Transmitting. Here’s the neat part. D-STAR’s GMSK is 2-level at 4,800 bit/s. The HR_C6000 already has a pipe that sends 4,800 symbols a second for DMR. Use only its outer two levels, a 1 as +3 and a 0 as −3, and it sends a 2-level signal at ±1,200 Hz deviation. That’s D-STAR’s deviation.
It isn’t quite real GMSK. The chip shapes each symbol with DMR’s root raised cosine pulse, not D-STAR’s Gaussian one. A D-STAR receiver will see a little more overlap between neighbouring bits than it would from an Icom radio. Our own demodulator decodes it cleanly, and it’s good enough to make contacts, but it’s one reason this isn’t a match for a real D-STAR radio (more on that below).
A software AMBE codec
The voice codec was the bigger job, and it’s Brian’s work in the upstream code: an AMBE 3600x2400 encoder and decoder in software, in integer maths, small enough for a 168 MHz processor with no hardware help. The decoder is based on the ISC-licensed mbelib. The encoder was tuned against Icom radios, which showed that a real DVSI encoder doesn’t make the same choices mbelib would guess. There’s also a speech leveller so loud voices don’t hit the decoder’s ceiling on the other end.
On the DM-1701 the codec has to share the radio with everything else, which brings us to RAM.
Finding the RAM
The DM-1701’s STM32F405 has 192 KB of RAM and it was already nearly full. Three things make room:
- The codec borrows the DMR vocoder’s memory. D-STAR and DMR never run at the same time, so the codec uses the vocoder’s working block while a D-STAR channel is in use. This is the same trick C4FM’s VW mode uses.
- One mode area. D-STAR’s engine and C4FM’s engine share one block of memory. Only one of them runs at a time.
- The IP gateway is left out. FusionFoundry’s DM-1701 build drops the USB network and its services to make room for C4FM and D-STAR.
If the memory still can’t be found, the radio says so instead of failing quietly:

Left: like C4FM, D-STAR refuses to transmit without your callsign. Right: what you’d see if the codec couldn’t get its memory.
Using it
A D-STAR channel lives in the codeplug like any other, with the kind DV. You set your callsign and a short message once for the whole radio, and each channel has its UR (who you’re calling) and, if you’re working through a repeater, the repeater’s callsign.

Left: simplex, calling CQ. Right: the same channel set to go via a repeater. The module letter goes in the eighth place of the repeater’s callsign, as D-STAR expects.
Press # on Home for the D-STAR page. Each row sets UR for you, the job you’d otherwise do by typing callsigns:

Top left: the menu. Top right: typing a reflector. Bottom left: ready to link to REF030 C. Bottom right: ready for an echo test.
- Call CQ and Call last caller set UR for now, until you change channel or press Back on Home.
- Echo test: the next over asks the gateway to play you back, so you can hear how you sound.
- Link reflector takes the reflector the way people write it (REF030C, REF030CL and REF30C all work) and builds the eight-character link command itself. Unlink and Gateway info are rows 6 and 7. A one-letter command always goes in the eighth place of UR, however it was typed.
- Echo, link, unlink and info go out with one over, then UR goes back to the channel’s.
- Rows 8, 9 and 0 set My call, the four-character suffix and the message.
Receiving and transmitting

Left: a call coming in, with the caller’s callsign and suffix, the route through the repeater and their slow-data message. Middle: Home remembers who you last heard. Right: transmitting through a repeater.
On receive the radio shows the caller, their four-character suffix, who they were calling, the repeater route and the 20-character message from the slow data. On transmit it sends a preamble long enough for the radio to settle after key-up, the header, then voice frames with your message in the slow data, then D-STAR’s end pattern.
Testing it
The upstream code arrived with its tests, and they were the safety net for the port:
- Test vectors for the header coding, the framing and the slow data, from an independent reference written from the standard.
- Headers recorded off air from an IC-9700 and an ID-51. Our header coder has to build exactly the same bits from the same fields. That catches the kind of mistake a home-made reference would share with the code it tests.
- The modem on the host. The DM-1701’s route, DMR-shaped symbols in, goes through the GMSK demodulator on the computer before it ever goes near the radio.
- A host test of the whole radio core, switching between DMR, D-STAR, C4FM and FM.
As with the C4FM work, AI was most useful here, building harnesses and replaying captures until the bugs had nowhere to hide.
A fair warning about the audio
It works, and you can make QSOs with it, but the audio quality isn’t great. D-STAR has been squeezed onto a radio that was never built for it: GMSK sent through a DMR chip with the wrong pulse shape, and the voice codec running in software on a small processor instead of a proper AMBE chip. That shows in how it sounds.
Have a listen and judge for yourself. First the DM-1701, then an Icom ID-52 for comparison:
Treat it as a fun experiment and a way to try D-STAR on a radio you already own. If D-STAR is going to be your main mode, you’re much better off with a proper D-STAR radio.
What isn’t done yet
- Audio quality. See the warning above. There’s room to improve the codec and the transmit pulse shape.
- Deviation still needs measuring off air with proper test gear.
- D-STAR’s fast data (DD mode) isn’t written. This is DV voice with slow data only.
Can I try it?
Not yet. FusionFoundry hasn’t been published. As with C4FM, the plan is to offer the DM-1701 route back to upstream RadioFoundry on top of Brian’s D-STAR pull request, so it ends up where everyone can use it.
Licence note: in the UK, D-STAR belongs in the digital voice parts of the band plan, the same as C4FM and DMR. If you link to a reflector, you’re on the air through every gateway connected to it, so identify as you would anywhere else.


