Some progress with the OpenGD77 Tier 2 functionality

posted in: DMR, GD-77, Ham radio | 11

Now that the Hotspot mode functionality is relatively stable, I’ve switched my efforts to supporting DMR Tier 2 in the OpenGD77 firmware.

Kai (DG4KLU) told me a couple of months ago, that he had been working on the Tier 2 functionality, but was unable to get it to work correctly, and that he no longer had any spare time to work on the OpenGD77 firmware.

Colin G4EML had some time recently to help with the OpenGD77 firmware, did some tests to try to understand how we could move forward with the Tier 2 functionality, but came to the conclusion that there appeared to be fundamental problems with the existing DMR Tier 1 programming code. These problems mainly related to the inaccuracy of the timing control, or possibly because different triggers from the HR-C6000 DMR DSP chip could be processed in the wrong order by the existing DMR programming code.

So I set about doing a major overhaul of Kai’s original DMR code, to resolve the potential problems which Colin had found.

The biggest change was to move all of the code that relates to handling the interrupts from the HR-C6000 from being processed as part a “task” in the Realtime Operating System  (RTOS) which the firmware uses, to being handled by Interrupt Service Routines.

To roughly explain what this means in layman’s terms, the RTOS is set to run the DMR code, once per millisecond. This code checked if the HR-C6000 had flagged that it needed some attention, and then processed that request.

The problem with this system, is that the worst time delay between the HR-C6000 flagging it needs to be dealt with, to it actually being deal with, could be as much as 1 millisecond, and with a protocol like DMR, a 1 millisecond delay may be too much.

Moving the code from the RTOS task to an Interrupt Service Routine, is not just a matter of cutting and pasting the code, because the time that can be spent in an ISR is very small, so that for example its not possible to run the AMBE audio codec from inside the ISR. Also the ISR can’t use any RTOS system functions which are intended to prevent resource conflicts e.g. 2 parts of the firmware accessing the same hardware at the same time, so any potential hardware conflicts need to be handled some other way.

The hardware in question is the HR-C6000 DMR DSP chip its self, which has 3 digital interfaces, ( two SPI buses and a I2S bus), and in practice the only way to prevent bus contention on was to move all the SPI related functionality inside the ISR. Well, actually the initialisation code is not in the ISR, and nor is the code which initially configures the HR-C6000 to go into transmit mode when its completely idle, but when its idle I was able to briefly disable the interrupts so that I can use the SPI bus outside of the ISR’s.

This radical modification of the code took me about two weeks, and at the same time I had to modify a lot of other code related to operating in duplex mode, including changing the Tx / Rx switching system to completely be able to change from Rx to Tx every 30mS while the radio is transmitting, as well as being able to change the Tx / Rx frequencies at the same time, and switching the PA off and pre-amps on etc etc etc.

I finally got the simplex functionality working again, but in the process I broke the Hotspot mode functionality, and it took another day to get that working again.  Currently Hotspot mode may not be 100% stable, as I had a report that it crashed while transmitting after about 6 hours of use. However , since Hotspot mode works OK in the old Tier 1 firmware this is not a priority for me at the moment, and anyone wanting to use Hotspot mode can old the older stable Tier 1 firmware.

After the overhaul, I found I was able to transmit to my duplex hotspot, as long as I woke-up my hotspot using GD-77 running the official firmware.
Strangely I found that I was also able to wake up my local Motorola based repeater, if I transmitted for around half a second and then released my PTT, whereas continuing to hold the PTT and keep talking failed to wake the repeater. In theory the firmware should not be waking the repeater at all.
Kai has now sent me some code he wrote which is designed to wake up a repeater, so I will attempt to integrate his code into my new structure and see if it works, or if I need to make modifications or perhaps write it again from scratch.

What I can’t get working at the moment is the Timeslot selection.
The existing DMR code, which Kai wrote, seems to somehow be locking onto the currently active Timeslot, so that if someone wakes up the repeater by transmitting on Timeslot 2, I’m normally able to have a QSO with them on TS2. But is someone wakes up the repeater and starts to have a QSO on Timeslot 1, the firmware is only able to communicate with them, and not to put a call out on Timeslot 2.

In theory there are several “registers” in the HR-C6000 to determine the current Timeslot that is being received, but these are not working for me, and I suspect that they don’t work unless the HR-C6000 correctly initially locks onto the DMR frames based on their TS code correctly.

