Pages: [1]   Go Down
Author Topic: Way to supply non-serial port to avrdude from IDE?  (Read 610 times)
0 Members and 1 Guest are viewing this topic.
New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

So, I have my "Netduino" shield successfully programming a Bare Bones Freeduino using this command line (in OS X):

Code:
arduino-0010/hardware/tools/avr/bin/avrdude -C arduino-0010/hardware/tools/avr/etc/avrdude.conf -pm168 -cstk500v1   -Pnet:192.168.2.105:7 -D   -Uflash:w:/tmp/build34808.tmp/Blink_edit.hex:i

(You may recall I achieved this previously on a breadboard, but now it's working with the shield--once I got the rx/tx lines in the right order!)

Now, I foolishly thought I might be able to get away with setting the IDE preferences for serial.port to the format that avrdude expects for network devices and have it work. Alas, it did not. Doing so causes a failure:

Code:
processing.app.SerialException: Serial port 'net:192.168.2.105:7' not found.  Did you select the right one from the Tools > Serial Port menu?
      at processing.app.Serial.<init>(Serial.java:149)
      at processing.app.Serial.<init>(Serial.java:72)
      at processing.app.Uploader.flushSerialBuffer(Uploader.java:66)
      at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:55)
        ...

So, I was wondering if there is an undocumented way to pass avrdude its -P argument without it being treated like a serial port? (I wonder if that's what the "Burn Bootloader" code does?)

If this feature does not exist, then what are the chances of it being implemented so I can upload sketches over the network from the IDE? (I wonder if this ties in with the work I think is being done for Arduino 0011 to enable burning of sketches via USB programmers?)

Or do I just have to write the patch myself? smiley-grin

--Phil.
« Last Edit: January 29, 2008, 09:14:45 am by follower » Logged

Forum Administrator
Offline Offline
Newbie
*****
Karma: 3
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what's wrong with writing the patch yourself smiley
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
what's wrong with writing the patch yourself smiley
Well, it would be sub-optimal to write the patch and find out the functionality is already there but hidden. :-)

--Phil.
Logged

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

Hmm, it might work under Arduino 0011 in Mac or Linux, but probably not in Windows (because of the \\.\ prefix you have to pre-pend to the names of COM ports).  Take a look at app/AvrdudeUploader.java and app/Uploader.java in the Arduino source code.
Logged

New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys,

I'm new to Arduino but not new to AVRs and AVR-GCC etc.

By way of introduction, I have worked on several Open Source AVR Model Railroad Digital Control projects (http://embeddedloconet.sourceforge.net & http://opendcc.sourceforge.net) and have an AVRISP, AVRISP mkII, AVR Dragon, AVR JTAG-II and STK500 to assist development.

I've use AVRDUDE for a long time and also done a few little bug fixes in AVRDUDE a while back to improve the timing of parallel port bit-bashed programmers work in Windows and so I have a reasonable handle on this... smiley

My interest in Arduino is fueled by the possibility of using it to reduce the entry barrier new DIYers face getting into embedded C coding etc and this platform looks to do quite a bit to hide a lot of complexity and make it a lot easier to get started, WITHOUT really closing any doors to experienced C/C++ developers who know what is really going on here and how they can do normal C/C++ stuff anyway.

Looking over the Arduino IDE and reading the docs I can see that having a bootloader is real good to make it easy to work with the Arduino boards and I have used them before, but if you want to just work directly with one of the usual ICSP programmers then things look to get real hard quickly.

I note some comments about this being fixed in the 0011 release but wonder what is being planned? Are these changes in the SVN codebase already?

Without knowing the v 0011 solution, I wonder if you would consider adding an option to the IDE to NOT specify any ports, baud or programmer and just let AVRDUDE use its own defaults or the user defined programmer and ports etc in the avrdude.rc file - if it exists?

This would allow advanced users to define their own programmer and just leave the Arduino IDE to call AVRDUDE specifying the files and fuses etc but leave off the programmer specific options.

I've downloaded all the development source code and Cygwin and the build seems to work so I might hack the existing code to leave off the programmer stuff to get me going as I really want to play without having to toggle windows all the time... smiley-sad

Comments?

Cheers

Alex Shepherd
Logged


Cheers
Alex Shepherd

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

The new code is in SVN.  Basically, you set the upload.using preference in the Arduino preferences file to be the key of the one of the programmers defined in programmers.txt.  The upload will then use that programmer.  You can add programmers to that file as well, AVRISP, AVRISP mkII, stk500, etc. should work (anything that's serial, parallel, or USB, I think).  I didn't know about the avrdude.rc providing default options - I'll look into that.  Maybe I'll add the option to set upload.using to "avrdude" or to have it use that.

For the moment, I'm planning to leave this option out of the IDE, because I don't want to confuse people that don't know what a programmer is (and don't need to), which I think is a large portion of our user base.
Logged

New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The new code is in SVN.  Basically, you set the upload.using preference in the Arduino preferences file to be the key of the one of the programmers defined in programmers.txt.  The upload will then use that programmer.  You can add programmers to that file as well, AVRISP, AVRISP mkII, stk500, etc. should work (anything that's serial, parallel, or USB, I think).

There only looks to be one serial port definition between the programmer and the serial monitor console. Is there are way to define the programmer serial port and the monitor serial port separately?

Quote
 I didn't know about the avrdude.rc providing default options - I'll look into that.  Maybe I'll add the option to set upload.using to "avrdude" or to have it use that.

Yes that sounds like a good option

Quote
For the moment, I'm planning to leave this option out of the IDE, because I don't want to confuse people that don't know what a programmer is (and don't need to), which I think is a large portion of our user base.

ok - so long as we have a way to tweak it, that sounds fine.
Logged


Cheers
Alex Shepherd

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

Quote
Quote
The new code is in SVN.  Basically, you set the upload.using preference in the Arduino preferences file to be the key of the one of the programmers defined in programmers.txt.  The upload will then use that programmer.  You can add programmers to that file as well, AVRISP, AVRISP mkII, stk500, etc. should work (anything that's serial, parallel, or USB, I think).

There only looks to be one serial port definition between the programmer and the serial monitor console. Is there are way to define the programmer serial port and the monitor serial port separately?

Not right now.  You'll need to pick the serial port of the programmer, upload your sketch, and then select the serial port you're using for communication with the board before opening the serial monitor.
Logged

New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
There only looks to be one serial port definition between the programmer and the serial monitor console. Is there are way to define the programmer serial port and the monitor serial port separately?

Not right now.  You'll need to pick the serial port of the programmer, upload your sketch, and then select the serial port you're using for communication with the board before opening the serial monitor.

Ok, then adding the option of letting AVRDUDE use it's avrdude.rc for programmer and ports etc. is probably the easiest way to solve the sharing the one port name problem.

it's not much of a problem to open up another serial terminal app and leave the IDE serial port for programmer use to solve the problem until a better way is implemented

Alex
Logged


Cheers
Alex Shepherd

Pages: [1]   Go Up
Jump to: