Skip to content

Commit

Permalink
Upload Files
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoAndrades committed Apr 26, 2021
1 parent 7d5aa46 commit a9e5784
Show file tree
Hide file tree
Showing 60 changed files with 7,457 additions and 0 deletions.
102 changes: 102 additions & 0 deletions hardware/samd/0.0.3/boards.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Copyright (c) 2015 Atmel Corp./Thibaut VIARD. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#--------------------------------------------------------------------------------------#
# IOT LB I v2
#--------------------------------------------------------------------------------------#
Atmel_SAMD21_lb_i_v2.name=IOT in Motion - LB I vs.2
Atmel_SAMD21_lb_i_v2.vid.0=0x03eb
Atmel_SAMD21_lb_i_v2.pid.0=0x6124
Atmel_SAMD21_lb_i_v2.vid.1=0x2341
Atmel_SAMD21_lb_i_v2.pid.1=0x004d
Atmel_SAMD21_lb_i_v2.upload.tool=arduino:bossac
Atmel_SAMD21_lb_i_v2.upload.protocol=sam-ba
Atmel_SAMD21_lb_i_v2.upload.maximum_size=262144
Atmel_SAMD21_lb_i_v2.upload.use_1200bps_touch=true
Atmel_SAMD21_lb_i_v2.upload.wait_for_upload_port=true
Atmel_SAMD21_lb_i_v2.upload.native_usb=true
Atmel_SAMD21_lb_i_v2.build.mcu=cortex-m0plus
Atmel_SAMD21_lb_i_v2.build.f_cpu=48000000L
Atmel_SAMD21_lb_i_v2.build.usb_product="IOT in Motion - LB I vs.2"
Atmel_SAMD21_lb_i_v2.build.usb_manufacturer="IOT Corp"
Atmel_SAMD21_lb_i_v2.build.board=SAMD_ATMEL_SAMD21_XPRO_V1
Atmel_SAMD21_lb_i_v2.build.core=arduino:arduino
Atmel_SAMD21_lb_i_v2.build.extra_flags=-D__SAMD21J18A__ {build.usb_flags}
Atmel_SAMD21_lb_i_v2.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
Atmel_SAMD21_lb_i_v2.build.openocdscript=
Atmel_SAMD21_lb_i_v2.build.variant=lb_i_v2
Atmel_SAMD21_lb_i_v2.build.variant_system_lib=
Atmel_SAMD21_lb_i_v2.build.vid=0x2341
Atmel_SAMD21_lb_i_v2.build.pid=0x804d
#--------------------------------------------------------------------------------------#

#--------------------------------------------------------------------------------------#
# IOT LB I v3
#--------------------------------------------------------------------------------------#
Atmel_SAMD21_lb_i_v3.name=IOT in Motion - LB I vs.3
Atmel_SAMD21_lb_i_v3.vid.0=0x03eb
Atmel_SAMD21_lb_i_v3.pid.0=0x6124
Atmel_SAMD21_lb_i_v3.vid.1=0x2341
Atmel_SAMD21_lb_i_v3.pid.1=0x004d
Atmel_SAMD21_lb_i_v3.upload.tool=arduino:bossac
Atmel_SAMD21_lb_i_v3.upload.protocol=sam-ba
Atmel_SAMD21_lb_i_v3.upload.maximum_size=262144
Atmel_SAMD21_lb_i_v3.upload.use_1200bps_touch=true
Atmel_SAMD21_lb_i_v3.upload.wait_for_upload_port=true
Atmel_SAMD21_lb_i_v3.upload.native_usb=true
Atmel_SAMD21_lb_i_v3.build.mcu=cortex-m0plus
Atmel_SAMD21_lb_i_v3.build.f_cpu=48000000L
Atmel_SAMD21_lb_i_v3.build.usb_product="IOT in Motion - LB I vs.3"
Atmel_SAMD21_lb_i_v3.build.usb_manufacturer="IOT Corp"
Atmel_SAMD21_lb_i_v3.build.board=SAMD_ATMEL_SAMD21_XPRO_V1
Atmel_SAMD21_lb_i_v3.build.core=arduino:arduino
Atmel_SAMD21_lb_i_v3.build.extra_flags=-D__SAMD21J18A__ {build.usb_flags}
Atmel_SAMD21_lb_i_v3.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
Atmel_SAMD21_lb_i_v3.build.openocdscript=
Atmel_SAMD21_lb_i_v3.build.variant=lb_i_v3
Atmel_SAMD21_lb_i_v3.build.variant_system_lib=
Atmel_SAMD21_lb_i_v3.build.vid=0x2341
Atmel_SAMD21_lb_i_v3.build.pid=0x804d
#--------------------------------------------------------------------------------------#

