Author Topic: Flashing a board using AVR ISP method using Arduino  (Read 3682 times)

0 Members and 1 Guest are viewing this topic.

Offline zennasyndroxx

  • Thread Starter
  • Posts: 646
  • It's good to be back!
Flashing a board using AVR ISP method using Arduino
« on: Fri, 29 August 2014, 12:26:52 »
Hi guys,

I'll try and keep it short :D

Situation: Got a FaceU replica/bootleg from a GB in China forums, leader didn't use the latest firmware so I want to flash it to the latest one. the press q and plug in method didn't work. I would like to flash the firmware via ISP with an Arduino that I have in hand.

Question: How do I do it? Do I have to burn in a USB bootloader first then only flash ps2avrU firmware? There's not much topics on this after searching and thus, I'm asking this question to those who know.

Also, have a good weekend ahead guys!
« Last Edit: Fri, 29 August 2014, 13:15:32 by zennasyndroxx »

Offline domoaligato

  • * Exquisite Elder
  • Posts: 1672
  • Location: USA
  • All your base are belong to us!
    • All your base are belong to us!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #1 on: Fri, 29 August 2014, 12:30:26 »
do you have a link to where you bought it? maybe some pictures?

Offline zennasyndroxx

  • Thread Starter
  • Posts: 646
  • It's good to be back!

Offline Grendel

  • Posts: 462
  • Location: OR, USA
    • Firmware for Costar Replacement Controllers
Re: Flashing a board using AVR ISP method using Arduino
« Reply #3 on: Fri, 29 August 2014, 12:48:11 »
Reprogramming the chips via ISP most likely requires a chip erase (depending on what lock bits are set), ie. you will need to re-flash the bootloader and then use it to load the firmware.
Currently using: RK-9000WH/GR, CMS QFXT w/ Ghost Squid
- I'm game !

Offline zennasyndroxx

  • Thread Starter
  • Posts: 646
  • It's good to be back!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #4 on: Fri, 29 August 2014, 12:57:08 »
Reprogramming the chips via ISP most likely requires a chip erase (depending on what lock bits are set), ie. you will need to re-flash the bootloader and then use it to load the firmware.

so, what I would have to do is to erase everything, flash the usb bootloader, and then use the hidboot tool to flash the firmware?

I've seen margo posted pictures of ISP flashing with his arduino uno on reddit and nothing over here :(

Offline vvp

  • Posts: 886
Re: Flashing a board using AVR ISP method using Arduino
« Reply #5 on: Fri, 29 August 2014, 13:22:03 »
You can use e.g. avrdude with this http://arduino.cc/en/Hacking/ParallelProgrammer

You can erase the chip, program fuses, bootloader, firmware and even eeprom using ISP.

Offline domoaligato

  • * Exquisite Elder
  • Posts: 1672
  • Location: USA
  • All your base are belong to us!
    • All your base are belong to us!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #6 on: Fri, 29 August 2014, 17:26:26 »
you can use that on a real faceu. it has not been tested on a knockoff. can someone verify that is a real faceu on that site?

Offline zennasyndroxx

  • Thread Starter
  • Posts: 646
  • It's good to be back!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #7 on: Fri, 29 August 2014, 17:29:33 »
you can use that on a real faceu. it has not been tested on a knockoff. can someone verify that is a real faceu on that site?

it's not but i think that it's the same since the controller is the same just that it's not the original faceu. now i need to find a way to use arduino to use avrdude without any more modifications to anything or, get a avrisp tool

Offline domoaligato

  • * Exquisite Elder
  • Posts: 1672
  • Location: USA
  • All your base are belong to us!
    • All your base are belong to us!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #8 on: Fri, 29 August 2014, 17:29:38 »
sorry for double post... tapatalk.


Faceu generic version
and Faceu use the same schematic
generic firmware so
any function can be supported by the original Faceu
layout


it should work fine.
if you can find the faceu schematics post them here.

http://geekhack.org/index.php?topic=51252.0

he is looking for someone that is willing to test.
« Last Edit: Fri, 29 August 2014, 17:33:43 by domoaligato »

Offline Igthorn

  • Posts: 34
Re: Flashing a board using AVR ISP method using Arduino
« Reply #9 on: Fri, 29 August 2014, 18:12:10 »
http://arduino.cc/en/Tutorial/ArduinoISP
http://captainunlikely.blogspot.com/2012/05/program-attiny45-with-teensy-20.html
http://hackaday.com/2009/07/15/avr-isp-programming-via-arduino/
http://dorkbotpdx.org/wiki/teensy_2_0_as_avr_isp_programmer

--

http://deskthority.net/workshop-f7/teensy-2-0-alternatives-atmega32u4-t4253-90.html#p174377
I used a Teensy2 to flash Grendel's bootloader (which is pretty nice) to my pro micro.  Also used my pro micro to burn it to my Teensy2 (cause I screwed up my teensy testing out the pro micro as an ISP :p)  If you are using a teensy/pro micro/similar clone, you shouldn't need any extra components.  I just wired them up to each other.

