geary / AnyTone-D868UV

Unofficial issue tracker for AnyTone AT-D868UV and AT-D878UV radios and firmware
57 stars 1 forks source link

Question - Analog APRS support, and/or 878 firmware support #59

Open doronbc opened 5 years ago

doronbc commented 5 years ago

The D878UV, which appears to be the same hardware can generate an analog APRS message. Is the 868 capable of the same, and/or can the 878 firmware be loaded on the 868 with correct/expected results. Any response is appreciated.

Thanks and 73, Doron K1DBC

UB1AAM commented 5 years ago

Backup 868MCU.hex https://mega.nz/#!acJgyaJB!o7qB8AuF2fF_9r27N1nMZTfY5YPlGBCumWhvQO1diR0

EB5TC commented 5 years ago

Ohh my, excelent work!!! I have my 868 for sale but after see this, I want it again. Manual please!!!

Hotwire commented 5 years ago

So.. with this advancment, is it still only upgradable via ST-Link? or is it USB compatible now? Im confused with the previous remarks.

gymnae commented 5 years ago

I'm now in the process of dissembling the device. Should one lift out the metal baseplate or does the top plastic part above the battery cover still need to be removed somehow?

doronbc commented 5 years ago

@Hotwire no USB support yet. unless what @UB1AAM provided was this, i believe the boot area needs to be dumped from an 878, from there, somehow a package can be crafted that should allow for USB support. from page 15-17 of the datasheet, it shows the areas below, im not sure on the full range though, it could be 0x1FFF 0000 - 0x1FFF FFFF but again not 100% sure.

image

image

thank you again everyone for all the continued help to get this moving.

doronbc commented 5 years ago

@Gymnae and others wanting to try this, please see here for some disassembly instructions, be very careful though.

gymnae commented 5 years ago

@Gymnae and others wanting to try this, please see here for some disassembly instructions, be very careful though.

Thank you, now it's open. Being careful is important, the ribbon cables are flimsy

Hotwire commented 5 years ago

@Hotwire no USB support yet. unless what @UB1AAM provided was this, i believe the boot area needs to be dumped from an 878, from there, somehow a package can be crafted that should allow for USB support. from page 15-17 of the datasheet, it shows the areas below, im not sure on the full range though, it could be 0x1FFF 0000 - 0x1FFF FFFF but again not 100% sure.

image

image

thank you again everyone for all the continued help to get this moving.

This is the part I was trying to figure out a few months ago, the addressing was not very straight forward, and why wouldnt it start at 0x1FFF 0000... what is in between 0x1FFF 0000 and 0xFFF F810.. I couldnt wrap my head around it. Not that its easy or that Im any good at this. lol

g8ijy commented 5 years ago

The bootloader referenced above is the factory loaded ROM code. That is not used in the 868 or 878. The Anytone Bootloader resides at 8000000-8003FFF and is included in the dump provided by UB1AAM. With this loaded USB firmware updating now works.

doronbc commented 5 years ago

The bootloader referenced above is the factory loaded ROM code. That is not used in the 868 or 878. The Anytone Bootloader resides at 8000000-8003FFF and is included in the dump provided by UB1AAM. With this loaded USB firmware updating now works.

thank you, just to clarify though, an st link is still required to perform the initial conversion, is that correct? i think previous usb talks may have crossed a little, as its 2 separate usb issues.

g8ijy commented 5 years ago

Yes, you need to get the new bootloader loaded and the only way to do that is using ST-Link.

doronbc commented 5 years ago

Yes, you need to get the new bootloader loaded and the only way to do that is using ST-Link.

ok thanks for clarifying. i'm obviously not an expert, so if anyone has any thoughts about how this could be accomplished in software, feel free to share whenever you have time. i thought we would need to copy those other areas from an 878, but if not let me know.

Hotwire commented 5 years ago

So, the file provided above, I loaded it up in a HEX editor, it seems to be in Chinese.

prokrypt commented 5 years ago

Okay, my st-link arrived. Which end goes into where?!? I don't know how to computer img_20190103_170509

prokrypt commented 5 years ago

Well, one thing led to another and then suddenly this happened: img_20190103_190358

Hotwire commented 5 years ago

Well, one thing led to another and then suddenly this happened: img_20190103_190358

Great work, This is REALLY gaining momentum!

doronbc commented 5 years ago

great to hear of success on not only the 868 but also the btech. heres some further raw instructions if needed for anyone. if something needs changing or is wrong please feel free to correct. again just to re-iterate, this CURRENTLY requires an ST LINK, a software only mod is NOT yet available. but ultimately its up to this community to provide that, if you think you can eliminate the need for an st link, please feel free to do so.

