OK2MOP / MD1702-tools

Tools to work with firmware and SPI flash data of DM-1702 and DM-X radios
24 stars 6 forks source link
dfu dm-1702 dmr firmware-updater

MD1702 USB Tools

by Pavel Moravec, OK2MOP

Introduction

This repository contains tools for working with the MD-1702 based radios over USB. It is based on the reverse-engineered communication protocol and can be used with Baofeng DM-1702 (V02 and L02 firmware branch) and DM-X radios (theoretically also with DM-1703 and other radios sharing this codebase).

Please do NOT use it to write data to a device with L05 firmware and MD1706-V2 version of the bootloader, as it is not tested and it was reported to brick the device in the issues. (The tool is working with L05.000.05 firmware itself on older MD1702-V1/V2 devices).

Please do not remove safety checks in the code concerning the device/bootloader version, they are there as a protection against bricking the radio.

I have tried to make the tool similar to popular md380-dfu tool by Travis Goodspeed, KK4VCZ. The stm32-dfu from his repository could be used if somebody wants to switch the CPU to internal STM32 bootloader mode, but it is not necessary.

As the radio is detected by Linux incorrectly as an USB lp port, the driver must be removed for the device.

Client Tools:

Using md1702-rec

Clone and build patched dsd from https://github.com/OK2MOP/dsd/ to be used with the recordings

md1702-rec readrec prefix # you may also add start date, e.g. "2019-01-02 22:00:11"
for i in prefix*.dmr ; do path_to_built_dsd/dsd -w $i.wav -r $i ; done

Requirements:

Optionally, if you want to specify date on command line in other formats

If you wish to manipulate the Boot logo graphics, you will also need

This project should work across Linux, and should work on Mac OS, and Windows, but has not been tested on them platforms. A separate client,

Additional steps for Linux-based installations with udev rules

# Clone the repository to MD1702-tools
cd MD1702-tools
sudo cp -r udev/* /etc/udev/

(The 59-baofeng-1702.rules and unbind_bao1702.sh files are copied to /etc/udev/ in order to allow users to access the radio over USB without having to use sudo or root permissions and remove the driver. User should be a member of dialout group. If it is not, you may use sudo usermod -a -G dialout $USER to add your user, then log in and out).

If you do not wish to modify the udev, and you do not use any other usblp device, you can prefix the md1702-dfu each time with sudo modprobe -r usblp;

Flash updated firmware for Linux-based installations

To update firmware, an unencrypted firmware image is required.

Turn on radio in DFU mode to begin firmware update with USB cable: