Skip to content

Commit b94b432

Browse files
authored
Merge pull request arduino#267 from jepler/feather-can-bsp
Adafruit Feather M4 CAN: Add support for board
2 parents 4c6d754 + da80034 commit b94b432

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+58002
-3
lines changed

boards.txt

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,70 @@ adafruit_feather_m4.menu.debug.off=Off
711711
adafruit_feather_m4.menu.debug.on=On
712712
adafruit_feather_m4.menu.debug.on.build.flags.debug=-g
713713

714+
# Adafruit Feather M4 CAN (SAME51)
715+
# ------------------------------
716+
adafruit_feather_m4_can.name=Adafruit Feather M4 CAN (SAME51)
717+
adafruit_feather_m4_can.vid.0=0x239A
718+
adafruit_feather_m4_can.pid.0=0x80CD
719+
adafruit_feather_m4_can.vid.1=0x239A
720+
adafruit_feather_m4_can.pid.1=0x00CD
721+
adafruit_feather_m4_can.upload.tool=bossac18
722+
adafruit_feather_m4_can.upload.protocol=sam-ba
723+
adafruit_feather_m4_can.upload.maximum_size=507904
724+
adafruit_feather_m4_can.upload.offset=0x4000
725+
adafruit_feather_m4_can.upload.use_1200bps_touch=true
726+
adafruit_feather_m4_can.upload.wait_for_upload_port=true
727+
adafruit_feather_m4_can.upload.native_usb=true
728+
adafruit_feather_m4_can.build.mcu=cortex-m4
729+
#adafruit_feather_m4_can.build.f_cpu=120000000L
730+
adafruit_feather_m4_can.build.usb_product="Adafruit Feather M4 CAN"
731+
adafruit_feather_m4_can.build.usb_manufacturer="Adafruit LLC"
732+
adafruit_feather_m4_can.build.board=FEATHER_M4_CAN
733+
adafruit_feather_m4_can.build.core=arduino
734+
adafruit_feather_m4_can.build.extra_flags=-D__SAME51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -DADAFRUIT_FEATHER_M4_CAN -D__SAMD51__ {build.usb_flags} -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16
735+
adafruit_feather_m4_can.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
736+
adafruit_feather_m4_can.build.openocdscript=openocd_scripts/arduino_zero.cfg
737+
adafruit_feather_m4_can.build.variant=feather_m4_can
738+
adafruit_feather_m4_can.build.variant_system_lib=
739+
adafruit_feather_m4_can.build.vid=0x239A
740+
adafruit_feather_m4_can.build.pid=0x80CD
741+
adafruit_feather_m4_can.bootloader.tool=openocd
742+
adafruit_feather_m4_can.bootloader.file=featherM4/bootloader-feather_m4_express-v2.0.0-adafruit.5.bin
743+
adafruit_feather_m4_can.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
744+
adafruit_feather_m4_can.menu.cache.on=Enabled
745+
adafruit_feather_m4_can.menu.cache.on.build.cache_flags=-DENABLE_CACHE
746+
adafruit_feather_m4_can.menu.cache.off=Disabled
747+
adafruit_feather_m4_can.menu.cache.off.build.cache_flags=
748+
adafruit_feather_m4_can.menu.speed.120=120 MHz (standard)
749+
adafruit_feather_m4_can.menu.speed.120.build.f_cpu=120000000L
750+
adafruit_feather_m4_can.menu.speed.150=150 MHz (overclock)
751+
adafruit_feather_m4_can.menu.speed.150.build.f_cpu=150000000L
752+
adafruit_feather_m4_can.menu.speed.180=180 MHz (overclock)
753+
adafruit_feather_m4_can.menu.speed.180.build.f_cpu=180000000L
754+
adafruit_feather_m4_can.menu.speed.200=200 MHz (overclock)
755+
adafruit_feather_m4_can.menu.speed.200.build.f_cpu=200000000L
756+
adafruit_feather_m4_can.menu.opt.small=Small (-Os) (standard)
757+
adafruit_feather_m4_can.menu.opt.small.build.flags.optimize=-Os
758+
adafruit_feather_m4_can.menu.opt.fast=Fast (-O2)
759+
adafruit_feather_m4_can.menu.opt.fast.build.flags.optimize=-O2
760+
adafruit_feather_m4_can.menu.opt.faster=Faster (-O3)
761+
adafruit_feather_m4_can.menu.opt.faster.build.flags.optimize=-O3
762+
adafruit_feather_m4_can.menu.opt.fastest=Fastest (-Ofast)
763+
adafruit_feather_m4_can.menu.opt.fastest.build.flags.optimize=-Ofast
764+
adafruit_feather_m4_can.menu.opt.dragons=Here be dragons (-Ofast -funroll-loops)
765+
adafruit_feather_m4_can.menu.opt.dragons.build.flags.optimize=-Ofast -funroll-loops
766+
adafruit_feather_m4_can.menu.maxqspi.50=50 MHz (standard)
767+
adafruit_feather_m4_can.menu.maxqspi.50.build.flags.maxqspi=-DVARIANT_QSPI_BAUD_DEFAULT=50000000
768+
adafruit_feather_m4_can.menu.maxqspi.fcpu=CPU Speed / 2
769+
adafruit_feather_m4_can.menu.maxqspi.fcpu.build.flags.maxqspi=-DVARIANT_QSPI_BAUD_DEFAULT=({build.f_cpu})
770+
adafruit_feather_m4_can.menu.usbstack.arduino=Arduino
771+
adafruit_feather_m4_can.menu.usbstack.tinyusb=TinyUSB
772+
adafruit_feather_m4_can.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB
773+
adafruit_feather_m4_can.menu.debug.off=Off
774+
adafruit_feather_m4_can.menu.debug.on=On
775+
adafruit_feather_m4_can.menu.debug.on.build.flags.debug=-g
776+
777+
714778
# Adafruit Trellis M4 (SAMD51)
715779
# ------------------------------
716780
adafruit_trellis_m4.name=Adafruit Trellis M4 (SAMD51)