#--------------------------------------------------------------------------------------#
# IOT LB I v3
#--------------------------------------------------------------------------------------#
Atmel_SAMD21_lb_ii_v3_1.name=IOT in Motion - LB II vs.3.1
Atmel_SAMD21_lb_ii_v3_1.vid.0=0x03eb
Atmel_SAMD21_lb_ii_v3_1.pid.0=0x6124
Atmel_SAMD21_lb_ii_v3_1.vid.1=0x2341
Atmel_SAMD21_lb_ii_v3_1.pid.1=0x004d
Atmel_SAMD21_lb_ii_v3_1.upload.tool=arduino:bossac
Atmel_SAMD21_lb_ii_v3_1.upload.protocol=sam-ba
Atmel_SAMD21_lb_ii_v3_1.upload.maximum_size=262144
Atmel_SAMD21_lb_ii_v3_1.upload.use_1200bps_touch=true
Atmel_SAMD21_lb_ii_v3_1.upload.wait_for_upload_port=true
Atmel_SAMD21_lb_ii_v3_1.upload.native_usb=true
Atmel_SAMD21_lb_ii_v3_1.build.mcu=cortex-m0plus
Atmel_SAMD21_lb_ii_v3_1.build.f_cpu=48000000L
Atmel_SAMD21_lb_ii_v3_1.build.usb_product="IOT in Motion - LB II vs.3.1"
Atmel_SAMD21_lb_ii_v3_1.build.usb_manufacturer="IOT Corp"
Atmel_SAMD21_lb_ii_v3_1.build.board=SAMD_ATMEL_SAMD21_XPRO_V1
Atmel_SAMD21_lb_ii_v3_1.build.core=arduino:arduino
Atmel_SAMD21_lb_ii_v3_1.build.extra_flags=-D__SAMD21J18A__ {build.usb_flags}
Atmel_SAMD21_lb_ii_v3_1.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
Atmel_SAMD21_lb_ii_v3_1.build.openocdscript=
Atmel_SAMD21_lb_ii_v3_1.build.variant=lb_ii_v3_1
Atmel_SAMD21_lb_ii_v3_1.build.variant_system_lib=
Atmel_SAMD21_lb_ii_v3_1.build.vid=0x2341
Atmel_SAMD21_lb_ii_v3_1.build.pid=0x804d
#--------------------------------------------------------------------------------------#
182 changes: 182 additions & 0 deletions hardware/samd/0.0.3/bootloaders/atmel_samd21_xpro_v1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# Copyright (c) 2015 Atmel Corp./Thibaut VIARD. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# -----------------------------------------------------------------------------
# Paths
ifeq ($(OS),Windows_NT)

# Are we using mingw/msys/msys2/cygwin?
ifeq ($(TERM),xterm)
T=$(shell cygpath -u $(LOCALAPPDATA))
# T=$(shell cygpath -u $(APPDATA))
MODULE_PATH?=$(T)/Arduino15/packages/arduino
ARM_GCC_PATH?=$(MODULE_PATH)/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-
RM=rm
SEP=/
else
MODULE_PATH?=$(LOCALAPPDATA)/Arduino15/packages/arduino
# MODULE_PATH?=$(APPDATA)/Arduino15/packages/arduino
ARM_GCC_PATH?=$(MODULE_PATH)/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-
RM=rm
SEP=\\
endif
else
UNAME_S := $(shell uname -s)

ifeq ($(UNAME_S),Linux)
MODULE_PATH?=$HOME/.arduino15/packages/arduino
ARM_GCC_PATH?=$(MODULE_PATH)/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-
RM=rm
SEP=/
endif

ifeq ($(UNAME_S),Darwin)
MODULE_PATH?=$HOME/Library/Arduino15/packages/arduino/
ARM_GCC_PATH?=$(MODULE_PATH)/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-
RM=rm
SEP=/
endif
endif

BUILD_PATH=build

# -----------------------------------------------------------------------------
# Tools
CC=$(ARM_GCC_PATH)gcc
OBJCOPY=$(ARM_GCC_PATH)objcopy
NM=$(ARM_GCC_PATH)nm
SIZE=$(ARM_GCC_PATH)size

# -----------------------------------------------------------------------------
# Compiler options
#-w
CFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -c -std=gnu99 -ffunction-sections -fdata-sections -nostdlib -nostartfiles --param max-inline-insns-single=500
ifdef DEBUG
CFLAGS+=-g3 -O1 -DDEBUG=1
else
CFLAGS+=-Os -DDEBUG=0
endif
# we put here the Atmel SAM-BA USB VID/PID and remove the support of Serial, because Serial pins are different than Zero ones
CFLAGS_EXTRA?=-D__SAMD21J18A__ -DUSB_PID_LOW=0x24 -DUSB_PID_HIGH=0x61 -DUSB_VID_LOW=0xEB -DUSB_VID_HIGH=0x03 -DSAM_BA_INTERFACE=2
INCLUDES=-I"$(MODULE_PATH)/tools/CMSIS/4.0.0-atmel/CMSIS/Include/" -I"$(MODULE_PATH)/tools/CMSIS/4.0.0-atmel/Device/ATMEL/"

