Today I installed a voltage sensor on my Hexacopter and tested is successfully with my 3DR telemetry. Shortly after the telemetry wouldn't connect. After much troubleshooting and verifying that the 3DR radio's could communicate with each other I unplugged everything and just put in the USB cable to my APM2. I still can't connect or upload new firmware through the mission planner, any ideas?
Maybe something got shorted out?
Could be but the hexacopter functions so that would seem odd to be a short.
So I went and flew my hexacopter and it worked fine, does anyone know if it could have a short and still fly fine or can I rule a short out now?
Something else I have noticed now is that when I try upload the firmware the rx/tx lights on the board flash and then it just gives the message 'Can't detect your apm version please check your cabling'.
Is there a way I can flash the board without the MP?
Is there a way I can flash the board without the MP?
First, you need to look at this as a system. It's based on Arduino. While we throw around the name Arduino, you need to know what it is and means. Arduino is actually 3 things, an open platform of hardware (Primarily 8 bit microprocessors from Atmel and the Atmega series in general), but it's also the Integrated Development Environment (IDE) which is the text based programming environment basically working with a "C" like langauge, and finally, the part that answers your question, a bootloader. Understand that pretty much all Arduino processors communicate via a serial connection. The trick here, is that just like your PC, you need a BIOS (Basic Input Output System) to make that serial connection even active to talk to the outside world. In order to flash the bootloader if the chip is blank or say you corrupted the flash on the porcessor and thus even the basic BIOS (AKA bootloader) is not working, you must use an AVR programmer plugged into the ICSP (In Circuit Serial Programming) 6 pin header. You then flash a bootloader from the Arduino IDE software tool, and then, all future flashes can occur ocross the serial connection. What you need to keep in mind is I said serial and you are plugging to the computer using USB. We use several different kinds of USB to serial converter, one is FTDI, the other is the Arduino driver and another special Arduino Processor programmed to act the same like FTDI, just using a different driver.
So to recap, the reason likely why you cannot load is that you either corrupted the bootloader or there is a communication error. The only way to fix the bootloader is to flash via the ICSP and you must have an AVR programmer to do that. The next option that we hope it is is that the program on the APM only presents the bootloader interface allowing you to flash for a very short preiod of time right after the APM is booted or powered on. The physicial reset button also causes the processor to reboot. So the trick here is to maybe hit reset a few seconds before attempting to flash the APM via mission planner. The last option is that your driver that emulates the serial port across the USB, and/or, it's physical connection is not working. The problem here is that on APM 1, it's a FTDI chip on the IMU shield, on APM 2.0/2.5, the same chip acting as the PPM encoder is the usb to serial converter. Many guys have killed that chip buy supplying the APM with more than 5 volts.
So, lets look at the facts:
You changed some wiring, added a sensor- could have either caused a short or more than 5 volts to the APM (don't think this is it since you can fly)
You have 3DR radios and are also trying to connect via USB. It's known they both talk on the same serial port to the microcontroller and thus, you cannot have both working at the same time. There is an auto switch that is supposed to make USB the priority, but also, there is a physical port (UART0 rather than auto UART 0/2) that is directly hardwired to the micro. So if you are using that hardwired port (UART 0 on the long edge of the board) for the radios, then USB will not work as long as that radio is plugged in becausing it's conflicting with the USB to serial conversion (technically the serial side).
when I try upload the firmware the rx/tx lights on the board flash
This tells me at least the USB to serial is trying to work.
I would unplug the radios first and see if that solves the USB connect. The next item is to remove the new voltage sensor and then try.
I doubt at this point you damaged the PPM since you said you can fly.
Absolute last is to reprogramm the bootloader on the mega 2560.
Sorry for the long post, but being that you asked the "how" I tried to be completely clear. Once you learn the fundmentals of Arduino and have an AVR programmer handy, you will never ask "how can I get it working again" ever. You will know the steps: flash the bootloader via ICSP and AVR programmer, attempt to connect via serial and flash the running firmware via the normal application (mission planner in this case, Arduino IDE in others). If that fails, then start troubleshooting the USB to serial connection (hardware specific to the platform you are touching). This works for all Arduino based projects even including the ESCs(Atmel based),minim OSD, and tons of other parts you may add to the system. Once you know this and see an atmel chip on anything, you then know that you can hack it, repair it no matter what unless it's just plain burned up. All you need is Arduino IDE and an AVR programmer to "fix" the bootloader. The key here is that it is, pretty much always, a layered system. You have the physical USB to serial connection, you then have a bootloader that is in the firmware but in a reserved section, next is your actual running application firmware you can flash and change as long as the phsycial serial connection and the bootloader are working. It's easy enough to reflash the bootloader, and kind of start the chip fresh as long as you have an AVR programmer handy. Otherwise you could be on the long road of troubeshooting the entire USB to serial connection (OS driver, physical connection and plugs, actual conversion chip, any wiring between that chip and the actual micro you are trying to program). Thus it's real easy to see why I might say just flash the bootloader(which might take less than 5 minutes), as a first check since the long list of USB to serial takes longer to troublshoot. In your case though, I hope it's just the radios conflicting with the USB.
I have unplugged everything from the board to avoid anything effecting it. I have tried your suggestion of reseting and trying to load firmware but that doesn't seem to do it. I think I have tried what I can so I will look a bit more into getting a AVR programmer to flash it.
Thanks for all the information.
Let me preface this with the following: If you want to ship the board to me I will gladly do this for free if you pay shipping. I am based in the US if you need to calculate shipping costs. I am more than willing to help out a brother in need...
I just fixed a board that had this issue. For some reason during the upload of 2.7.1 my bootloader was corrupted. I have zero explanation for it. The board is having other unexplained brownouts so something is obviously wrong with it.
None the less... I was able to use an Atmel JTAGICE mkII in ISP mode to repair the Atmega 2560 and put it back in a state that allows for the Mission Planner to flash firmware. I have attached stk500boot_v2_mega2560_patch.hex which is the file that 3DRobotics flashes to the board before it makes it into your hands. You will need it if you attempt to fix the board on your own.
You can use Atmel Studio and choose Atmega2560 as your chip, erase whatever may be there and then flash the .hex file attached to the thread on to the board. If you are an open-source kind of person you may also likely accomplish this task with AVRdude as well.
The JTAGICE (http://www.atmel.com/tools/AVRJTAGICEMKII.aspx) is a bit expensive so you likely do not want to use it for this task, I just happen to have one from other projects. You can likely do the same thing with an evil Atmel clone from China (http://www.ebay.com/itm/Compatible-Atmel-JTAGICE-mkII-mk2-ATJTAGICE...). If you are frugal you can get away with using an Atmel clone ISP programer (http://www.ebay.com/itm/AVR-STK500-V2-0-ISP-Programmer-ISP-USB-Atma...) or any other programmer.
Once you get a valid bootloader onto the board it may be a bit more responsive.
To directly answer your question about flashing via means other than MP, JTAG and ISP via AVRDude or Atmel Studio are your best bets. You must first enable JTAG over the ISP port if you plan to use that method, the JTAGEN fuse is not enabled by default so most users will use ISP. Most users don't want to shell out the cost on a JTAG anyway.
Let me know how I can help! I know the "non-answers" you get can be frustrating at times. I've already done quite a bit of legwork there. ;)
I think I saw some info on using the JTAG interface over at diydronesafety.com
If you're up for doing it yourself this info should help. Otherwise, if you know someone handy with a soldering iron and a bit of microcontroller experience they should be able to do it without too many problems.
I have the same issue... is there a guarantee or a return back policy for the board so that they can fix it and send it back.
Colin, did you ever sort this out? One of my boards is suddenly doing the same thing. It flies a quad fine but USB, telemetry and even connecting through the CLI are all non-responsive.
If I recall I took a look at the board and could not figure it out. My only assumption is some sort of failure in the Atmega32u