• Stars
    star
    804
  • Rank 56,681 (Top 2 %)
  • Language
    C
  • Created about 9 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Firmware patches for the TYT-MD380 handheld radio.

MD380Tools -- Firmware Patches for the Tytera MD380

by Travis Goodspeed, KK4VCZ

The Tytera MD-380 is handheld radio transceiver for DMR and FM. In 2015, this project began patching that firmware by replacing the byte of the Chinese font with our own code, fixing bugs in the original firmware and adding new features that are useful to the amateur radio community.

More documentation

Support

To support users by using the md380tools or the resulting patched firmware a Google Group is public opened and reachable via https://groups.google.com/forum/#!forum/md380tools. No extra registration should be necessary. You could also feed it via e-mail at [email protected]. So feel free to put in your questions into it!

A few of us are also on the #md380 IRC channel on Freenode.

A helpful site is available at http://md380.org/

There are also some related groups you may find interesting:

Introduction

This repository contains tools for working with codeplugs and firmware of the Tytera MD380, which is also sold under a variety of different brand names. The codeplug format is sufficiently similar to the radios from Connect Systems (CS700, etc) that these tools might someday be made compatible.

Client Tools:

  • md380-dfu reads and writes MD380 codeplugs and firmware.
  • md380-tool communicates with the patched firmware. (Fancy stuff!)

Development Tools:

  • stm32-dfu modifies firmware for jailbroken devices. (No longer required.)
  • md380-fw wraps and unwraps devices firmware.
  • md380-gfx modifies firmware graphics.

Build Status

Build Status

Supported Hardware

The patched firmware is known to work on the following devices:

  • The "D"-Version (NoGPS) for radios without GPS

    • Tytera/TYT MD380
    • Tytera/TYT MD390
    • Retevis RT3
  • The "S"-Version (GPS) for radios with GPS

    • Tytera/TYT MD380
    • Tytera/TYT MD390
    • Retevis RT8

Both types of vocoder (old and new vocoder radios) are supported.

The DMR MARC user's database required a 16 MByte SPI Flash memory chip. In some VHF Radios is only an 1 MByte SPI Flash installed.

Dual band radios such as the MD2017 and MD-UV380 series are not supported.

Known models

Name vocoder GPS exp FW original FW
MD-380 old N D02,D13 D02,D03
MD-380 new N D02,D13 D02,D13
MD-380G new Y D02,S13 S13
MD-390 new N D02,D13 D13
MD-390G new Y D02,S13 S13
  • RT3 = MD-380 (old)
  • RT8 = MD-390G

License:

This software is licensed in exchange for two liters of India Pale Ale, to be delivered at a neighborly bar, preferably one without televisions.

Tytera's firmware is of unknown license and is not included in this repository. We use a heap-less printf library under the BSD license.

Specifications:

  • The MD380 uses a custom variant of DFU that isn't quite compatible with the spec. Their code seems to be forked from an STMicro example for the STM32 chip.

  • Universal Serial Bus Device Class Specification for Device Firmware Upgrade, version 1.1: http://www.usb.org/developers/docs/devclass_docs/DFU_1.1.pdf

Requirements:

This project should work across Linux, Mac OS, and Windows, but has not been tested on all platforms. A separate client, MD380Tool, was under development for Android.

Preparation of build environment

Additional steps for linux based installations

git clone https://github.com/travisgoodspeed/md380tools.git
cd md380tools
sudo cp 99-md380.rules /etc/udev/rules.d/ 

(The 99-md380.rules file is copied to /etc/udev/rules.d/ in order to allow users to access the radio over USB without having to use sudo or root permissions.)

Flash updated firmware for linux based installations

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

  • change your MD380 language setting to English
  • insert cable into USB.
  • connect cable to MD380.
  • power-on MD380 by turning volume knob, while holding PTT button and button above PTT.

For non-GPS-models do:

git pull
make flash

For GPS-models do:

git pull
make flash_S13

Flash updated users database for linux based installations

Turn radio normally on to begin database loading with USB cable

For European users:

make updatedb_eur flashdb

Note: for European users it is probably illegal to use the other method for updating, due to privacy laws. (This is no legal advice, please consult your lawyer to be sure.)

For the rest of the world:

make updatedb flashdb

(The users.csv file located in the db directory must be refreshed this way, with make updatedb, otherwise it will continue using any already-existing users.csv file when running make flashdb.)

Convenient Usage:

Anything with md380-tool requires a recent version of our patched firmware. You can check your version in Menu/Utilities/Radio Info/Version. If it's a recent date you're good; if it's a number, you need to upgrade.

To dump the recent dmesg log, run md380-tool dmesg.

Firmware Compilation

This archive does not ship with firmware. Instead it grabs firmware from the Internet, decrypts it, and applies patches to that revision.

You can reproduce the patched firmware with make clean dist after installing an arm-none-eabi cross compiler toolchain. The firmware and a Windows flashing tool will then appear in md380tools-yyyy-mm-dd. Alternately, you can flash them from Linux with make clean flash, after starting the recovery bootloader by holding PTT and the button above it during a radio reboot.

Windows Firmware Installation

