Pages: [1]   Go Down
Author Topic: hack that gets the AVR device, only works for mega  (Read 426 times)
0 Members and 1 Guest are viewing this topic.
The Netherlands
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In the fileAvrdudeUploader.java,
the function: "public boolean avrdude(Collection params) throws RunnerException {"
Code:
// XXX: quick hack to chop the "atmega" off of "atmega8" and "atmega168",
    // then shove an "m" at the beginning.  won't work for attiny's, etc.
    commandDownloader.add("-pm" +
      Preferences.get("boards." + Preferences.get("board") + ".build.mcu").substring(6));
    commandDownloader.addAll(params);

This code only works for a atmega series
But if your using a other AVR, in my case at90can128
I get this error: avrdude: AVR Part "mn128" not found.

I have changed the "avrdude.conf" file the mcu id from c128 to mn128, and that works but its a very dirty hack.

Is it possible in a new release to make it support all AVR's?
Like adding in the file "boards.txt" a mcu id?
something like this:
Code:
commandDownloader.add("-p" +
      Preferences.get("boards." + Preferences.get("board") + ".build.mcuid"));
Or even nicer would be to get it out the "avrdude.conf" file
Logged

The Netherlands
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have recompiled the arduino with the ID in the boards.txt file

Code:
at90can128.build.mcuid=c128

works like a charm
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Issue created: http://code.google.com/p/arduino/issues/detail?id=130

Does anyone know if avr-gcc and avrdude can use the same names for the processors?  For example, right now, we're passing atmega328p to avr-gcc and m328p to avrdude.
Logged

Bonn, Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 903
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

nothing but a guess, but isnt it possible to make aliases in make files?
Logged

Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

Pages: [1]   Go Up
Jump to: