Port to TYT UV380/UV390

Post Reply
ZL1GW
Posts: 13
Joined: Sun Mar 22, 2020 10:41 pm
Location: Auckland, New Zealand
Contact:

Port to TYT UV380/UV390

Post by ZL1GW » Sun Mar 22, 2020 11:15 pm

Hey guys, first post and I'm jumping right in.

First of all, thanks to the developers of this project for their hard work! This is an exciting contribution to the community.

I'm VERY interested in this project, I have a TYT-MD-UV390 right now, and am ordering a DM-1801 to experiment with this firmware.

The UV380/390 is an inexpensive dual band DMR radio similar to the GD-77 and DM-1801, which has GPS capability, and is overall a pretty nice radio (larger screen, already pretty decent features, etc).

My initial investigation shows the TYT-MD-UV390 is based on the STM32F405VG processor, and has an HR C6000 baseband chip, meaning it might be compatible (or more specifically, a reasonable porting target) for this firmware with some modifications for UI (new screen layout, and keypad layout).

The official firmware is based on MicroC/OS-II and the firmware for the MD380/390 (predecessor to this radio, single band only) has already been reverse engineered at https://github.com/travisgoodspeed/md380tools

While that firmware is not directly compatible (different baseband), the radio is nearly identical as per the excellent teardown articles at:
part 1 - https://hvdnnotebook.blogspot.com/2018/ ... uv380.html
part 2 - https://hvdnnotebook.blogspot.com/2018/ ... art-2.html

Would be very interesting if we could port this. I've got a fair bit of experience on embedded development, and would be willing to help out also.

Once my DM-1801 shows up, I'll be able to experiment more hands-on with the existing code-base to get comfortable. But would be interested to hear from the devs of this project or the community on the following:
- What do you expect to be required to port this?
- Do you think porting to this radio is useful/valuable

Thanks!
73, ZL1GW

EA5GK
Posts: 6
Joined: Sat Nov 16, 2019 8:14 am
Location: Murcia - Spain
Contact:

Re: Port to TYT UV380/UV390

Post by EA5GK » Mon Mar 23, 2020 11:52 am

I also have a radio retevis rt3s clone tyt uv-390 and an experimental firmware would be a great idea for it. It has a better screen and more memory. I hope the project goes ahead. Thanks for the great work

IU2KIN
Posts: 18
Joined: Mon Mar 23, 2020 11:10 am

Re: Port to TYT UV380/UV390

Post by IU2KIN » Wed Mar 25, 2020 2:47 pm

Hi ZL1GW,
me and a friend (IU2KWO) are trying to port OpenGD77 to the MD-380/MD390G,
those radios are very well documented, thanks to the efforts of Travis Goodspeed and friends,
currently we are trying to flash arbitrary code through the TYT recovery.
I think we can share a lot of effort, PM me so we can get in touch.

73 de IU2KIN

VK3KYY
Posts: 2687
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia
Contact:

Re: Port to TYT UV380/UV390

Post by VK3KYY » Wed Mar 25, 2020 10:23 pm

IU2KIN wrote:
Wed Mar 25, 2020 2:47 pm
currently we are trying to flash arbitrary code through the TYT recovery.
You need to create a tool that will generate valid firmware files that the normal bootloader accepts.

Next you need to create a template project that has USB COM functionality.

Probably use the STM32Cube is a good starting point for a generic project file.

Next steps would be to write a display driver and also a keyboard handler, including the channel change control on the top of the radio, and all the buttons

Next get the RF chip working for FM.

Then write the drivers for the Flash and EEPROM

Then get the interfaces to the C6000 working, I2S and SPI

Then work on the DMR.

ZL1GW
Posts: 13
Joined: Sun Mar 22, 2020 10:41 pm
Location: Auckland, New Zealand
Contact:

Re: Port to TYT UV380/UV390

Post by ZL1GW » Thu Mar 26, 2020 9:46 am

IU2KIN wrote:
Wed Mar 25, 2020 2:47 pm
Hi ZL1GW,
me and a friend (IU2KWO) are trying to port OpenGD77 to the MD-380/MD390G,
those radios are very well documented, thanks to the efforts of Travis Goodspeed and friends,
currently we are trying to flash arbitrary code through the TYT recovery.
I think we can share a lot of effort, PM me so we can get in touch.

73 de IU2KIN
Unfortunately the MD380/390 and MD-UV380/390 are very different radios. The UV variants use a completely different baseband chip, as they are dual band, and have a different arrangement of memory chips on the mainboard, etc. The UV380/390 models are actually much closer to the GD77, which is why I was hoping I would be able to port the code over from OpenGD77 (of course as pointed out by VK3KYY would need a new keypad, and display driver, as well as possibly other peripheral driver code, etc, but once those are replaced, theoretically the bulk of the code should work as-is or with very minor tweaks).