cores/arduino/Arduino.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ extern "C"{
4747
// Include Atmel headers
4848
#include "sam.h"
4949

50+
#ifdef __SAME51J19A__
51+
#include "same51j19a.h"
52+
#endif
53+
5054
#include "wiring_constants.h"
5155

5256
#define clockCyclesPerMicrosecond() ( SystemCoreClock / 1000000L )

cores/arduino/SERCOM.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
#include "sam.h"
2323

24+
#ifdef __SAME51J19A__
25+
#include "same51j19a.h"
26+
#endif
27+
2428
// SAMD51 has configurable MAX_SPI, else use peripheral clock default.
2529
// Update: changing MAX_SPI via compiler flags is DEPRECATED, because
2630
// this affects ALL SPI peripherals including some that should NOT be

cores/arduino/WVariant.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
#pragma once
2121

22+
#ifdef __SAME51J19A__
23+
#include "same51j19a.h"
24+
#endif
25+
2226
#include <stdint.h>
2327
#include "sam.h"
2428
#include <limits.h>
@@ -90,7 +94,7 @@ typedef enum _ETCChannel
9094
TC3_CH0 = (6<<8)|(0),
9195
TC3_CH1 = (6<<8)|(1),
9296
} ETCChannel ;
93-
#elif defined(__SAMD51J19A__) || defined(__SAMD51J20A__)
97+
#elif defined(__SAMD51J19A__) || defined(__SAMD51J20A__) || defined(__SAME51J19A__)
9498

9599
typedef enum _ETCChannel
96100
{

cores/arduino/cortex_handlers.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ void SERCOM7_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Han
127127
void SERCOM7_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
128128
void SERCOM7_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
129129
void SERCOM7_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
130+
void CAN0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
131+
void CAN1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
130132
void USB_0_Handler ( void ) __attribute__ ((weak));
131133
void USB_1_Handler ( void ) __attribute__ ((weak));
132134
void USB_2_Handler ( void ) __attribute__ ((weak));
@@ -294,8 +296,8 @@ __attribute__ ((section(".isr_vector"))) const DeviceVectors exception_table =
294296
(void*) SERCOM7_1_Handler, /* 75 Serial Communication Interface 7 IRQ 1 */
295297
(void*) SERCOM7_2_Handler, /* 76 Serial Communication Interface 7 IRQ 2 */
296298
(void*) SERCOM7_3_Handler, /* 77 Serial Communication Interface 7 IRQ 3 */
297-
(void*) (0UL),
298-
(void*) (0UL),
299+
(void*) CAN0_Handler, /* 78 Control Area Network 0 (SAM E5x) */
300+
(void*) CAN1_Handler, /* 79 Control Area Network 0 (SAM E5x) */
299301
(void*) USB_0_Handler, /* 80 Universal Serial Bus IRQ 0 */
300302
(void*) USB_1_Handler, /* 81 Universal Serial Bus IRQ 1 */
301303
(void*) USB_2_Handler, /* 82 Universal Serial Bus IRQ 2 */

cores/arduino/wiring_private.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ extern "C" {
2929
// Includes Atmel CMSIS
3030
#include "sam.h"
3131

32+
#ifdef __SAME51J19A__
33+
#include "same51j19a.h"
34+
#endif
35+
3236
#include "wiring_constants.h"
3337

3438
int pinPeripheral( uint32_t ulPin, EPioType ulPeripheral );
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
* \file
3+
*
4+
* \brief Component version header file
5+
*
6+
* Copyright (c) 2019 Atmel Corporation, a wholly owned subsidiary of Microchip Technology Inc.
7+
*
8+
* \license_start
9+
*
10+
* \page License
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*
24+
* \license_stop
25+
*
26+
*/
27+
28+
#ifndef _COMPONENT_VERSION_H_INCLUDED
29+
#define _COMPONENT_VERSION_H_INCLUDED
30+
31+
#define COMPONENT_VERSION_MAJOR 1
32+
#define COMPONENT_VERSION_MINOR 1
33+
34+
//
35+
// The COMPONENT_VERSION define is composed of the major and the minor version number.
36+
//
37+
// The last four digits of the COMPONENT_VERSION is the minor version with leading zeros.
38+
// The rest of the COMPONENT_VERSION is the major version.
39+
//
40+
#define COMPONENT_VERSION 10001
41+
42+
//
43+
// The build number does not refer to the component, but to the build number
44+
// of the device pack that provides the component.
45+
//
46+
#define BUILD_NUMBER 139
47+
48+
//
49+
// The COMPONENT_VERSION_STRING is a string (enclosed in ") that can be used for logging or embedding.
50+
//
51+
#define COMPONENT_VERSION_STRING "1.1"
52+
53+
//
54+
// The COMPONENT_DATE_STRING contains a timestamp of when the pack was generated.
55+
//
56+
// The COMPONENT_DATE_STRING is written out using the following strftime pattern.
57+
//
58+
// "%Y-%m-%d %H:%M:%S"
59+
//
60+
//
61+
#define COMPONENT_DATE_STRING "2019-11-05 13:35:15"
62+
63+
#endif/* #ifndef _COMPONENT_VERSION_H_INCLUDED */
64+

0 commit comments

Comments
 (0)