I have a Turnigy 9x TX and yesterday I've decided to do some modding: add a backlight, perform antenna mod so that turnigy module becomes removable (soldered coax cable on my first try ever! , solder some wires for firmware programming support.
I didn't have any header wire nor header connectors at hand, so I've decided to salvage some rigid copper wire from a UTP-5e and use it both as a wire and connector due to it's rigidity.
Here's what the result looked like (the strange glue-like stains on the bottom traces running to ATMEGA64A were here at the moment of purchase):
I have stripped the wires a bit (like 5 mm) and inserted them into USBasp 6-pin plug, adding a bit of hot glue to form a "connector" and hold the wires in place.
Then I've navigated to open-tx.org and installed version 2.1.3 on my macbook, tried to backup the stock firmware and flash the opentx-9x-en.hex downloaded by the companion.
Flashing has failed at the verification step with first mismatch at 0x0100 (0xff in hardware against some other value in the firmware, indicating that this address hasn't been touched by the programmer; a common error according to google, allegedly related to a bug in avrdude 6.0, but I've experience it in version 5.11!). I was slightly disappointed and tried to turn my TX on, LCD displayed something blurry in the top half barely recognizable as EEPROM. No luck, the radio wasn't working. The obvious step was to flash stock firmware from the backup, that's when I had discovered that backup file is empty, 0 bytes.
By some experiments I've discovered that during backup/read firmware from radio the companion app invokes avrdude with ':a' as firmware format (a for auto), which can only be used on input files where the format can be deduced, and during reading firmware there is no file to deduce anything, hence ':i' (Intel) format specification is required. Invoking avrdude with correct format solved the problem, but it was too late for the stock firmware.
Then I've tried different version of avrdude (6.0, 5.11 from another binary package), still the same problem.
Today I have given it a try on Windows, same result as OS X, then Ubuntu 14.04 with avrdude 5.11 and 6.1 under sudo.
Here it was even weirder, during "Write firmware to radio" the Companion started by reading something from the radio to a file in /tmp called NNNN-flash-check.bin, but stat showed that there's no such file. After reaching 100% on app reported "avrdude Ok" and did not try to write anything (maybe because file "-check" creation has failed?).
Frustrated, I've tried invoking avrdude 6.1 directly:
After writing, reading and verifying avrdude reported success. After turning on the firmware invited me to perform stick/pot calibration. I've decided to try it once again and encountered another mismatch during verification in the first byte.sudo avrdude -c usbasp -p m64 -U flash:w:opentx-9x-en.hex:i
Although the verification failed, radio still works, but now I'm expecting some undefined behavior which may catch me off guard and cause some damage.
Does it seem like the connection between ATmega chip and USBasp programmer is unstable, or, the USBasp is faulty? Maybe it is due to my "invented" programming connector?
Why does the Companion try to create temporary/backup files and fails at doing so?