# -----------------------------------------------------------------------------
# Linker options
LDFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all
LDFLAGS+=-Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols --specs=nano.specs --specs=nosys.specs

# -----------------------------------------------------------------------------
# Source files and objects
# this path has to be updated if Arduino delivers any samd-core update!
PROJECT_PATH=$(MODULE_PATH)/hardware/samd/1.6.2/bootloaders/zero
SOURCES_ORIG= \
board_driver_led.c \
board_driver_serial.c \
board_driver_usb.c \
board_init.c \
board_startup.c \
main.c \
sam_ba_usb.c \
sam_ba_cdc.c \
sam_ba_monitor.c \
sam_ba_serial.c

#VPATH=$(PROJECT_PATH)
SOURCES=$(addprefix $(PROJECT_PATH)/,$(SOURCES_ORIG))
OBJECTS=$(addprefix $(BUILD_PATH)/,$(SOURCES_ORIG:.c=.o))
#DEPS=$(addprefix $(BUILD_PATH)/, $(SOURCES:.c=.d))

NAME=samd21_sam_ba
ELF=$(NAME).elf
BIN=$(NAME).bin
HEX=$(NAME).hex

ifneq "test$(AVRSTUDIO_EXE_PATH)" "test"
AS_BUILD=copy_for_atmel_studio
AS_CLEAN=clean_for_atmel_studio
else
AS_BUILD=
AS_CLEAN=
endif

all: print_info $(BIN) $(HEX) $(AS_BUILD)

$(ELF): Makefile $(BUILD_PATH) $(OBJECTS)
@echo ----------------------------------------------------------
@echo Creating ELF binary
"$(CC)" -L"$(PROJECT_PATH)" $(LDFLAGS) -Os -Wl,--gc-sections -save-temps -Tbootloader_samd21x18.ld -Wl,-Map,"$(BUILD_PATH)/$(NAME).map" -o "$(BUILD_PATH)/$(ELF)" -Wl,--start-group $(OBJECTS) -lm -Wl,--end-group
"$(NM)" "$(BUILD_PATH)/$(ELF)" >"$(BUILD_PATH)/$(NAME)_symbols.txt"
"$(SIZE)" --format=sysv -t -x $(BUILD_PATH)/$(ELF)

$(BIN): $(ELF)
@echo ----------------------------------------------------------
@echo Creating flash binary
"$(OBJCOPY)" -O binary $(BUILD_PATH)/$< $@

$(HEX): $(ELF)
@echo ----------------------------------------------------------
@echo Creating flash binary
"$(OBJCOPY)" -O ihex $(BUILD_PATH)/$< $@

$(BUILD_PATH)/%.o: $(BUILD_PATH)

$(BUILD_PATH)/%.o: $(PROJECT_PATH)/%.c
@echo ----------------------------------------------------------
@echo Compiling $< to $@
"$(CC)" $(CFLAGS) $(CFLAGS_EXTRA) $(INCLUDES) "$<" -o $@
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

$(BUILD_PATH):
@echo ----------------------------------------------------------
@echo Creating build folder
-mkdir $(BUILD_PATH)

print_info:
@echo ----------------------------------------------------------
@echo Compiling bootloader using
@echo BASE PATH = $(MODULE_PATH)
@echo GCC PATH = $(ARM_GCC_PATH)
@echo PROJ PATH = $(PROJECT_PATH)
@echo SRC_ORIG = $(SOURCES_ORIG)
@echo SRC = $(SOURCES)
@echo OBJ = $(OBJECTS)
# @echo OS = $(OS)
# @echo SHELL = $(SHELL)
# @echo TERM = $(TERM)
"$(CC)" -v
"$(MAKE)" -v
# env
@echo ----------------------------------------------------------

copy_for_atmel_studio: $(BIN) $(HEX)
@echo ----------------------------------------------------------
@echo Atmel Studio detected, copying ELF to project root for debug
cp $(BUILD_PATH)/$(ELF) .

clean_for_atmel_studio:
@echo ----------------------------------------------------------
@echo Atmel Studio detected, cleaning ELF from project root
-$(RM) ./$(ELF)

clean: $(AS_CLEAN)
@echo ----------------------------------------------------------
@echo Cleaning project
-$(RM) -f $(BIN)
-$(RM) -f $(HEX)
-$(RM) -f $(BUILD_PATH)/*
-rmdir $(BUILD_PATH)

.PHONY: print_info $(BUILD_PATH) clean_for_atmel_studio
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit a9e5784

Please sign in to comment.