RC India

RC Equipments => Servos, Gyros and All Electronics => Topic started by: SideWinder on February 18, 2014, 12:41:02 PM



Title: APM 2.5 firmware update issue.
Post by: SideWinder on February 18, 2014, 12:41:02 PM
I had bought an APM 2.5.2 from Aliexpress @53.59$ approx Rs 3200
http://www.aliexpress.com/item/APM2-6-APM-Flight-Controller-Board-For-Multicopter-ARDUPILOT-MEGA-2-6-W-case/1552992506.html (http://www.aliexpress.com/item/APM2-6-APM-Flight-Controller-Board-For-Multicopter-ARDUPILOT-MEGA-2-6-W-case/1552992506.html)

The parcel arrived in 25 days, and the first thing I tried to do was update latest firmware for tricopter, however couldnt do so.
MP gave me a "Communication error-no connection", something very similar to the video posted below.
I have tried many things yet cannot update firmware, but the default firmware i.e. Arducopter 3.1 Quadcopter works and I can write new parameters without any issue. However I havent tried to connect it to and check inflight.

After going through lot of threads, the next thing I want to try is programming the bootloader as mentioned in the comments of the video. Just wanted to know how to use an usbavr clone programmer available on ebay for this method?

http://www.youtube.com/watch?v=KPn9IPatssI#ws (http://www.youtube.com/watch?v=KPn9IPatssI#ws)

Or basically I want to try this
http://www.rcgroups.com/forums/showpost.php?p=24584242&postcount=2498 (http://www.rcgroups.com/forums/showpost.php?p=24584242&postcount=2498)

------------------------------------------------------------------------------------------------------------------------------------------------------------

PS: The seller Eric Yu has sent me a replacement FC, while letting me keep the old FC. I am so Thankful for his kind gesture and would recommend him to people who like to take some risks.Didnt have to ask him for a replacement, when I last informed him that I have tried everything I can do, he just sent me the new Tracking No, and initiated replacement formalities on Aliexpress.

This is the kind of service I want/expect from everyone-everywhere for everyone-everywhere! Meanwhile I will try to see if I can repair the one at hand, if successful will send back the new item.


Title: Re: APM 2.5 firmware update issue.
Post by: girishsarwal on February 18, 2014, 10:19:27 PM
Quote
You have any idea if I can make the USBASP compatible with Atmel Studio 6.1, because I tried but it doesnt work.

Atmel studio 6.1 uses Microsoft Visual Studio underneath...Use avrdude + winavr to program using usbasp, avrdude is a CLI, so all you need to do is put the instruction to program in your post build operations under project settings. Everytime the program compiles, the code will be written to the atmega as long as the programmer is connected


