Arduino IDE upto support version and SAMD builds

process uses direct downloads. Might be better to move to distribution
Arduino install + arduino-cli to install board support in future.
This commit is contained in:
John Whittington 2020-08-06 09:38:07 +02:00
parent bcce50471e
commit 264f8f604a
7 changed files with 69 additions and 5 deletions

View file

@ -78,7 +78,11 @@ ifneq ($(TEST),)
MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR)
endif
DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/arduino-1.0.6
ifndef ARDUINO_IDE_DIR
ARDUINO_IDE_DIR := $(shell basename $(basename $(basename $(lastword $(wildcard $(DEPENDENCIES_DIR)/arduino*)))))
# ARDUINO_IDE_DIR := arduino
endif
DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/$(ARDUINO_IDE_DIR)
ifeq ($(ARDUINO_DIR),)
ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR)
endif

View file

@ -12,6 +12,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
- 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
- Fix: Travis build and bring Arduino IDE upto date
- 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)

10
Sam.mk
View file

@ -31,6 +31,16 @@ ifndef COMMON_INCLUDED
include $(ARDMK_DIR)/Common.mk
endif
ifneq ($(TEST),)
CORE_VER = 1.8.6
CMSIS_VER = 4.5.0
CMSIS_ATMEL_VER = 1.2.0
ALTERNATE_CORE_PATH = $(DEPENDENCIES_DIR)/samd
CMSIS_DIR = $(DEPENDENCIES_DIR)/CMSIS/CMSIS
CMSIS_ATMEL_DIR = $(DEPENDENCIES_DIR)/CMSIS-Atmel/CMSIS
ARM_TOOLS_DIR = $(basename $(basename $(firstword $(wildcard $(DEPENDENCIES_DIR)/gcc-arm-none-eabi*))))
endif
ifndef ARDUINO_PACKAGE_DIR
# attempt to find based on Linux, macOS and Windows default
ARDUINO_PACKAGE_DIR := $(firstword \

View file

@ -7,3 +7,4 @@ pushd $SCRIPTS_DIR/..
source $SCRIPTS_DIR/bootstrap/chipkit.sh
source $SCRIPTS_DIR/bootstrap/arduino.sh
source $SCRIPTS_DIR/bootstrap/samd.sh

View file

@ -8,7 +8,8 @@ if [ -z "$ARDUINO_DIR" ] || ! test -e $ARDUINO_DIR || [ $OS == "cygwin" ]; then
echo "Installing Arduino..."
ARDUINO_BASENAME="arduino-1.0.6"
ARDUINO_BASENAME="arduino-1.8.11"
if [ $OS == "cygwin" ]; then
ARDUINO_FILE="$ARDUINO_BASENAME-windows".zip
EXTRACT_COMMAND="unzip -q"
@ -16,8 +17,8 @@ if [ -z "$ARDUINO_DIR" ] || ! test -e $ARDUINO_DIR || [ $OS == "cygwin" ]; then
ARDUINO_FILE="$ARDUINO_BASENAME-macosx".zip
EXTRACT_COMMAND="unzip -q"
else
ARDUINO_FILE="$ARDUINO_BASENAME-linux64".tgz
EXTRACT_COMMAND="tar -xzf"
ARDUINO_FILE="$ARDUINO_BASENAME-linux64".tar.xz
EXTRACT_COMMAND="tar -xf"
fi
ARDUINO_URL=http://arduino.cc/download.php?f=/$ARDUINO_FILE
@ -33,6 +34,7 @@ if [ -z "$ARDUINO_DIR" ] || ! test -e $ARDUINO_DIR || [ $OS == "cygwin" ]; then
then
echo "Installing Arduino to local folder..."
$EXTRACT_COMMAND $ARDUINO_FILE
mv $ARDUINO_BASENAME arduino
echo "Arduino installed"
fi

View file

@ -0,0 +1,46 @@
set -e
BOOTSTRAP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $BOOTSTRAP_DIR/common.sh
echo "Installing dependencies for building for the SAMD boards"
# these extract to dirs without versions...
SAMD_PACKAGE="samd-1.8.6"
CMSIS_PACKAGE="CMSIS-4.5.0"
CMSIS_ATMEL_PACKAGE="CMSIS-Atmel-1.2.0"
if [ $OS == "mac" ]; then
TOOLCHAIN_PACKAGE="gcc-arm-none-eabi-7-2017-q4-major-mac"
else
TOOLCHAIN_PACKAGE="gcc-arm-none-eabi-7-2017-q4-major-linux"
fi
ARDUINO_URL=https://downloads.arduino.cc
TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4
EXTRACT_COMMAND="tar -xjf"
_pushd $DEPENDENCIES_FOLDER
if ! test -e $SAMD_PACKAGE
then
echo "Downloading SAMD packages..."
download $ARDUINO_URL/cores/$SAMD_PACKAGE.tar.bz2 $SAMD_PACKAGE.tar.bz2
download $ARDUINO_URL/$CMSIS_PACKAGE.tar.bz2 $CMSIS_PACKAGE.tar.bz2
download $ARDUINO_URL/$CMSIS_ATMEL_PACKAGE.tar.bz2 $CMSIS_ATMEL_PACKAGE.tar.bz2
download $TOOLCHAIN_URL/$TOOLCHAIN_PACKAGE.tar.bz2 $TOOLCHAIN_PACKAGE.tar.bz2
fi
if ! test -d $SAMD_PACKAGE
then
echo "Installing packages to local folder..."
$EXTRACT_COMMAND $SAMD_PACKAGE.tar.bz2
$EXTRACT_COMMAND $CMSIS_PACKAGE.tar.bz2
$EXTRACT_COMMAND $CMSIS_ATMEL_PACKAGE.tar.bz2
$EXTRACT_COMMAND $TOOLCHAIN_PACKAGE.tar.bz2
echo "SAMD support installed"
fi
_popd
echo
echo "${bldgreen}SAMD dependencies installed.$txtrst"

View file

@ -7,7 +7,7 @@ failures=()
# These examples cannot be tested easily at the moment as they require
# alternate cores. The MakefileExample doesn't actually contain any source code
# to compile.
NON_TESTABLE_EXAMPLES=(ATtinyBlink MakefileExample TinySoftWareSerial BlinkOpenCM BlinkOpenCR BlinkTeensy BlinkNetworkRPi BlinkInAVRC MZeroBlink ZeroBlink DueBlink)
NON_TESTABLE_EXAMPLES=(ATtinyBlink MakefileExample TinySoftWareSerial BlinkOpenCM BlinkOpenCR BlinkTeensy BlinkNetworkRPi BlinkInAVRC DueBlink)
for dir in $TESTS_DIR/*/
do