From b351ab375d09c3890635552fe3535da66d29cde1 Mon Sep 17 00:00:00 2001 From: Lorenzo Delana Date: Sat, 13 Oct 2018 02:21:47 +0200 Subject: [PATCH 1/5] Update arduino-mk-vars.md --- arduino-mk-vars.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arduino-mk-vars.md b/arduino-mk-vars.md index b6b9b37..7434316 100644 --- a/arduino-mk-vars.md +++ b/arduino-mk-vars.md @@ -1281,6 +1281,24 @@ AVRDUDE_CONF = /usr/share/arduino/hardware/tools/avrdude.conf ---- +### AVRDUDE_AUTOERASE_FLASH + +**Description:** + +Enable autoerase flash. + +By default disabled. + +**Example:** + +```Makefile +AVRDUDE_AUTOERASE_FLASH = yes +``` + +**Requirement:** *Optional* + +---- + ### AVR_TOOLS_PATH **Description:** From ec1947a7cda724b4de7783a1f74abf31ae59e955 Mon Sep 17 00:00:00 2001 From: Lorenzo Delana Date: Sat, 13 Oct 2018 02:28:32 +0200 Subject: [PATCH 2/5] allow to enable AVRDUDE_AUTOERASE_FLASH --- Arduino.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Arduino.mk b/Arduino.mk index 0f34a82..2e324e5 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -1490,7 +1490,11 @@ endif # -D - Disable auto erase for flash memory # Note: -D is needed for Mega boards. # (See https://github.com/sudar/Arduino-Makefile/issues/114#issuecomment-25011005) -AVRDUDE_ARD_OPTS = -D -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P +ifeq ($(AVRDUDE_AUTOERASE_FLASH), yes) +else + AVRDUDE_ARD_OPTS = -D +endif +AVRDUDE_ARD_OPTS += -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P ifeq ($(CURRENT_OS), WINDOWS) # get_monitor_port checks to see if the monitor port exists, assuming it is # a file. In Windows, avrdude needs the port in the format 'com1' which is From dafdaafabd7929391cf5e0b21509f22bedae5ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Wed, 12 Jun 2019 16:18:28 +0200 Subject: [PATCH 3/5] Show the configuration when ARDUINO_QUIET=0 There is a bit of inconsistency between documentation and code regarding the ARDUINO_QUIET variable: 'arduino-mk-vars.md' states that ARDUINO_QUIET "Defaults to `0` (unset/disabled)", but the code only checks whether it's defined or not, and doesn't check whether it's set to '0' or something else. Consequently, having 'ARDUINO_QUIET=0' in the Makefile or running 'make ARDUINO_QUIET=0' contadicts the documentation and doesn't print the configuration. It also means that if someone in general prefers not to see a screenful of configuration on each build and therefore has 'ARDUINO_QUIET = 1' in the project's Makefile or 'config.mak', then there is no way to override it from the command line in the odd case when showing the configuration is desired. Modify the corresponding condition in Arduino.mk to check whether ARDUINO_QUIET is set to 0 and treat an undefined ARDUINO_QUIET variable as "set to 0" as well. --- Arduino.mk | 3 +++ HISTORY.md | 1 + 2 files changed, 4 insertions(+) diff --git a/Arduino.mk b/Arduino.mk index 0a0fd75..d9ed05b 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -241,6 +241,9 @@ arduino_output = # running for the first time (i.e., not after a restart after # regenerating the dependency file), then output the configuration. ifndef ARDUINO_QUIET + ARDUINO_QUIET = 0 +endif +ifeq ($(ARDUINO_QUIET),0) ifeq ($(MAKE_RESTARTS),) ifeq ($(MAKELEVEL),0) arduino_output = $(info $(1)) diff --git a/HISTORY.md b/HISTORY.md index 04ff1e4..fe79c75 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -11,6 +11,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Fix: Quote the prefix tag in the space_pad_to function - Fix: recognize serial monitors with full path in MONITOR_CMD - Fix: Grab USB_PRODUCT and USB_MANUFACTURER from boards.txt for 32u4 boards (issue #594). +- Fix: Show the configuration when ARDUINO_QUIET=0 - Tweak: Move chip erase flag from set_fuses to ispload to prevent sketch being nuked when setting fuses - Tweak: Set ARDMK_VERSION to 1.6 (https://github.com/sej7278) - Tweak: Move non-standard-related items from CxxFLAGS_STD to CxxFLAGS (issue #523) (https://github.com/sej7278) From 19d5aafd10fc24c715de99ed532beb601a6bc62a Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Date: Tue, 2 Jul 2019 19:02:57 +0200 Subject: [PATCH 4/5] Allow custom link script --- Teensy.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Teensy.mk b/Teensy.mk index d4f23bc..35107ac 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -114,7 +114,7 @@ LDFLAGS += $(call PARSE_BOARD,$(BOARD_TAG),build.flags.cpu) AMCU := $(call PARSE_BOARD,$(BOARD_TAG),build.mcu) LDFLAGS += -Wl,--gc-sections,--relax -LINKER_SCRIPTS = -T${ARDUINO_CORE_PATH}/${AMCU}.ld +LINKER_SCRIPTS ?= -T${ARDUINO_CORE_PATH}/${AMCU}.ld OTHER_LIBS = $(call PARSE_BOARD,$(BOARD_TAG),build.flags.libs) CPUFLAGS = $(call PARSE_BOARD,$(BOARD_TAG),build.flags.cpu) From d4ae799795d3c1f096d83b94e498715fbf9a1296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Mon, 25 Feb 2019 15:21:36 +0100 Subject: [PATCH 5/5] Build the ArduinoCore API As part of the big modularizing efforts of the Arduino project they split out the hardware-independent layer of the Arduino "language" from the hardware-specific cores into the dedicated 'ArduinoCore-API' repository. As described in 'ArduinoCore-API's README, the API source files won't reside directly in the directory of the standard Arduino core, i.e. in 'ARDUINO_CORE_PATH', but in its 'ARDUINO_CORE_PATH/api' subdirectory. Consequently, Arduino-Makefile won't be able to build any projects when using an Arduino core following the new directory structure. Prepare for the upcoming new Arduino core directory structure by building all 'ARDUINO_CORE_PATH/api/*.cpp' source files as well. Out of caution, look out for and build any .c source files in that directory, too: though there are no .c source files in the 'ArduinoCore-API' repository at the moment, in the future there might be. Furthermore, add this directory to the list of directories to be searched for header files: though it's not necessary to explicitly and directly include any header file from this directory ('Arduino.h' includes all there is), some projects might nonetheless do so, and their build would then break. Note that a 'make clean' will be most likely necessary when re-building a project after switching to the new directory structure. --- Arduino.mk | 6 +++++- HISTORY.md | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Arduino.mk b/Arduino.mk index d9ed05b..f7011de 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -925,6 +925,10 @@ ifeq ($(strip $(NO_CORE)),) CORE_CPP_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.cpp) CORE_AS_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.S) + # ArduinoCore-API + CORE_C_SRCS += $(wildcard $(ARDUINO_CORE_PATH)/api/*.c) + CORE_CPP_SRCS += $(wildcard $(ARDUINO_CORE_PATH)/api/*.cpp) + # USB Core if samd or sam ifeq ($(findstring sam, $(strip $(ARCHITECTURE))), sam) CORE_C_SRCS += $(wildcard $(ARDUINO_CORE_PATH)/avr/*.c) # avr core emulation files @@ -1159,7 +1163,7 @@ endif # Using += instead of =, so that CPPFLAGS can be set per sketch level CPPFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION) $(ARDUINO_ARCH_FLAG) \ - -I$(ARDUINO_CORE_PATH) -I$(ARDUINO_VAR_PATH)/$(VARIANT) \ + -I$(ARDUINO_CORE_PATH) -I$(ARDUINO_CORE_PATH)/api -I$(ARDUINO_VAR_PATH)/$(VARIANT) \ $(SYS_INCLUDES) $(PLATFORM_INCLUDES) $(USER_INCLUDES) -Wall -ffunction-sections \ -fdata-sections diff --git a/HISTORY.md b/HISTORY.md index fe79c75..8f228fe 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -31,6 +31,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - New: Add support for BOARD_CLOCK for board.menu.speed and board.menu.clock entries in boards.txt files. (https://github.com/dewhisna) - New: Updated Arch instructions. (https://github.com/Akram-Chehaima) - New: Add support for Robotis OpenCR 1.0 boards. +- New: Build the ArduinoCore API ### 1.6.0 (2017-07-11) - Fix: Allowed for SparkFun's weird usb pid/vid submenu shenanigans (issue #499). (https://github.com/sej7278)