Offline domoaligato

  • * Exquisite Elder
  • Posts: 1672
  • Location: USA
  • All your base are belong to us!
    • All your base are belong to us!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #10 on: Fri, 29 August 2014, 22:45:05 »

Offline zennasyndroxx

  • Thread Starter
  • Posts: 646
  • It's good to be back!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #11 on: Sat, 30 August 2014, 01:37:30 »
have you read this?
http://geekhack.org/index.php?topic=58945.0

yeah. I'm aware that you can press q and plug in and it enters the bootloader. but mine doesn't. so i suspect the flashing job isn't done well?

http://arduino.cc/en/Tutorial/ArduinoISP
http://captainunlikely.blogspot.com/2012/05/program-attiny45-with-teensy-20.html
http://hackaday.com/2009/07/15/avr-isp-programming-via-arduino/
http://dorkbotpdx.org/wiki/teensy_2_0_as_avr_isp_programmer

--

http://deskthority.net/workshop-f7/teensy-2-0-alternatives-atmega32u4-t4253-90.html#p174377
I used a Teensy2 to flash Grendel's bootloader (which is pretty nice) to my pro micro.  Also used my pro micro to burn it to my Teensy2 (cause I screwed up my teensy testing out the pro micro as an ISP :p)  If you are using a teensy/pro micro/similar clone, you shouldn't need any extra components.  I just wired them up to each other.

if can I would like to use my arduino alone as an avrisp tool. so far, no avail :(

Offline Igthorn

  • Posts: 34
Re: Flashing a board using AVR ISP method using Arduino
« Reply #12 on: Sat, 30 August 2014, 08:49:47 »
External crystal and the like are only neccessary when programming a bare chip.  So all you have to do is connect vcc>vcc, gnd>gnd, mosi>mosi, miso>miso, sck>sck, ss>rst (isp > device to be programmed).  The Faceu has holes where you can connect an isp, it's to the left of the controller in this pic (source).  Then open up the ArduinoISP sketch from the examples menu in ArduinoIDE and upload it to your arduino.  Then you use avrdude to flash what you want to the Faceu.

Offline zennasyndroxx

  • Thread Starter
  • Posts: 646
  • It's good to be back!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #13 on: Sat, 30 August 2014, 12:57:07 »
External crystal and the like are only neccessary when programming a bare chip.  So all you have to do is connect vcc>vcc, gnd>gnd, mosi>mosi, miso>miso, sck>sck, ss>rst (isp > device to be programmed).  The Faceu has holes where you can connect an isp, it's to the left of the controller in this pic (source).  Then open up the ArduinoISP sketch from the examples menu in ArduinoIDE and upload it to your arduino.  Then you use avrdude to flash what you want to the Faceu.

Sometimes I get com3 access denied and running the commands as admin didn't help. It worked sometime then I get stk500 get sync error. What should I use for arduino?

Offline Igthorn

  • Posts: 34
Re: Flashing a board using AVR ISP method using Arduino
« Reply #14 on: Sat, 30 August 2014, 13:30:31 »
What com port you are using will depend on your pc, it can change depending on what is available when the pc detects it.  Once the ArduinoISP sketch is loaded and you've rebooted the arduino, on a Windows pc it should appear in the device manager under 'Ports (COM & LPT)'.

"-c avrisp" is the programmer type I used when using my teensy as an isp.

What board are you using as an ISP?

Offline zennasyndroxx

  • Thread Starter
  • Posts: 646
  • It's good to be back!
Re: Flashing a board using AVR ISP method using Arduino
« Reply #15 on: Sat, 30 August 2014, 13:37:25 »
What com port you are using will depend on your pc, it can change depending on what is available when the pc detects it.  Once the ArduinoISP sketch is loaded and you've rebooted the arduino, on a Windows pc it should appear in the device manager under 'Ports (COM & LPT)'.

"-c avrisp" is the programmer type I used when using my teensy as an isp.

What board are you using as an ISP?

I'm using com3.

Gonna use arduino uno r2

Offline Igthorn

  • Posts: 34
Re: Flashing a board using AVR ISP method using Arduino
« Reply #16 on: Sat, 30 August 2014, 14:29:57 »
Looks like you may need a 10uF cap between rst and gnd on the Uno. 

http://electronics.stackexchange.com/questions/67865/avrdude-error-stk500-getsync-not-in-sync-resp-0xff
Quote
By default, an Arduino Uno automatically resets itself whenever the host computer opens its serial port. After that, the boot loader waits for a few seconds to see whether there is any serial traffic intended for it, and that disrupts the communication sent by avrdude.

You’ll have to disable this auto-reset by connecting a 10µF capacitor between the RESET and GND pins (- going to GND, of course).
« Last Edit: Sat, 30 August 2014, 14:38:23 by Igthorn »