Overall, I’m very optimistic that Tier 2 will definitely be possible in the OpenGD77 firmware, but its hard to know now long its going to take me to resolve the remaining issues, as currently I am the only person actively working on the project.

11 Responses

  1. ON8AD
    |

    One can only admire the time and effort you’re putting into this project, Roger. Awesome stuff!

  2. ken
    |

    many thanks for all your work

  3. Oliver Vom Hofe
    |

    Ich sage auch mal vielen Dank und was länger dauert wird ewig gut 😉 73

  4. Alex
    |

    Your efforts are truly impressive and inspiring, thanks for your dedication torwards the community.

  5. Ronualdo - PU4RON
    |

    Congratulations for the victory, we are hoping that all is well. Many amateurs in Brazil are enjoying the firmware and thanks for making it available to everyone.

  6. Carlos
    |

    Roger: Muchas gracias por tu dedicación a este proyecto, yo soy de México y comencé a experimentar con mi GD77, pero tengo el mismo problema que se ha tratado anteriormente, no obstante de no haber recibido aviso de virus o de falta de firma de los controladores y haberse instalado el driver del nuevo controlador correctamente, no logro que el CPS lea o escriba el radio….. (no lo encuentra a pesar de cambiar manualmente el numero del puerto com)

    Al utilizarlo con bluedv en celular android, funciona perfectamente, pero no puedo acceder a la programación del radio a través de la pc, no obstante de haber reinstalado tu CPS y los contraladores, utlizo win7 en una I3

    Se podrá añadir al CPS una ventana para selección del puerto com? (pensando que esta pudiera ser la falla) creo que muchos radioaficionados estamos atorados con el mismo problema….

    Otra sugerencia:

    Como sabes algunos radios Baoefing no soportan el tier2, por lo que el uso con mmvdm es posible, mas no usándolos con repetidor porque transmiten de manera simultanea en ambos tiempos, para que puedas dejar la opción de usarlo solo en simplex como hasta ahora, o en modo repetidor, una vez que termines con el proyecto de tier 2 (solo es una sugerencia)

    Realmente muchas gracias y felicidades.

  7. Theodoros
    |

    Thanks for the nice firmware congratulations.73 de sv1we from Athens.

  8. Hi Roger,
    Thanks very much for your great work. I have tested my longrange openGD77 Hotspot with Theo SV1WE using our MD-380 radios and openGD77 Hotspot openGD77 HotSpot achieving a few kilometres range with great success. I can’t wait for our next holiday in the sun when I will be taking my openGD77 Hotspot and DMR Radio as an essential piece of kit, probably next year!
    I must make this go-BOX for the new openGD77 longrange HotSpot.
    Please keep up the good work!
    73 de Demetre M0SUY/SV1UY

  9. Antonio
    |

    Ciao Roger, grazie per l’ottimo lavoro fatto con il GD 77. Ne ho realizzato uno e và benissimo. E’ possibile mandare ogni 10 minuti un beacon?
    Grazie per la risposta
    73′ de IW0DT Antonio – Bracciano (Roma)

  10. Mike
    |

    Hi Roger. I do admire the work in this project. Awesome method to provide a portable high power hotSpot with a decent front-end as well as revive the use of a older radio.

    In reading this section: This radical modification of the code took me about two weeks, and at the same time I had to modify a lot of other code related to operating in duplex mode, including changing the Tx / Rx switching system to completely be able to change from Rx to Tx every 30mS while the radio is transmitting, as well as being able to change the Tx / Rx frequencies at the same time, and switching the PA off and pre-amps on etc etc etc.

    It is my understanding that the repeater or in this case the GD-77 would be transmitting full time and also need to provide the syncing for the slots to 1 or 2 user radios. But is the GD-77 able to operate full duplex so that it can hear 1 or 2 user radios Tx’ing into the GD-77. Just my two points.

    Regardless, the single-slot hotspot firmware is a great contribution to the DMR community. Thanks and 73, — Mike, NO7RF

  11. Roger Clark
    |

    Since posting this post I have made some more progress and I now have a functional Tier 2 system.

    However it has a lot of bugs at the moment so it will be some time before I make it generally available.

    I will do another post, when and if I manage to fix the bugs, but at the moment , I am having to try many different ways to do things, because I do not have any good documentation on the HR-C6000 DMR DSP which handles all the DMR synchronisation and modulation and demodulation etc

Leave a Reply