Sunday 18 June 2017

avrdude - Adding the AVR Dragon's HVPP to the Arduino IDE



I would like to teach my Arduino IDE to use my AVR Dragon's HVPP (High Voltage Parallel Programming) interface to upload compiled sketches to my boards (an ATMega1284P-PU in this case, supported by mighty1284p).


Working setup so far:


Arduino IDE with mighty1284p, I added this to the boards.txt of mighty1284p to support my uC's internal-RC-oscillator clockrates of 1MHz and 8MHz.


avrdude can talk to the m1284p and set the fuses:


avrdude -c dragon_pp -P usb -p m1284p -U lfuse:w:0x62:m -U hfuse:w:0x99:m -U efuse:w:0xFF:m -U lock:w:0xFF:m

I can compile / check a sketch successfully, then upload the temporarily created .hex manually to the 1284 using the Dragon:


cd /var/folders/px/xmf1dygn6p5_fn1hh05c6gyr0000gn/T/build4082512148637729777.tmp/
avrdude -p m1284p -c dragon_pp -P usb -U flash:w:Fade.cpp.hex


This works but includes the manual step of cding into the temporary build directory and manually uplading the .hex.


How would I use the AVR Dragon's HVPP directly from within the Arduino IDE? I have added a section to programmers.txt as such:


dragonpp.name=AVR Dragon HVPP
dragonpp.communication=usb
dragonpp.protocol=dragon_pp
dragonpp.force=false

which I assumed would be correct for the above avrdude parameters.


Within the IDE I choose Tools - Programmer - AVR Dragon HVPP, the Upload. The debug output shows this:


(...correct compiling, linking and such...)

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -carduino -P/dev/tty.Bluetooth-PDA-Sync -b115200 -D -Uflash:w:/var/folders/px/xmf1dygn6p5_fn1hh05c6gyr0000gn/T/build1852336263469118058.tmp/Fade.cpp.hex:i

avrdude: Version 5.11, compiled on Sep 2 2011 at 18:52:52
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/cts/.avrduderc"
User configuration file does not exist or is not a regular file, skipping


Using Port : /dev/tty.Bluetooth-PDA-Sync
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done. Thank you.


So the -p parameter is correct, but -c and -P are wrong.


Any ideas how I could add the Dragon correctly?



Answer



Your problem is that the programmer settings in your part entry (shown in your other question) override the programmer settings in the programmer entry.


Just lose these lines in the part entries:


mighty_opt8.upload.protocol=arduino

No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...