diff options
| author | John Whittington <git@jbrengineering.co.uk> | 2018-01-02 17:35:47 +0000 |
|---|---|---|
| committer | John Whittington <git@jbrengineering.co.uk> | 2018-02-24 11:15:53 +0000 |
| commit | f80486609505876fb0f103c3c1d03aba8f6a0f79 (patch) | |
| tree | 3bde2adcc00485a98da3f74839462238d42c38ee /arduino-mk-vars.md | |
| parent | a6d979ef90ddae3549876917f80847ea647c284a (diff) | |
SAMD Cortex M0 device support (Zero, MKR1000, etc)
Compilation improvements by adding variant as other obj but not working on device
Arduino Zero devices with OpenOCD working
Created ARM_TOOLS_DIR and define arm toolchain executables in Sam.mk
Check avr-gcc on last AVR_TOOLS_DIR detect and indenting formatting
GDB debugging and programming added
Documentation updates and define ARDMK_VENDOR rather than include Sam.mk
Expand all parse_boards when defined rather than when used
Trim extra defines regex working on both macOS and Linux but need better fix
Print USB ids and added debug usage to readme
Add note on Arduino package dir and made board.txt work
Do ARM ARDUINO_ARCH define in Arduino.mk]
Add MZeroBlink to non-testable examples for now
Remove \B from extra defines grep
Add ARDUINO_PACKAGE_DIR for board support files
Fix a typo in the README
Fix typo in arduino-mk-vars.md
Prevent re-including Arduino.mk from Sam.mk when make restarts for upload
Add catrina to ARD_REST_OPTS if/else
Remove realpath in Sam.mk for cygwin compatability
SAMD bootloader support in ard-reset using --zero
Enters bootloader using open/close of port at 1200 BAUD, then polls the
attached devices for new port enumerating (bootloader). This is how the
Arduino IDE operates
Bossa support for Zero, MKR1000 etc
Re-word Arm README section after Native USB development
Reset for zero refactored like IDE
Zero bootloader reset tested on macOS and comments added
Re-word ARM bootloader and remove imports from testing
Patch changes ARDMK_VENDOR->ARCHITECHTURE, show_config_vars, ignore CORE_VER if emtpy
Common.mk header guard, openocd/bossac avoid separator, typos
Documentation update for patch changes
Move ARM tools to Sam.mk and auto-detect include
Correct accidental commit of Blink Makefile change
Lib fix with alternative core and documentation
Append zero to ARD_RESET_OPTS rather than set
Prioritise package ARM upload tools over path installed
Add note in README on ARM tools versions
Move openocd variant config script flag to OPTS
Diffstat (limited to 'arduino-mk-vars.md')
| -rw-r--r-- | arduino-mk-vars.md | 349 |
1 files changed, 328 insertions, 21 deletions
diff --git a/arduino-mk-vars.md b/arduino-mk-vars.md index d19d3d6..e3b6f07 100644 --- a/arduino-mk-vars.md +++ b/arduino-mk-vars.md @@ -11,6 +11,7 @@ The following are the different variables that can be overwritten in the user ma * [Avrdude setting variables](#avrdude-setting-variables) * [Bootloader variables](#bootloader-variables) * [ChipKIT variables](#chipkit-variables) +* [ARM variables](#arm-variables) * [Ctags variables](#ctags-variables) ## Global variables @@ -73,6 +74,29 @@ AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr ---- +### ARM_TOOLS_DIR + +**Description:** + +Directory where the arm toolchain is installed. `arm-none-eabi-*` should be +within a /bin subdirectory. + +Can usually be detected from `$ARDUINO_PACKAGE_DIR` /tools subdirectory when ARM +device support is installed. + +**Example:** + +```Makefile +ARM_TOOLS_DIR = /usr +# or +ARM_TOOLS_DIR = +/usr/share/arduino/hardware/tools/arm-none-eabi-gcc/VERSION +``` + +**Requirement:** *Optional* + +---- + ### RESET_CMD **Description:** @@ -114,6 +138,27 @@ ARDUINO_DIR = /Applications/Arduino.app/Contents/Java ---- +### ARDUINO_PACKAGE_DIR + +**Description:** + +Directory where the Arduino package support files are stored. Can auto-detect based on default OS IDE locations. + +**Example:** + +```Makefile +# Linux +ARDUINO_PACKAGE_DIR = $(HOME)/.arduino15/packages +# Mac OS X +ARDUINO_PACKAGE_DIR = $(HOME)/Library/Arduino15/packages +# Windows +ARDUINO_PACKAGE_DIR = $(USERPROFILE)/AppData/Local/Arduino15/packages +``` + +**Requirement:** *Optional* + +---- + ### ARDUINO_PLATFORM_LIB_PATH **Description:** @@ -155,12 +200,13 @@ ARDUINO_VERSION = 105 Architecture for Arduino 1.5+ -Defaults to unset for 1.0 or `avr` for 1.5+ +Defaults to unset for 1.0 or `avr` for 1.5+. This value is not literally the chip architecture but will often be +the chip series within a vendor's 'hardware' folder. For example, will default to `samd` if using Sam.mk. **Example:** ```Makefile -ARCHITECTURE = sam +ARCHITECTURE = arm ``` **Requirement:** *Optional* @@ -171,9 +217,9 @@ ARCHITECTURE = sam **Description:** -Board vendor/maintainer. +Board vendor/maintainer/series. -Defaults to `arduino` +Defaults to `arduino`. **Example:** @@ -658,7 +704,8 @@ ISP_PROG = stk500v1 **Description:** -Device path to ArduinoISP. Not needed for hardware ISP's. +Device path to ArduinoISP. Not needed for hardware ISP's. Also used to define +bootloader port on SAMD devices. **Example:** @@ -871,6 +918,18 @@ NM_NAME = pic32-nm ---- +### GDB_NAME + +**Description:** + +GDB utility. + +Defaults to `arm-none-eabi-gdb` + +**Requirement:** *Optional* + +---- + ### OPTIMIZATION_LEVEL **Description:** @@ -1044,7 +1103,7 @@ ASFLAGS += -my-as-only-flag **Description:** -Flags passed to the C pre-processor (for C, C++ and assembly source flies). Add +Flags passed to the C pre-processor (for C, C++ and assembly source files). Add more flags to this variable using `+=`. Defaults to all flags required for a typical build. @@ -1229,6 +1288,54 @@ ALTERNATE_CORE_PATH = $(HOME)/sketchbook/hardware/arduino-tiny/cores/tiny ---- +### CORE_VER + +**Description:** + +Alternate core release version. The Arduino board support packages are within +a sub-directory indicated by this define. + +Defaults to package current release. + +**Example:** + +```Makefile +CORE_VER = 1.6.17 +``` + +**Requirement:** *Optional* + +---- + +### CMSIS_DIR + +**Description:** + +Path to ARM CMSIS. Normally installed as part of ARM board support. + +Defaults to `ARDUINO_PACKAGE_DIR/tools/CMSIS/4.5.0/CMSIS` + +**Example:** + +```Makefile +CMSIS_DIR = /usr/share/CMSIS +``` + +**Requirement:** *Optional* + +---- + +### CMSIS_ATMEL_DIR + +**Description:** + +Path to CMSIS-Atmel directory. Installed with ARM support package. + +Defaults to `ARDUINO_PACKAGE_DIR/tools/CMSIS-Atmel/1.1.0/CMSIS` + +**Requirement:** *Optional* +---- + ### BOARDS_TXT **Description:** @@ -1385,6 +1492,67 @@ Would result in an absolute path to the bootloader hex file of `$(HOME)/sketchbo ---- +### BOOTLOADER_SIZE + +**Description:** + +Size of bootloader on ARM devices, ensures correct start address when flashing +application area. Normally parsed from boards.txt + +Defaults to `0x2000` + +**Requirement:** *Optional* + +---- + +### BOOTLOADER_UNPROTECT + +**Description:** + +Bootloader unprotect sequence for upload tool. Normally parsed from boards.txt + +Defaults to `at91samd bootloader 0` + +**Requirement:** *Optional* + +---- + +### BOOTLOADER_PROTECT + +**Description:** + +Bootloader protect sequence for upload tool. Normally parsed from boards.txt + +Defaults to `at91samd bootloader 16384` + +**Requirement:** *Optional* + +---- + +### BOOTLOADER_PROTECT_VERIFY + +**Description:** + +Bootloader protect and verify sequence for upload tool. Normally parsed from boards.txt + +Defaults to `at91samd bootloader` + +**Requirement:** *Optional* + +---- + +### BOOTLOADER_UPLOAD_TOOL + +**Description:** + +Bootloader upload binary to use. Normally parsed from boards.txt. + +Defaults to `openocd` + +**Requirement:** *Optional* + +---- + ## ChipKIT variables ### MPIDE_DIR @@ -1405,69 +1573,208 @@ MPIDE_DIR = $(HOME)/mpide ---- -## Ctags variables +### MPIDE_PREFERENCES_PATH -### TAGS_FILE +**Description:** + +Path to chipKIT `preferences.txt` file. + +Usually can be auto-detected as `AUTO_MPIDE_PREFERENCES_PATH` from the defaults `$(HOME)/.mpide/preferences.txt` (Linux) or `$(HOME)/Library/Mpide/preferences.txt` (OSX) + +**Example:** + +```Makefile +MPIDE_PREFERENCES_PATH = $(HOME)/chipkit/preferences.txt +``` + +**Requirement:** *Optional* + +---- + +## ARM variables + +### UPLOAD_TOOL **Description:** -Output file name for tags. Defaults to 'tags'. +Tool to upload binary to device. Normally parsed from boards.txt. + +Defaults to `openocd` **Example:** ```Makefile -TAGS_FILE = .tags +UPLOAD_TOOL = gdb ``` **Requirement:** *Optional* ---- -### CTAGS_OPTS +### DEBUG **Description:** -Additional options to pass to `ctags` command. +Define to set `DEBUG_FLAGS` and allow stepping of code using GDB. + +Defaults to undefined. **Example:** ```Makefile -# Run ctags in verbose mode -CTAGS_OPTS = -V +DEBUG = 1 ``` **Requirement:** *Optional* ---- -### CTAGS_CMD +### GDB_PORT **Description:** -Location of `ctags` binary. Defaults to user path. +Server port to use for GDB debugging or upload. Default assumes server running +on localhost but can re-define to use Black Magic Probe serial port. + +Defaults to `localhost:3333` **Example:** ```Makefile -CTAGS_CMD = /usr/local/bin/ +GDB_PORT = /dev/ttyACM0 ``` **Requirement:** *Optional* ---- -### MPIDE_PREFERENCES_PATH +### GDB_OPTS **Description:** -Path to chipKIT `preferences.txt` file. +Optional arguments to parse to GDB command. -Usually can be auto-detected as `AUTO_MPIDE_PREFERENCES_PATH` from the defaults `$(HOME)/.mpide/preferences.txt` (Linux) or `$(HOME)/Library/Mpide/preferences.txt` (OSX) +Defaults to `-ex "target extended-remote $(GDB_PORT)" -ex "monitor swdp_scan" -ex "attach 1" -ex "load" -d $(OBJDIR) $(TARGET_ELF)` + +**Requirement:** *Optional* + +---- + +### GDB_UPLOAD_OPTS + +**Description:** + +Optional arguments to parse to GDB command when uploading binary only. + +Defaults to `GDB_UPLOAD_OPTS = $(GDB_OPTS) -ex "set confirm off" -ex "set target-async off" -ex "set remotetimeout 30" -ex "detach" -ex "kill" -ex "quit"` + +**Requirement:** *Optional* + +---- + +### BOSSA + +**Description:** + +Path to bossac binary. + +Can usually be detected from `$ARDUINO_PACKAGE_DIR` /tools subdirectory when ARM +device support is installed. + +**Requirement:** *Optional* + +---- + +### BOSSA_OPTS + +**Description:** + +Flags to pass to bossac command. + +Defaults to `-d --info --erase --write --verify --reset` + +**Requirement:** *Optional* + +---- + +### OPENOCD + +**Description:** + +Path to openocd binary. + +Can usually be detected from `$ARDUINO_PACKAGE_DIR` /tools subdirectory when ARM +device support is installed. + +**Requirement:** *Optional* + +---- + +### OPENOCD_OPTS + +**Description:** + +Flags to pass to openocd command. If using openocd from non-Arduino +distributions, one should define this with the path to the Arduino openocd script. + +Defaults to `-d2` + +Example: + +```Makefile +OPENOCD_OPTS = $(ARDUINO_PACKAGE_DIR)/$(ARDMK_VENDOR)/tools/openocd/0.9.0-arduino6-static/share/openocd/scripts/ -f $(ARDUINO_PACKAGE_DIR)/$(ARDMK_VENDOR)/hardware/samd/1.6.17/variants/$(VARIANT)/$(OPENOCD_SCRIPT) +``` + +**Requirement:** *Optional* + + +---- + +## Ctags variables + +### TAGS_FILE + +**Description:** + +Output file name for tags. Defaults to 'tags'. **Example:** ```Makefile -MPIDE_PREFERENCES_PATH = $(HOME)/chipkit/preferences.txt +TAGS_FILE = .tags +``` + +**Requirement:** *Optional* + +---- + +### CTAGS_OPTS + +**Description:** + +Additional options to pass to `ctags` command. + +**Example:** + +```Makefile +# Run ctags in verbose mode +CTAGS_OPTS = -V +``` + +**Requirement:** *Optional* + +---- + +### CTAGS_CMD + +**Description:** + +Location of `ctags` binary. Defaults to user path. + +**Example:** + +```Makefile +CTAGS_CMD = /usr/local/bin/ ``` **Requirement:** *Optional* |
