VK3KYY wrote: ↑Mon Feb 13, 2023 8:08 pm
Do any of the pins to this chip support UART RX? Because it could be an easy way to connect a GPS module
You read my mind!
That's my next step if I manage to make the firmware work and make the radio usable (as there is no flash, I can't use voice prompts, but I've developed on paper a way to operate the radio just using beeps and the stock screen).
Luckily enough, the pins you can see in the second picture between the orange and yellow cables I (quite badly) soldered are conveniently connected to the ports A1 and A2, which are the UART0 pins. So adding a GPS will be extremely easy and that was my plan since the start.
VK3KYY wrote: ↑Mon Feb 13, 2023 8:18 pm
Did d you just flash the GD77 bootloader in this radio, ?
The problem however could be the GPIO pin mapping of SK1 and SK2
It would be possible to hack the bootloader e.g. using Ghidra, but its not easy.
NXP publish an example bootloader, but I can't remember if it uses HID. I did not have time to investigate it.
I haven't done anything yet. I'm considering two options. In fact, you recommended them several months ago when you helped me out in another thread.
I can't thank you enough. I've been really busy so I couldn't start with this project until a week ago.
My first option is to modify the linker files, VTOR, etc (I'll investigate where else) so the program starts at 0x00 instead of at 0x4000. I'm gonna be always flashing the firmware via SWD, as SK1 and SK2 are mapped somewhere else. If this doesn't work, I'll just manually add the GD77S bootloader to the start of the firmware (only start the actual firmware, not flash it or anything else) and still flash everything via SWD.
I think it's easier to program the MCU via SWD as changing SK1 and SK2 in the bootloader would be a nightmare (decompiling, understanding it, etc.). Making the firmware work is hard enough and all that work only with the bootloader would be a waste of time. I can just add some kind of flat 4-pin cable through the casing and hide it behind the battery, in case in the future I wanna modify the firmware without opening the radio. Also, the USB pins are connected to the UART0 terminals I'll be using for the GPS (I don't know who designed this radio but they did a horrible job), so if I add the GPS, USB communication won't be possible. The original firmware used UART instead of USB to connect to a PC (and the cable had an UART to USB converter).
VK3KYY wrote: ↑Mon Feb 13, 2023 8:18 pm
However the HD1 is / was very expensive, and because it uses the same CPU as the GD77, I suspect it is no longer being manufactured.
I think this radio is also not being manufactured. That's why this won't be useful for many people I think. But still I'm gonna try to do it (already erased the MK22 ROM, so there's no turning back
)
VK3KYY wrote: ↑Mon Feb 13, 2023 8:25 pm
Most radios have very similar calibration settings, so it would not be a big problem.
Originally the OpenGD77 did not read the calibration data at all.
The codeplug could potentially be stored in the MCU ROM. However there is no space after the OpenGD77 firmware is loaded.
I'm just gonna add my DM-1801 calibration data to a variable and that'll work fine. In the future I'll manually adjust it, but that's the least of my concerns.
At the moment I'm just gonna load a couple channels as variables. When I get it working, I'll free a lot of space by removing all the language strings (my screen is a 7-segment display so I don't need them) and create a codeplug in a .h file. There's no point in storing the codeplug separately as USB communication won't be possible once I add the GPS, so all the channels will be in the firmware (I know it's a dirty solution, maybe in the future I'll think of something, like modifying the hardware so UART doesn't interfere with USB). Also I don't have the sources for the CPS, and even if I did, it might be too much work to create a working CPS for this radio with no flash or EEPROM, when I can just compile a binary with my channels.
I will be using a section in the ROM to store the settings, but that's the last step, and it doesn't take that much space.
VK3KYY wrote: ↑Mon Feb 13, 2023 8:25 pm
There is a large area of the official ROM which is merged , by the CPS, with the OpenGD77, But some of it is probably not used by the AMBE codec. However its impossible to know the area used by the AMBE codec.
Possibly you could compile the AMBE codec used by DroidStar, but you may have legal problems if you distributed it
I obtained the codec bin sections by extracting them from an MCU ROM dump from my DM-1801. If I make this work I'll be happy to share the source and the whole (complicated) process to add the channels, compile it, and send it to the radio with a JLink. However, I won't be providing the codec sections (but they are really easy to obtain).
Maybe if in the future this radio is produced again and the bootloader and encryption is cracked, it'll be worth all the work to find a way to flash the firmware and the codeplug via USB. But I'm not sure that'll happen, especially with the MK22 shortage, manufacturers changing chips like with the DM-1801, etc.