pre reqs st link v2 - like this or any other clone along with male jumper wires, 30cm works somewhat larger would be better, may need to file down larger connectors st link utility the 878 hex provided by @UB1AAM, i believe if this taken down, it can still be recreated from the 1.10 firmware update 878 1.10 firmware and icons backup codeplug, it does seem to be retained, but it couldn't hurt to do so

  1. very carefully, disassemble the radio, keypad/speaker and screen do not need to be attached.
  2. attach the st link to the radio using the CLK, GND and DATA pins/cables to the correct holes on the radio board. the connections should not be pushed down too far, they either need to fit tightly, or if not tightly, they cables need to be somewhat taut to make contact in the correct area.
  3. holding down the radio or using a rubber band to keep the battery plugged in, turn the radio on to firmware update mode, holding down the ptt + the small top orange button, the led should start flashing red.
  4. connect the st link to computer via usb, open st link utility, even though @UB1AAM also provided a hex of the 868, it would probably be safe to still backup the existing flash your radio. in st link set the size to 0xFF800, default speed of 4,0 mhz and normal for mode is fine. select connect to target either from the upwards facing plug icon, or from target menu and connect. save the contents out to a bin/hex file.
  5. click on binary file or file menu open file and select the 878MCU.hex file from the pre-reqs.
  6. now select the icon with pen/paper or select target menu and program & verify.
  7. the radio should program and reboot, you may need to also manually turn it off an back on, and or perform a full reset if wanted.
  8. if it came back on fine, re-assemble the radio and apply the icons update from the 1.10 firmware package via usb.
g8ijy commented 5 years ago

Just one point. You do need the 878MCU.hex file from UB1AAM, it contains the boot loader which is not included in a normal firmware update.

yoramro commented 5 years ago

To all who contributed to this success - Hats Off!! It is working perfectly

gymnae commented 5 years ago

Success! Thanks everybody who worked on this. This is great.

Here are the steps which I took:

  1. Open the device with the help of these images: https://www.qsl.net/dl4yhf/Anytone_D868UV/index.html#photos (thanks @doronbc for the hint)
  2. Attach the programmer like very nicely shown in this post: https://github.com/geary/AnyTone-D868UV/issues/59#issuecomment-450688447
  3. Open the 868hex file shared here: https://github.com/geary/AnyTone-D868UV/issues/59#issuecomment-451264858
  4. Start the 868 in FW update mode (pressing and holding he now bare white button on top and PTT button on the side while turning the manipulator for turning the device on)
  5. Press connect in ST-Link
  6. Compare device memory and HEX file (this was the only way I found to select the same address range)
  7. Save the now selected address range of the device for backup purposes
  8. Open the required 878 hex file: https://github.com/geary/AnyTone-D868UV/issues/59#issuecomment-451245833
  9. Flash the hex
  10. Attach normal programmer cable and read codeplug from radio with 878 CPS
  11. Flash up-to-date 878 Firmware and Icon update
  12. Reset radio
  13. Write codeplug and new digital contact database to device
  14. Check and build device back together, being very careful with the rubber band for sealing
  15. Done

In my case I also added a mod to ground the GPS better for lowering interference in analogue mode, but this for my early 868 model.

yoramro commented 5 years ago

Please be aware that some ST-Link V2 devices have slightly different pinout order. This is my device which is different than pictured before img-1112

doronbc commented 5 years ago

another note, a risk we run is anytone providing an update that can somehow differentiate the radios they sold as 868 vs 878, could be based on serial # or something else. take precaution with any new updates provided by anytone. worst case scenario it's completely bricked, hopefully though most cases can be recovered by having an st link on hand. best case scenario is they take no actions and all subsequent updates will work as expected. if you know/think the st link will always be an available last resort, i would ask these people first to maybe try new updates before others, and report back here just to state it caused no issues, then others can proceed with updating. if you do think the st link will always be a last resort for recovery, let us know as well.

s57pz commented 5 years ago

I always erase all memory sectors on MCU before uploading. Shrani.si

hb9gfx commented 5 years ago

Wow great work, I ordered my ST Link as well. So as soon as its there I will take my luck :-) Thanks to everyone to keep us updated.

sfowlr commented 5 years ago

Well, I've managed to brick my radio. It was showing up in STLink as an STM32F10xx High Density, Device ID 0x414, with 512KB flash. Wasn't able to read out the existing flash contents as it was read protected, too. This is the D868UV2 PCB with the same GD32F303 everyone else seems to have - no crazy unheard of hardware variant or anything.

Figured I'd gamble and try flashing the 878 hex anyway, but it fails because the flash size is too small. (But of course, disabling read protection wiped the existing flash contents). Still trying to flash the hex via other means with open-source software that doesn't attempt to validate flash size beforehand.

Anyone have an 868 backup they could send my way? And/or any idea what I've done wrong here?

sfowlr commented 5 years ago

False alarm - I was able to flash back in the backup 868 hex from here by shortening the hex file down to 512K, since there was only about 500K of actual content in it anyway. Unfortunately this trick isn't gonna work on the 878 one, since it's got more than 512K of content.

Update: After closer inspection, I see that I have a STM32F303VET6, whereas it appears most of you have the STM32F303VGT6. Biggest difference: 512k flash instead of 1M. I guess I'm out of luck on this one unless I rework the PCB to have the VGT6 variant.

tkerby commented 5 years ago