I'd be happy to share anything I learn on this attempt, but unfortunately we'll likely not be able to benefit one another as much as you hope. (though as you indicate, you will be able to benefit more from Travis Goodspeed's work)
73, ZL1GW

User avatar
4I1RAC
Posts: 186
Joined: Thu Nov 28, 2019 5:25 am
Location: Philippines
Contact:

Re: Port to TYT UV380/UV390

Post by 4I1RAC » Thu Mar 26, 2020 10:15 am

I do have both platforms. MD380 as well as Retevis RT3, which is basically the MD390. I also have the MD-UV390.

The MD-UV390 uses C6000, similar to the GD77.

MD380 uses C5000 right? However, these have more documentation in terms of reverse-engineering. The MD-UV390 does not. I do recall that the MD2017 does have a partially working custom firmware in alpha stages--that might be similar to the MD-UV380/390.
Angelo, 4I1RAC / N2RAC
Brandmeister Philippines support team
Talkgroups
- 51518 bridged to DX1ARM Fusion repeater, Metro Manila
- 515058 bridged to DX1O Fusion Repeater, Metro Manila
- 98977 Opengd77, bridged to YSF Reflector 72170

https://n2rac.com

User avatar
F1RMB
Posts: 726
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France
Contact:

Re: Port to TYT UV380/UV390

Post by F1RMB » Thu Mar 26, 2020 11:44 am

Hi,
4I1RAC wrote:
Thu Mar 26, 2020 10:15 am
I do have both platforms. MD380 as well as Retevis RT3, which is basically the MD390. I also have the MD-UV390.

The MD-UV390 uses C6000, similar to the GD77.

MD380 uses C5000 right? However, these have more documentation in terms of reverse-engineering. The MD-UV390 does not. I do recall that the MD2017 does have a partially working custom firmware in alpha stages--that might be similar to the MD-UV380/390.
MD-3xx, RT3 are using STM32 MCU, unlike GD-77/MD-1801/860, which use the NXP's MK22.


Cheers.
---
Daniel
73 de Daniel.

VK3KYY
Posts: 2687
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia
Contact:

Re: Port to TYT UV380/UV390

Post by VK3KYY » Thu Mar 26, 2020 7:55 pm

RD-5R also uses the NXP K22


Does the UV-380 use the C6000 and AT1846?

ZL1GW
Posts: 13
Joined: Sun Mar 22, 2020 10:41 pm
Location: Auckland, New Zealand
Contact:

Re: Port to TYT UV380/UV390

Post by ZL1GW » Thu Mar 26, 2020 8:50 pm

VK3KYY wrote:
Thu Mar 26, 2020 7:55 pm
Does the UV-380 use the C6000 and AT1846?
Yes, it uses the C6000 for the baseband, and AT1846S chip for the SDR.
Processor is STM32F405VG

So I figured it's got all the properties of a cool target for this project:
- Budget radio, affordable
- Bigger/brighter screen, improved UI capability
- GPS capable (new peripheral to explore)
- Winbond 128K memory W25Q128FV (but the interesting thing is there is a pad on the mainboard for a second chip, allowing memory expansion relatively easily)
- 2 Models 380/390 are identical, the 390 is waterproof/rugged chassis.

Anyway, all that aside, I'm also interested in porting it just because I happen to own one lol...

But the radio is nice, and has worked well for me for the past while.

As I said I'll help with the process, but first need to get my hands on a DM-1801 so I can get hands-on with the codebase in a known platform first... Need to get comfortable before I get back into hardcore hacking...

That said if there are things you'd like me to try/test now that would help, I'm happy to attempt them. (though not quite ready to brick the radio, as I don't have an alternate yet, it's my only HT right now, and with everything going on, a working radio is important)

But I can certainly experiment with the firmware flashing tool, firmware files, etc... If you have any tips.
73, ZL1GW

ZL1GW
Posts: 13
Joined: Sun Mar 22, 2020 10:41 pm
Location: Auckland, New Zealand
Contact:

Re: Port to TYT UV380/UV390

Post by ZL1GW » Thu Mar 26, 2020 9:07 pm

Oh, one other thing. The UV380 and MD380 share a UI board... The PCB that handles the UI is identical between the 2 radios. SO... The existing open-source firmware attempt for the MD380 may benefit us there, we can likely discover details of the UI elements (keys/buttons/LCD) from their firmware and use them to jumpstart a port here...

Also the one thing we may be able to get from the Travis Goodspeed work is he broke the crypto on their firmware images and wrote his own DFU tool. I suspect the UV380 is at least "close" so that is a starting point for those aspects.

I realize the CPU is not the same (NXP vs STM32) but they are both CortexM4 chips, but base SOC peripherals would be different, etc... Shouldn't be too hard though as FreeRTOS should be able to be reconfigured fairly easily to target the STM32.
73, ZL1GW

Post Reply