You can install any of these patched firmware files into your MD380 by using the respective .bin file with the Tytera Windows firmware upgrade tool, upgrade.exe, available inside their firmware upgrade downloads. Here are the steps:

  • Change your MD380 language setting to English
  • Turn off your MD380 using the volume knob.
  • Attach the Tytera USB cable to the SP and MIC ports of your MD380.
  • Attach the Tytera USB cable to your host computer.
  • Hold down the PTT and the button above the PTT button (not the button with the "M" on it).
  • Turn on your MD380 using the volume knob.
  • Release the buttons on the radio.
  • The status LED should be on and alternating between red and green, indicating you're in flash upgrade mode.
  • Start the Tytera Upgrade.exe program.
  • Click "Open Update File" and choose one of the .bin files produced from the process above.
  • Click "Download Update File" and wait for the flash update process to finish. It takes less than a minute.
  • Turn off your MD380 using the volume knob.
  • Disconnect the USB cable from your MD380 and host computer.
  • Turn the MD380 back on, and you should see the "PoC||GTFO" welcome screen. You're running patched firmware!

Codeplug Programming:

Reading and writing of raw Codeplug images is supported with the md380-dfu command. For graphical editing of codeplugs, you should probably use Tytera's MD80 CPS program or Dale Farnsworth's EditCP.

The beginnings of a plugin for CHIRP are also in this repository, but they were never completed.

More Info

Some articles from PoC||GTFO Volume 2

  • Jailbreaking the MD380, PoC||GTFO 10:8 (pocorgtfo10.pdf page 76.) by Travis Goodspeed
  • Running AMBE Firmware in Linux, PoC||GTFO 13:5 (pocorgtfo13.pdf page 38.) by Travis Goodspeed

Pat Hickey has some notes and tools up in his own repository, https://github.com/pchickey/md380-re

The OpenRTX project is making from-scratch firmware for the MD380 and other radios with the M17 Mode.

Customization

Previously we customized firmware images with new startup screens. This is presently broken.

More Repositories

1

goodwatch

Replacement board for Casio Calculator Watches using the CC430F6147
C
512
star
2

gbrom-tutorial

Tutorial for extracting the GameBoy ROM from photographs of the die.
356
star
3

goodfet

An embedded bus adapter for various microcontrollers and radios.
Python
312
star
4

loraham

Ham radio protocols and Arduino examples for LoRa on 70cm.
C++
267
star
5

maskromtool

A CAD tool for extracting bits from Mask ROM photographs.
C++
173
star
6

goodtag

RF430FRL152H examples for NFC Type V in Kicad and C.
C
65
star
7

GoodV

Android app for the RF430FRL152H and other NFC Type V tags.
Java
38
star
8

MD380Tool

An Android client for the patched 'md380tools' firmware.
Java
30
star
9

PyMetaWatch

Python client for the MetaWatch.
Python
28
star
10

goodhex

Good-enough Hex Editor/Annotator
Python
23
star
11

80211scrambler

Tools for working with the 802.11B scrambler when writing Packet-in-Packet exploits.
Verilog
17
star
12

lpc13-exploit

Minimal UART client in Golang that dumps LPC1343 chips that are locked at CRP1.
Go
15
star
13

symgrate2-binja-plugin

A plugin for Binary Ninja to query the Symgrate2 database.
Python
13
star
14

bsos

Berliner Spargel OS
C
12
star
15

nippertool

Modern exploit in Golang for ancient Nagra / Dish Network cards.
Go
12
star
16

pyspot

Python client for the SPOT Connect satellite beacon.
Python
12
star
17

symgrate2-ida-plugin

IDA Pro plugin to recovery static Thumb2 symbols.
Python
10
star
18

symgrate2-ghidra-plugin

A plugin for static Thumb2 symbol recovery in Ghidra.
9
star
19

cattool

Android app for controlling Kenwood transceivers.
Java
8
star
20

s80tools

Notes and scripts for the Doogee S80 smartphone/radio.
8
star
21

basicsynth

Clone of BasicSynth 1.5, for use with Daniel R. Mitchell's book of the same name.
C++
7
star
22

utftool

Quick command-line utility for playing with invalid UTF8 strings.
Go
6
star
23

codeplugtool

KK4VCZ's tool for programming the Kenwood TH-D74 .
Java
6
star
24

ecoworthyremote

Universal Radio Hacker and GoodWatch project for reverse engineering the Eco-Worthy Wireless Motor Controller.
5
star
25

myk78

Die photographs and panorama of the MYK78 Clipper Chip.
4
star
26

msp430simu

Fork of Chris Liechti's MSP430 simulator from the old MSPGCC project.
Python
4
star
27

wersi-slm2-51173

Z8 diffusion ROM dump of a Wersi SL-M2 51173 module.
Makefile
3
star
28

indextool

Quick and dirty tool in Go for editing indexes of large LaTeX books.
Go
3
star
29

goodpsk

Tool for experimenting with PSK31. Not a replacement for FLDigi.
Python
3
star
30

defyinggravity

A LaTeX conversion of the novel by Dean Brocious.
HTML
3
star
31

msp430static

An old Perl tool for MSP430 reverse engineering.
Perl
3
star
32

gbstrings

Quick GB2312 strings tool in Go for Chinese firmware.
Go
3
star
33

goodspot

QT Mobility client for the SPOT Connect on the N9
C++
2
star
34

odroidgo_hexedit

Simple hex editor for the ODROID GO, as an example for students.
C++
2
star
35

plc77-glitcher

Port of an antique smart card glitcher to modern Kicad.
2
star
36

nagrasm

Assembler for 6805 and ST7, based on asm68 by Eric Smith
C
1
star
37

good48

Python tools for working with HP graphing calculators.
Python
1
star
38

meegopkgsrc

NetBSD's pkgsrc for Meego
Perl
1
star