Given that Anytone announced the 878 as having more memory it doesn’t surprise me that there are two versions of the BOM. I’d suspect that when the 878 was announced, it’s cheaper to populate one chip for both variants than run two types.

Unfortunately, Anytone are stuck with the flash size on the original boards on the 868 which is why we then don’t see features like APRS menus on the 868 as they need it to work across all 868 radios.

sfowlr commented 5 years ago

Maybe I'll swap the guts of mine with my dad's.. His is newer and may have the larger flash.

I also modified the source code of an STLink utility to bypass flash size verification, but no luck there. The chip stops accepting page write commands after 256 pages (512k). This trick worked on some of the STM32F103 chips, so I figured it was worth a shot.

Can't find any suppliers that sell the GD32F303VGT6, even Chinese ones, so the PCB rework route isn't gonna work either.

slimgym commented 5 years ago

Be interested to know what the 'production date' shows (from CPS Public > Local Information with radio connected). Mine was produced 2018-4-21 but I am awaiting the ST-Link. I also wonder if those who have flashed ended up with the same serial number, also shown under "Local Information".

prokrypt commented 5 years ago

I would think the serial is stored on a separate flash memory where all the calibration data resides. I had flashed a mod to enable the full test menu on stock firmware, and it is still enabled after flashing the 878 hex image. The mod will overwrite your serial number by default.

sfowlr commented 5 years ago

The "Producted Date" (ha) on mine is 2017-10-31. I knew it was a pretty early one, I think I got it around January of 2018. The date seems to come from the first 8 characters of the serial number in software. I may have accidentally wiped out the original serial number though - the one that's showing in CPS is vastly different than the one on the back of the radio. Unless maybe they don't match up for others either?

NeuerUser commented 5 years ago

So, it seems there is another more or less successful conversion. Mine is now reporting as a UV878.

The installation process was somehow strange. I could connect to the STM, read the content, even compare the 868 file from @UB1AMM. But after I then finally wrote the 878 bootloader to the HT, I was no longer able afterwards to connect to the STM via the ST-Link, no matter what I tried. Very strange. Anyway, I was able to upload the 1.10 firmware and the icon update. So, it looks like a 878 now. Only problem I am having is the GPS, which is not working (always reporting to be OFF). I guess it is this awful small cable that was so difficult to detach and then at the end to reattach. Need to reopen again, I guess.

NeuerUser commented 5 years ago

grafik Hmm, this, however, looks rather strange...

NeuerUser commented 5 years ago

Hmm, I do not have any APRS/DPRS settings in my CPS. How does the CPS "know" that I have probably not correctly connected the flat cable? Or is it not the flat cable, but rather a software issue?

NeuerUser commented 5 years ago

Well, I fixed the GPS by reconnecting the cable. So far, so good. It also shows APRS in the menu. Great.

However, I still do not see any DPRS/APRS configuration in the CPS. What's the problem here?

M6NBP commented 5 years ago

Look under Tools - Options capture

NeuerUser commented 5 years ago

Great! Thanks!

M6NBP commented 5 years ago

In my case I also added a mod to ground the GPS better for lowering interference in analogue mode, but this for my early 868 model. @Gymnae Any more info on this and what you did ?

M6NBP commented 5 years ago

Feel free to post in this group ANYTONE AT-D868UV & D878UV UK USER GROUP

It has members from all around the world

prokrypt commented 5 years ago

@M6NBP http://members.optuszoo.com.au/jason.reilly1/868mods.htm search for "Noise from display" on page.

gymnae commented 5 years ago

I've tried to start a DMR/Anytone group here: https://dmr.grundstil.de - It's open for anyone, especially those who liked to avoid Facebook or the politics of other HAM communities. Maybe we rekindle that young space :)

Everyone's welcome.

ScottyNYC commented 5 years ago

Does anybody have any information or some kinda instructions on doing this to the btech? I see that prokrypt has done it, but I've never done anything like this before. Thanks in advance!

Hotwire commented 5 years ago

grafik Hmm, this, however, looks rather strange...

I have this as well, I guess some more digging needs to be done in the hex to figure out the serial number and all the other info to make it all valid.

DC1RS commented 5 years ago

For adding S/N after flashing 868 to 878 Go to http://members.optuszoo.com.au/jason.reilly1/868mods.htm and look for Full Test Mode section. At the end of this section there is an explanation how to enter S/N again into Radio.

Hotwire commented 5 years ago

Thank you very much.

On an other note, has anyone had a problem turning on the GPS after upgrading to the 878 flash?

DC1RS commented 5 years ago

No. Flashed two 868 to 878 without any problems.

s57pz commented 5 years ago

No, GPS work good. Look my FB link. Check the flat white cable https://www.facebook.com/100009367966104/videos/2242549062734004/?id=100009367966104

Hotwire commented 5 years ago

My GPS won't turn on.... :( Keeps telling me it's off.

s57pz commented 5 years ago

Ja, the error appears if the flat cable is not well inserted. Check the flat white cable on both sides.

Hotwire commented 5 years ago

I didn't remove any of the cables. But I will check them tomorrow morning . Thank you.