I finally got the command line to work from windows!!!!
Here are all the steps to make it work.
-
My avrdude.exe was crashing because I had an old winavr path in my windows environment “PATH” variable which had an old version of avrdude.exe; so I just removed that from my path. I guess my winavr will not work but I can set that up again some other day.
-
I downloaded the new Arduino 19
-
I followed the install steps at arduino playground WindowsCommandLine:
a) I put the three new downloaded text files in this path on my box:
C:\Documents and Settings\Admin\My Documents\Electronics\Arduino\Arduino command line
b) I edited these two files before renaming them to as *.bat files:
IN agetpref.txt
Change:
set arduino_runtime=!arduino_path!\hardware\cores\arduino
to:
set arduino_runtime=!arduino_path!\hardware\arduino\cores\arduino
IN abuild.txt
change:
set abuild_include_paths_root=!arduino_path!\hardware\libraries
to:
set abuild_include_paths_root=!arduino_path!\libraries
change:
for /D %%d in ("!arduino_path!\hardware\libraries*.") do (
to:
for /D %%d in ("!arduino_path!\libraries*.") do (
-
My COM port for my Arduino was seen as COM7 and I went into the windows device manager and changed the baud rate to 56700 (I'm not sure you have to do this but I wanted everything set to 56700 baud so I did).
-
I used these values for my new windows environment variables.
FIRST NOTE: I have the Arduino Duemilanove. If your board is different you will have to alter the ARDUINO_MCU environment variable.
SECOND NOTE: The ARDUINO_PROGRAMMER = stk500v1 is very important!
a) I added this to the front of my windows “PATH” environment variable:
C:\Documents and Settings\Admin\My Documents\Electronics\Arduino\Arduino command line;
b) Other environment variables added per the wiki instruction:
ARDUINO_PATH=C:\Documents and Settings\Admin\My Documents\Electronics\Arduino\Arduino IDE-0019
ARDUINO_MCU=atmega328p
ARDUINO_PROGRAMMER=stk500v1
ARDUINO_FCPU=16000000
ARDUINO_COMPORT=COM7
ARDUINO_BURNRATE=57600
- I opened a command line window and changed to the folder that has my blink sketch example.
cd C:\Documents and Settings\Admin\My Documents\Electronics\Arduino\My Projects\Duemilanove_ATmega328\Blink
- Type this to compile and upload the sketch to the Arduino board:
abuild Blink.pde
a) It first compiles the sketch in the obj sub-folder then asked if you want to upload
b) I type 'u' for upload and I DID NOT push the rest button on the Arduino; it seemed to send the reset command over the USB cable via the COM driver.
That's it, it worked for me.
Below is what I seen in the command window after the upload was complete.
abuild.bat: Successfully built .\obj\Blink.pde.rom
abuild.bat: Successfully built .\obj\Blink.pde.hex
text data bss dec hex filename
0 1298 0 1298 512 .\obj\Blink.pde.hex
[Remember to reset your board right before uploading.]
Enter the first character of your choice...
Upload, Quit? u
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file ".\obj\Blink.pde.hex"
avrdude: input file .\obj\Blink.pde.hex auto detected as Intel Hex
avrdude: writing flash (1298 bytes):
Writing | ################################################## | 100% 0.67s
avrdude: 1298 bytes of flash written
avrdude: verifying flash memory against .\obj\Blink.pde.hex:
avrdude: load data flash data from input file .\obj\Blink.pde.hex:
avrdude: input file .\obj\Blink.pde.hex auto detected as Intel Hex
avrdude: input file .\obj\Blink.pde.hex contains 1298 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.59s
avrdude: verifying ...
avrdude: 1298 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
aupload.bat: exiting with return code 0