Skip to content

Commit 4c4c9ac

Browse files
committed
Merge with upstream
2 parents 62f2d70 + 5fcd04c commit 4c4c9ac

File tree

12 files changed

+414
-11
lines changed

12 files changed

+414
-11
lines changed

Arduino.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#
2020
# Original Arduino adaptation by mellis, eighthave, oli.keller
2121
#
22-
# Current version: 1.5.2
22+
# Current version: 1.6.0
2323
#
2424
# Refer to HISTORY.md file for complete history of changes
2525
#
@@ -1045,7 +1045,7 @@ endif
10451045

10461046
ifndef CFLAGS_STD
10471047
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
1048-
CFLAGS_STD = -std=gnu11 -flto -fno-fat-lto-objects
1048+
CFLAGS_STD = -std=gnu11 -flto -fno-fat-lto-objects -fdiagnostics-color
10491049
else
10501050
CFLAGS_STD =
10511051
endif
@@ -1056,7 +1056,7 @@ endif
10561056

10571057
ifndef CXXFLAGS_STD
10581058
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
1059-
CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics -flto
1059+
CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color
10601060
else
10611061
CXXFLAGS_STD =
10621062
endif
@@ -1164,7 +1164,7 @@ endif
11641164

11651165
########################################################################
11661166
# Tools version info
1167-
ARDMK_VERSION = 1.5
1167+
ARDMK_VERSION = 1.6
11681168
$(call show_config_variable,ARDMK_VERSION,[COMPUTED])
11691169

11701170
CC_VERSION := $(shell $(CC) -dumpversion)

Common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runscript_if_exists = \
1414

1515
# For message printing: pad the right side of the first argument with spaces to
1616
# the number of bytes indicated by the second argument.
17-
space_pad_to = $(shell echo $(1) " " | head -c$(2))
17+
space_pad_to = $(shell echo "$(1) " | head -c$(2))
1818

1919
# Call with some text, and a prefix tag if desired (like [AUTODETECTED]),
2020
show_config_info = $(call arduino_output,- $(call space_pad_to,$(2),20) $(1))

HISTORY.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ The following is the rough list of changes that went into different versions.
55
I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
66