Title: Re: APM 2.5 firmware update issue.
Post by: SideWinder on February 19, 2014, 04:45:02 PM
Okay, Noob Alert  ??? you need to guide me step by step here :-[. Tried to download avrdude but cannot understand how to get it running.Have downloaded and installed winavr too, learnt that it contains avrdude and successfully launched in cmd.

This is what I want to try as suggested by a user on youtube.

Quote
This problem is because there is no bootloader on the atmega 2560.
You can upload the bootloader using an ISP programmer.
I had the same problem, and used an arduino ISP to upload the bootloader.

Arduino ISP page is here:
http://arduino.cc/en/Tutorial/ArduinoISP#.Uv6gdIXTeb5 (http://arduino.cc/en/Tutorial/ArduinoISP#.Uv6gdIXTeb5)

The Atmega 2560 bootloader is here:
https://code.google.com/p/ardupilot-mega/source/browse/Tools/APM2_2560_bootloader/stk500boot_v2_mega2560.hex?name=ArduPlane-release (https://code.google.com/p/ardupilot-mega/source/browse/Tools/APM2_2560_bootloader/stk500boot_v2_mega2560.hex?name=ArduPlane-release)

(make sure you get the file, and not the html page)

Instructions to flash are on the bootloader page(flash.txt).
With Arduino ISP, use the following avrdude commands (replace com7 with your actual arduino com port):


c:\WinAVR-20100110\bin>avrdude -e -c avrisp -b 19200 -p m2560 -P com7 -U lock:w:0x3f:m

c:\WinAVR-20100110\bin>avrdude -v -c avrisp -p m2560 -P com7 -b 19200  -U flash:w:stk500boot_v2_mega2560.hex
(returned an error on verify, but did work)

c:\WinAVR-20100110\bin>avrdude -c avrisp -p m2560 -P com7 -b 19200 -U lock:w:0x0f:m

Now in my case, think I will need to change the com ports as well as the programmer name used i.e

"c:\WinAVR-20100110\bin>avrdude -e -c usbasp -b 19200 -p m2560 -P com7 -U lock:w:0x3f:m

c:\WinAVR-20100110\bin>avrdude -v -c usbasp -p m2560 -P com7 -b 19200  -U flash:w:stk500boot_v2_mega2560.hex
(returned an error on verify, but did work)

c:\WinAVR-20100110\bin>avrdude -c usbasp -p m2560 -P com7 -b 19200 -U lock:w:0x0f:m "

Questions:
Are the commands correct?
What would be the com port since programmer would be connected via usb?
Similarly where should I place the hex file before flashing it?



Title: Re: APM 2.5 firmware update issue.
Post by: girishsarwal on February 19, 2014, 08:54:46 PM
Great!

Quote
Are the commands correct?
Yes. they look like. Just check the first command that is for the fuse bits. dont mess with it much, to avoid any lockouts...I will go through the links later today for more info.

Quote
What would be the com port since programmer would be connected via usb?
You dont need to specify com port, just issue the following command:
c:\WinAVR-20100110\bin>avrdude -v -c usbasp -p m2560 -U flash:w:"c:\your\file\path\stk500boot_v2_mega2560.hex"

- Use a command prompt with admin rights if you can
- try the -B 20 flag if target doesn't answer or verification fails. -B sets a lower SCK frequency.

Quote
Similarly where should I place the hex file before flashing it?
Wherever you liek it as long as you specify the complete path. If you don't want to type the complete path, put it in the same directory as bin (dirty) or put in C:\Windows\System32 (even dirtier) or any folder that is listed in the PATH variable.



Title: Re: APM 2.5 firmware update issue.
Post by: SideWinder on February 20, 2014, 02:03:11 PM
Thanks  ;D,
Couldnt understand where to insert -B 20 in the command.
Anyhow went ahead and flashed the FC, got verification error, content mismatch, however flashing was successful.Used cmd with admin rights.

Now on powering the FC only a green led(Alive/power)stays lit, other led's do not respond(ppm leds do blink twice while connecting via MP then gives communicatiion error). http://code.google.com/p/ardupilot-mega/wiki/LED (http://code.google.com/p/ardupilot-mega/wiki/LED)
Trying to connect to Mission Planner failed, but board is still detected by PC @com port 22.

There are two MCU on APM and was thinking of flashing the second one but its Atmega32U2, and avrdude(v5.10) doesnt seem to support it.

Next set of questions:
What would the green led mean?
How can I update avrdude to latest version(6.0.1)?(Had installed the latest Winavr version)
Where to insert -B 20 code in the command?
How to add support for m32u2? Some resources I found but couldnt understand squat :-[
http://julianpanetta.com/blog.php (http://julianpanetta.com/blog.php)
http://avr.2057.n7.nabble.com/patch-7896-DFU-FLIPv2-programming-support-td19187.html (http://avr.2057.n7.nabble.com/patch-7896-DFU-FLIPv2-programming-support-td19187.html)
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=93830&start=0 (http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=93830&start=0)

Edit: the Avrdude online manual also has the -p parameter for atmega32u2 listed, but it doesnt show up in avrdude help screen.
http://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions (http://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions)


Title: Re: APM 2.5 firmware update issue.
Post by: Aniket92 on February 25, 2014, 08:05:56 PM
HI
I have configured minimosd1.1 with ftdi cable and connected it with apm2.6 to pc via usb.
I have issues related to displaying data. The display unit is showing NO Mav Data
So please help me. ???


Title: Re: APM 2.5 firmware update issue.
Post by: chintal on February 25, 2014, 09:06:00 PM
Same here though mine is connected to aiop
Only video is coming no video overlay
Tried a lot and then kept it aside for later
If you find a way to get it working plz let me know


Title: Re: APM 2.5 firmware update issue.
Post by: SideWinder on February 28, 2014, 10:32:48 AM
Aniket did you try doing that without connecting it to usb? You will have to power your board from some other source.

http://code.google.com/p/arducam-osd/wiki/minimosd (http://code.google.com/p/arducam-osd/wiki/minimosd)
Important note: You cannot connect the OSD when your APM 2 is also connected via USB (they share the same port). Make sure you disconnect your USB cable from the APM 2 board before attempting to use the OSD.

There are many other issues but you can try this to begin with. We can eliminate the possibilities one by one.

Chintal, have you tried to update the fonts and firmware on minimosd?


Title: Re: APM 2.5 firmware update issue.
Post by: Aniket92 on February 28, 2014, 11:51:56 AM
I just configured minimosd throogh ftdi by updating firmware and unchecking the unnecessary outputs in the panels.
Then i connected it with apm2.6 but its giving no output on display unit except video stream.
I will try connecting apm2.6 with power module and check whether the same problem come.
Is there any problem retaled to this?
Please reply..


Title: Re: APM 2.5 firmware update issue.
Post by: SideWinder on March 21, 2014, 11:05:19 AM
Received the replacement FC today, works fine :D . Havent been able to revive the old one as yet, think the atmega32u2 chip has some issue. Will try to replace the chip only, which is complicated because its a leadless chip and BGA removal involved. But its on the To DO List :)