Skip to content

Commit

Permalink
Tweak AVRdude conf file detection in windows
Browse files Browse the repository at this point in the history
On windows the AVRdude configuration file is now detected properly. The
comments and `README` are updated as well.

Fix #187
  • Loading branch information
EAGMnor authored and sudar committed Apr 11, 2014
1 parent 87129f1 commit 32d35da
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
27 changes: 27 additions & 0 deletions Arduino.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@
# ARDMK_DIR = /usr/share/arduino
# AVR_TOOLS_DIR = /usr
#
# On Windows declare this environmental variables using the windows
# configuration options. Control Panel > System > Advanced system settings
# Also take into account that when you set them you have to add '\' on
# all spaces and special characters.
# ARDUINO_DIR and AVR_TOOLS_DIR have to be relative and not absolute.
# This are just examples, you have to adapt this variables accordingly to
# your system.
#
# ARDUINO_DIR =../../../../../Arduino
# AVR_TOOLS_DIR =../../../../../Arduino/hardware/tools/avr
# ARDMK_DIR = /cygdrive/c/Users/"YourUser"/Arduino-Makefile
#
# On Windows it is highly recommended that you create a symbolic link directory
# for avoiding using the normal directories name of windows such as
# c:\Program Files (x86)\Arduino
# For this use the command mklink on the console.
#
#
# You can either set these up in the Makefile, or put them in your
# environment e.g. in your .bashrc
#
Expand Down Expand Up @@ -395,6 +413,15 @@ ifndef AVR_TOOLS_DIR

else
$(call show_config_variable,AVR_TOOLS_DIR,[USER])

# Check in Windows as Cygwin is being used, that the configuration file for the AVRDUDE is set
# Check if it works on MAC
ifeq ($(CURRENT_OS),WINDOWS)
ifndef AVRDUDE_CONF
AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
endif
endif

endif #ndef AVR_TOOLS_DIR

ifndef AVR_TOOLS_PATH
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
- Tweak: Replace perl reset script with Python script. (https://github.com/sej7278)
- Tweak: Made choice of Python2/3 interpreter up to the OS. (https://github.com/peplin)
- Tweak: Simplified packaging dependencies. (https://github.com/sej7278)
- Tweak: Tweak AVRDUDE conf detection in windows. (https://github.com/EAGMnor)

### 1.3.1 (2014-02-04)
- Fix: BUNDLED_AVR_TOOLS_DIR is now set properly when using only arduino-core and not the whole arduino package. (https://github.com/sej7278)
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ On Mac using MacPorts:

On Windows:

You need to install Cygwin and its packages for Make, Perl and the next Serial library.

pySerial can be downloaded from PyPi

On other systems:
Expand Down Expand Up @@ -93,12 +95,32 @@ On Windows (using cygwin), you might want to set:
MONITOR_PORT = com3
BOARD_TAG = mega2560

It is recommended in Windows that you create a symbolic link directory for avoiding problem with folder naming conventions on Windows. Specially if your your Arduino folder is in:

c:\Program Files (x86)\Arduino

You will get problem for the special characters on the folder name. More details about this can be found on https://github.com/sudar/Arduino-Makefile/issues/94

For creating a symbolic link you have to use the command “mklink” on Windows, e.g.

mklink /d c:\Arduino c:\Program Files (x86)\Arduino

At the end the variables end up being.

ARDUINO_DIR=../../../../../Arduino

Instead of

ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino



- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards`
- `MONITOR_PORT` - The port where your Arduino is plugged in, usually `/dev/ttyACM0` or `/dev/ttyUSB0` in Linux or Mac OS X and `com3`, `com4`, etc. in Windows.
- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be
relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino").
- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino`
- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it.
- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it. Otherwise set it realtive and not absolute.

The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file.

Expand Down

0 comments on commit 32d35da

Please sign in to comment.