77
### In Development
8+
- Fix: Add -fno-devirtualize flag to workaround g++ segfault bug (issue #486). (https://github.com/sej7278)
9+
- Fix: Quote the prefix tag in the space_pad_to function
10+
- Tweak: Set ARDMK_VERSION to 1.6 (https://github.com/sej7278)
11+
- New: Added -fdiagnostics-color to *STD flags (https://github.com/sej7278)
12+
- New: Add generation of tags file using ctags, which automatically includes project libs and Arduino core. (https://github.com/tuna-f1sh)
13+
14+
### 1.6.0 (2017-07-11)
815
- Fix: Allowed for SparkFun's weird usb pid/vid submenu shenanigans (issue #499). (https://github.com/sej7278)
916
- Fix: Do not include the Arduino header when calling generate_assembly on .cpp files. (https://github.com/Batchyx)
1017
- Fix: Auto-detect F_CPU on Teensy from boards.txt (https://github.com/DaWelter)
1118
- Fix: params typo in PuTTY section (issue #487) (https://github.com/ericdand)
1219
- Fix: Fixed sed expression to properly format show_submenu (issue #488) (https://github.com/cbosdo)
13-
- New: Add support for good old cu as monitor command (issue #492) (https://github.com/mwm)
1420
- Tweak: Removed tilde from documentation (issue #497). (https://github.com/sej7278)
21+
- New: Add support for good old cu as monitor command (issue #492) (https://github.com/mwm)
1522
- New: Add a documentation how to setup Makefile for 3rd party boards (issue #499). (https://github.com/MilanV)
16-
- New: Add generation of tags file using ctags, which automatically includes project libs and Arduino core. (https://github.com/tuna-f1sh)
23+
- New: Add support for Robotis OpenCM boards
1724

1825
### 1.5.2 (2017-01-11)
1926

OpenCM.mk

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
########################################################################
2+
#
3+
# Support for Robotis OpenCM boards
4+
#
5+
# http://en.robotis.com/index/product.php?cate_code=131010
6+
#
7+
# You must install the OpenCM IDE for this Makefile to work:
8+
#
9+
# http://support.robotis.com/en/software/robotis_opencm/robotis_opencm.htm
10+
#
11+
# Based on work that is copyright Jeremy Shaw, Sudar, Nicholas Zambetti,
12+
# David A. Mellis & Hernando Barragan.
13+
#
14+
# This file is free software; you can redistribute it and/or modify it
15+
# under the terms of the GNU Lesser General Public License as
16+
# published by the Free Software Foundation; either version 2.1 of the
17+
# License, or (at your option) any later version.
18+
#
19+
# Adapted from Teensy 3.x makefile which was adapted from Arduino 0011
20+
# Makefile by M J Oldfield
21+
#
22+
# Original Arduino adaptation by mellis, eighthave, oli.keller
23+
#
24+
########################################################################
25+
26+
ifndef ARDMK_DIR
27+
ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
28+
endif
29+
30+
# include Common.mk now we know where it is
31+
include $(ARDMK_DIR)/Common.mk
32+
33+
ARDUINO_DIR = $(OPENCMIDE_DIR)
34+
35+
ifndef ARDMK_VENDOR
36+
ARDMK_VENDOR = robotis
37+
endif
38+
39+
ifndef ARDUINO_CORE_PATH
40+
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/robotis/cores/robotis
41+
endif
42+
43+
ifndef BOARDS_TXT
44+
BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/boards.txt
45+
endif
46+
47+
ifndef PARSE_OPENCM
48+
# result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
49+
PARSE_OPENCM = $(shell grep -v "^\#" "$(BOARDS_TXT)" | grep $(1).$(2) | cut -d = -f 2- )
50+
endif
51+
52+
ifndef F_CPU
53+
F_CPU := $(call PARSE_OPENCM,$(BOARD_TAG),build.f_cpu)
54+
endif
55+
56+
# if boards.txt gets modified, look there, else hard code it
57+
ARCHITECTURE = $(call PARSE_OPENCM,$(BOARD_TAG),build.architecture)
58+
ifeq ($(strip $(ARCHITECTURE)),)
59+
ARCHITECTURE = arm
60+
endif
61+
62+
AVR_TOOLS_DIR = $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/$(ARCHITECTURE))
63+
64+
# Robotis has moved the platform lib dir to their root folder
65+
ifndef ARDUINO_PLATFORM_LIB_PATH
66+
ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/libraries
67+
$(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
68+
endif
69+
70+
ifndef ARDUINO_HEADER
71+
ARDUINO_HEADER = wirish.h
72+
endif
73+
74+
########################################################################
75+
# command names
76+
77+
ifndef CC_NAME
78+
CC_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.gcc)
79+
ifndef CC_NAME
80+
CC_NAME := arm-none-eabi-gcc
81+
else
82+
$(call show_config_variable,CC_NAME,[COMPUTED])
83+
endif
84+
endif
85+
86+
ifndef CXX_NAME
87+
CXX_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.g++)
88+
ifndef CXX_NAME
89+
CXX_NAME := arm-none-eabi-g++
90+
else
91+
$(call show_config_variable,CXX_NAME,[COMPUTED])
92+
endif
93+
endif
94+
95+
ifndef AS_NAME
96+
AS_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.as)
97+
ifndef AS_NAME
98+
AS_NAME := arm-none-eabi-as
99+
else
100+
$(call show_config_variable,AS_NAME,[COMPUTED])
101+
endif
102+
endif
103+
104+
ifndef OBJDUMP_NAME
105+
OBJDUMP_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.objdump)
106+
ifndef OBJDUMP_NAME
107+
OBJDUMP_NAME := arm-none-eabi-objdump
108+
else
109+
$(call show_config_variable,OBJDUMP_NAME,[COMPUTED])
110+
endif
111+
endif
112+
113+
ifndef AR_NAME
114+
AR_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.ar)
115+
ifndef AR_NAME
116+
AR_NAME := arm-none-eabi-ar
117+
else
118+
$(call show_config_variable,AR_NAME,[COMPUTED])
119+
endif
120+
endif
121+
122+
ifndef SIZE_NAME
123+
SIZE_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.size)
124+
ifndef SIZE_NAME
125+
SIZE_NAME := arm-none-eabi-size
126+
else
127+
$(call show_config_variable,SIZE_NAME,[COMPUTED])
128+
endif
129+
endif
130+
131+
ifndef NM_NAME
132+
NM_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.nm)
133+
ifndef NM_NAME
134+
NM_NAME := arm-none-eabi-nm
135+
else
136+
$(call show_config_variable,NM_NAME,[COMPUTED])
137+
endif
138+
endif
139+
140+
ifndef OBJCOPY_NAME
141+
OBJCOPY_NAME := $(call PARSE_OPENCM,$(BOARD_TAG),build.command.objcopy)
142+
ifndef OBJCOPY_NAME
143+
OBJCOPY_NAME := arm-none-eabi-objcopy
144+
else
145+
$(call show_config_variable,OBJCOPY_NAME,[COMPUTED])
146+
endif
147+
endif
148+
149+
# processor stuff
150+
ifndef MCU
151+
MCU := $(call PARSE_OPENCM,$(BOARD_TAG),build.family)
152+
endif
153+
154+
ifndef MCU_FLAG_NAME
155+
MCU_FLAG_NAME=mcpu
156+
endif
157+
158+
########################################################################
159+
# FLAGS
160+
ifndef USB_TYPE
161+
USB_TYPE = USB_SERIAL
162+
endif
163+
164+
CPPFLAGS += -DBOARD_$(call PARSE_OPENCM,$(BOARD_TAG),build.board)
165+
CPPFLAGS += -DMCU_$(call PARSE_OPENCM,$(BOARD_TAG),build.mcu)
166+
CPPFLAGS += -DSTM32_MEDIUM_DENSITY -DVECT_TAB_FLASH
167+
168+
CPPFLAGS += $(call PARSE_OPENCM,$(BOARD_TAG),build.option)
169+
170+
CXXFLAGS += -fno-rtti
171+
172+
CXXFLAGS += $(call PARSE_OPENCM,$(BOARD_TAG),build.cppoption)
173+
ifeq ("$(call PARSE_OPENCM,$(BOARD_TAG),build.gnu0x)","true")
174+
CXXFLAGS_STD += -std=gnu++0x
175+
endif
176+
177+
ifeq ("$(call PARSE_OPENCM,$(BOARD_TAG),build.elide_constructors)", "true")
178+
CXXFLAGS += -felide-constructors
179+
endif
180+
181+
CPPFLAGS += -mthumb -march=armv7-m -nostdlib -Wl,--gc-sections -Wall
182+
183+
LDFLAGS += -T$(ARDUINO_DIR)/hardware/robotis/cores/robotis/CM900/flash.ld
184+
LDFLAGS += -L$(ARDUINO_CORE_PATH)
185+
LDFLAGS += -mthumb -Xlinker --gc-sections -Wall
186+
187+
OTHER_LIBS += -lstdc++
188+
189+
########################################################################
190+
# Reset is handled by upload script
191+
override RESET_CMD =
192+
193+
########################################################################
194+
# Object conversion & uploading magic, modified from Arduino.mk
195+
override TARGET_HEX = $(OBJDIR)/$(TARGET).bin
196+
197+
ifndef AVRDUDE
198+
AVRDUDE := $(shell which robotis-loader 2>/dev/null)
199+
ifndef AVRDUDE
200+
AVRDUDE = $(ARDMK_DIR)/bin/robotis-loader
201+
endif
202+
endif
203+
204+
override avr_size = $(SIZE) --target=binary $(2)
205+
206+
override AVRDUDE_COM_OPTS =
207+
ifeq ($(CURRENT_OS), WINDOWS)
208+
override AVRDUDE_ARD_OPTS = $(COM_STYLE_MONITOR_PORT)
209+
else
210+
override AVRDUDE_ARD_OPTS = $(call get_monitor_port)
211+
endif
212+
213+
override AVRDUDE_UPLOAD_HEX = $(TARGET_HEX)
214+
215+
########################################################################
216+
# automatically include Arduino.mk
217+
218+
include $(ARDMK_DIR)/Arduino.mk
219+
220+
########################################################################
221+
# Object conversion & uploading magic, modified from Arduino.mk
222+
223+
$(OBJDIR)/%.bin: $(OBJDIR)/%.elf $(COMMON_DEPS)
224+
@$(MKDIR) $(dir $@)
225+
$(OBJCOPY) -v -Obinary $< $@
226+
@$(ECHO) '\n'
227+
$(call avr_size,$<,$@)
228+
ifneq ($(strip $(HEX_MAXIMUM_SIZE)),)
229+
@if [ `$(SIZE) --target=binary $@ | awk 'FNR == 2 {print $$2}'` -le $(HEX_MAXIMUM_SIZE) ]; then touch [email protected]; fi
230+
else
231+
@$(ECHO) "Maximum flash memory of $(BOARD_TAG) is not specified. Make sure the size of $@ is less then $(BOARD_TAG)\'s flash memory"
232+
233+
endif
234+
235+
# link fails to plug _sbrk into libc if core is a lib, seems a bug in the linker
236+
CORE_LIB = $(CORE_OBJS)

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,17 @@ For Teensy 3.x support you must first install [Teensyduino](http://www.pjrc.com/
279279

280280
See examples/BlinkTeensy for example usage.
281281

282+
## Robotis OpenCM
283+
284+
For Robotis OpenCM support you must first install [the OpenCM IDE](http://support.robotis.com/en/software/robotis_opencm/robotis_opencm.htm)
285+
286+
See examples/BlinkOpenCM for example usage.
287+
288+
For large Robotis projects, [libmaple](https://github.com/Rhoban/Maple) may be more appropriate, as the OpenCM IDE uses a very old compiler release.
289+
282290
## Versioning
283291

284-
The current version of the makefile is `1.5.2`. You can find the full history in the [HISTORY.md](HISTORY.md) file
292+
The current version of the makefile is `1.6.0`. You can find the full history in the [HISTORY.md](HISTORY.md) file
285293

286294
This project adheres to Semantic [Versioning 2.0](http://semver.org/).
287295

ard-reset-arduino.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH ARD-RESET-ARDUINO "1" "January 2017" "ard-reset-arduino 1.5.2" "Arduino CLI Reset"
1+
.TH ARD-RESET-ARDUINO "1" "January 2017" "ard-reset-arduino 1.6.0" "Arduino CLI Reset"
22

33
.SH NAME
44
ard-reset-arduino - Reset Arduino board

0 commit comments

Comments
 (0)