Offline
Newbie
Karma: 0
Posts: 17
|
 |
« on: April 08, 2012, 08:13:08 am » |
Hey guys, I really need to get this bootloader on the atmega328P. Im struggling. I tried, http://mudali.blogspot.com/2011/09/burning-bootloader-of-arduino-uno-with.htmlI also tried uploading the bootloader with 2 uno, I remember connecting pin12 to pin 12 a method llike that i found online somewhere. avrdude: stk500_getsync(): not in sync: resp=0x00, I get this error for first method cant remember the second one. But I got error aswel. This is what I have: 2 arduino Uno. I also have an old ATMEL AVR board. says its the stk500. Both the chips were previously loaded with this bootloader long time ago. Have no idea how they were bootloader. Just got told that they are bootloaded. pin 13 is flashing but when i use the arduino IDE 1.0 to load any sketch onto it, i get Binary sketch size: 1026 bytes (of a 32256 byte maximum) avrdude: stk500_getsync(): not in sync: resp=0x00 Can someone please tell me step by how to do this. Im losing my head here.I looked at so many things online. I also got AVR studio 5.1 installed. Maybe if someone can give me a step by step run through how to use AVR studio 5.1 with the stk500 ATMEL AVR board to program the bootloader onto the ATMEGA328P-PU this would help. Ill give it another shot. I really dont want to buy pre programmed chips. And also maybe what I can try to get the bootloader on using two arduino UNOs. Id really appreciate it. Thanx guys. Sorry for all the inconvience 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #1 on: April 08, 2012, 09:44:32 am » |
Okay, I installed AVR Studion 4 now. And Im getting the my AVR ATMEL to flash my uni using the ISP -> ISCP port on uno.
Here the complications though. When I use the ATMEGABOOT_168_atmega328_pro8Mhz.hex. LED 13 starts flashing. then I try upload a sketch and it works. But heres the problem. When I try upload the sketch the second time i get avr dude error. same as i got before. I flash the chip again I cn program 1 sketch into it then it does not allow me to do it again, I have to reflash the chip. ? when i use the atmegaboot_168_atmega328.hex. It doesnt even allow me to upload any sketches AVR dude error?
|
|
|
|
|
Logged
|
|
|
|
|
Scotland
Offline
God Member
Karma: 3
Posts: 513
Have you had your Arduino fix today?
|
 |
« Reply #2 on: April 08, 2012, 10:25:19 am » |
Hi Ska - Check your fuses - Looks like they are not set properly.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #3 on: April 08, 2012, 11:41:51 am » |
THis is what I set my fuses to Found this on -> http://arduino.cc/playground/Learning/Burn1680xF8 0xDF 0xFF AND STOPBIT TO 0Xcf any recommendation of what it must be?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #4 on: April 08, 2012, 11:46:15 am » |
0xFF for stopbit i mean
no memory lock feature enabed. no lock on spm and lpm in application sector lpm and spm prohibited in bootloader
|
|
|
|
|
Logged
|
|
|
|
|
Scotland
Offline
God Member
Karma: 3
Posts: 513
Have you had your Arduino fix today?
|
 |
« Reply #5 on: April 08, 2012, 03:10:06 pm » |
low_fuses=0xff high_fuses=0xde extended_fuses=0x05
Try them
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #6 on: April 08, 2012, 03:30:51 pm » |
Remember finding that on a forum somewhere. Tried those settings. But my AVR studio 4 is not liking the 0x05 at extended.
|
|
|
|
|
Logged
|
|
|
|
|
Scotland
Offline
God Member
Karma: 3
Posts: 513
Have you had your Arduino fix today?
|
 |
« Reply #7 on: April 08, 2012, 04:12:45 pm » |
avrdude -p m328p -c stk500 -B 4800 -P ft0 -e -U lock:w:0x3f:m -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m avrdude -p m328p -c stk500 -P ft0 -U lock:w:0x0f:m
Try these from command prompt (in the avrdude directory if its not in you path), you may have to change stk500 to match your programmer.
|
|
|
|
« Last Edit: April 08, 2012, 04:14:27 pm by spycatcher2k »
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5453
Strongly opinionated, but not official!
|
 |
« Reply #8 on: April 08, 2012, 09:21:26 pm » |
extended_fuses=0x05 You have to specify the "unused" fuse bits as 1s rather than 0, which means that EFUSE should of 0xFD (0b11111101)
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #9 on: April 09, 2012, 02:34:22 am » |
Binary sketch size: 1026 bytes (of a 30720 byte maximum)
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: arduino_read_sig_bytes(): (a) protocol error, expect=0x14, resp=0x75 avrdude: error reading signature data for part "ATMEGA328P", rc=-2 avrdude: error reading signature data, rc=-1
Thats the error I get when I set my board to Arduino Duelminanove when I set my extended fuse to 0xFD. When I set my board to Uno I just get avrdude sync error. I only reason Im bringing this up is because I remember buying a chip long time ago that was bootlaoded and it gave me sync error when I used the uno board setting and didnt when I used the duel board settings. Is this because how it was bootloaded at the factory? Im going to try what what sky catcher mentioned right. Ill get back to you in a short while. Thanx allot guys
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5453
Strongly opinionated, but not official!
|
 |
« Reply #10 on: April 09, 2012, 02:44:49 am » |
give me a step by step run through how to use AVR studio 5.1 with the stk500 ATMEL AVR board to program the bootloader onto the ATMEGA328P-PU this would help. That would be doing things the hard way, since the Arduino environment (including the build and bootloader and bootloader build environment) isn't set up to use AVR Studio. Easiest solution, use optiLoader on one of your Unos. It's been suggested to you already in other threads; have you tried it?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #11 on: April 09, 2012, 02:54:07 am » |
I tried that method using two arduino Unos. I get an error. I can give that another bash.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #13 on: April 09, 2012, 03:49:23 am » |
C:\MyStuff\Work\Thesis\arduino-1.0-windows(2)\arduino-1.0\hardware\tools\avr\bin
avrdude.exe in that directory.
Now I go to command prompt. To that directory. try avrdude -h... all the commands pop up. But then when I copy paste your line it says it cant find config file.
I saw theres a config fille in this directory C:\MyStuff\Work\Thesis\arduino-1.0-windows(2)\arduino-1.0\hardware\tools\avr\etc\avrdude.conf
How do i link the exe to it? /should I just go change settings manually.
C:\MyStuff\Work\Thesis\arduino-1.0-windows(2)\arduino-1.0\hardware\tools\avr\bin
#------------------------------------------------------------ # ATmega328P #------------------------------------------------------------
part id = "m328p"; desc = "ATMEGA328P"; has_debugwire = yes; flash_instr = 0xB6, 0x01, 0x11; eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, 0x99, 0xF9, 0xBB, 0xAF; stk500_devcode = 0x86; # avr910_devcode = 0x; signature = 0x1e 0x95 0x0F; pagel = 0xd7; bs2 = 0xc2; chip_erase_delay = 9000; pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", "x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", "x x x x x x x x x x x x x x x x";
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5453
Strongly opinionated, but not official!
|
 |
« Reply #14 on: April 09, 2012, 03:59:58 am » |
You'll need a command like (this is from a mac, so it won't be exactly the same): /Applications/arduino/arduino-1/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/arduino/arduino-1/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -patmeag328p -carduino -P /dev/tty.usbmodemfd3141 -b19200 -v -U lock:w:0x3F:m -U flash:w:optiboot_atmega328p.hex -U lock:w:0x2F:m
|
|
|
|
|
Logged
|
|
|
|
|
|