Skip to content

Commit 10a9c83

Browse files
committed
Merge remote-tracking branch 'upstream/master'
Conflicts: boards.txt platform.txt
2 parents 8012aac + 4466838 commit 10a9c83

39 files changed

+6408
-15
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
SAMD CORE 1.6.13 2017.03.31
2+
3+
* Added SDU (SD card Updater) library.
4+
* Fixed 8MHz clock being generated incorrectly. Thanks @keestux
5+
16
SAMD CORE 1.6.12 2017.02.07
27

38
* Fixed type conflict of utoa function. Thanks @kbumsik

boards.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ adafruit_feather_m0_express.bootloader.file=feather/samd21_sam_ba.bin
123123
#adafruit_metro_m0.bootloader.tool=openocd
124124
#adafruit_metro_m0.bootloader.file=metro/samd21_sam_ba.bin
125125

126-
#
127126
# Adafruit Circuit Playground M0
128127
# ------------------------------
129128
#adafruit_circuitplayground_m0.name=Adafruit Circuit Playground Express
Binary file not shown.

bootloaders/mkrfox1200/samd21_sam_ba_arduino_mkrfox1200.hex

Lines changed: 403 additions & 0 deletions
Large diffs are not rendered by default.

bootloaders/zero/board_definitions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "board_definitions_genuino_mkr1000.h"
2828
#elif defined(BOARD_ID_arduino_mkrzero)
2929
#include "board_definitions_arduino_mkrzero.h"
30+
#elif defined(BOARD_ID_arduino_mkrfox1200)
31+
#include "board_definitions_arduino_mkrfox1200.h"
3032
#else
3133
#error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h
3234
#endif
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
Copyright (c) 2016 Arduino LLC. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef _BOARD_DEFINITIONS_H_
20+
#define _BOARD_DEFINITIONS_H_
21+
22+
/*
23+
* USB device definitions
24+
*/
25+
#define STRING_PRODUCT "Arduino MKRFox1200"
26+
#define USB_VID_HIGH 0x23
27+
#define USB_VID_LOW 0x41
28+
#define USB_PID_HIGH 0x00
29+
#define USB_PID_LOW 0x50
30+
31+
/*
32+
* If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by
33+
* quickly tapping two times on the reset button.
34+
* BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not
35+
* be touched from the loaded application.
36+
*/
37+
#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul)
38+
#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS))
39+
40+
/*
41+
* If BOOT_LOAD_PIN is defined the bootloader is started if the selected
42+
* pin is tied LOW.
43+
*/
44+
//#define BOOT_LOAD_PIN PIN_PA21
45+
//#define BOOT_LOAD_PIN PIN_PA15
46+
47+
#define BOOT_USART_MODULE SERCOM5
48+
#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM5
49+
#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM5_CORE_Val
50+
#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2
51+
#define BOOT_USART_PAD3 PINMUX_PB23D_SERCOM5_PAD3
52+
#define BOOT_USART_PAD2 PINMUX_PB22D_SERCOM5_PAD2
53+
#define BOOT_USART_PAD1 PINMUX_UNUSED
54+
#define BOOT_USART_PAD0 PINMUX_UNUSED
55+
56+
/* Master clock frequency */
57+
#define CPU_FREQUENCY (48000000ul)
58+
#define VARIANT_MCK CPU_FREQUENCY
59+
60+
/* Frequency of the board main oscillator */
61+
#define VARIANT_MAINOSC (32768ul)
62+
63+
/* Calibration values for DFLL48 pll */
64+
#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58)
65+
#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64)
66+
67+
/*
68+
* LEDs definitions
69+
*/
70+
// PA20 (digital pin 6)
71+
#define BOARD_LED_PORT (0)
72+
#define BOARD_LED_PIN (20)
73+
74+
// No RX/TX led
75+
//#define BOARD_LEDRX_PORT
76+
//#define BOARD_LEDRX_PIN
77+
78+
//#define BOARD_LEDTX_PORT
79+
//#define BOARD_LEDTX_PIN
80+
81+
#endif // _BOARD_DEFINITIONS_H_

bootloaders/zero/build_all_bootloaders.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ mv -v samd21_sam_ba_genuino_mkr1000.* ../mkr1000/
1313
BOARD_ID=arduino_mkrzero NAME=samd21_sam_ba_arduino_mkrzero make clean all
1414
mv -v samd21_sam_ba_arduino_mkrzero.* ../mkrzero/
1515

16+
BOARD_ID=arduino_mkrfox1200 NAME=samd21_sam_ba_arduino_mkrfox1200 make clean all
17+
mv -v samd21_sam_ba_arduino_mkrfox1200.* ../mkrfox1200/
18+
1619
echo Done building bootloaders!
1720

cores/arduino/SERCOM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,13 @@ void SERCOM::enableSPI()
240240

241241
void SERCOM::disableSPI()
242242
{
243-
//Setting the enable bit to 0
244-
sercom->SPI.CTRLA.bit.ENABLE = 0;
245-
246243
while(sercom->SPI.SYNCBUSY.bit.ENABLE)
247244
{
248245
//Waiting then enable bit from SYNCBUSY is equal to 0;
249246
}
247+
248+
//Setting the enable bit to 0
249+
sercom->SPI.CTRLA.bit.ENABLE = 0;
250250
}
251251

252252
void SERCOM::setDataOrderSPI(SercomDataOrder dataOrder)

cores/arduino/USB/SAMD21_USBDevice.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class USBDevice_SAMD21G18x {
4848

4949
inline void runInStandby() { usb.CTRLA.bit.RUNSTDBY = 1; }
5050
inline void noRunInStandby() { usb.CTRLA.bit.RUNSTDBY = 0; }
51+
inline void wakeupHost() { usb.CTRLB.bit.UPRSM = 1; }
5152

5253
// USB speed
5354
inline void setFullSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; }

cores/arduino/USB/USBAPI.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class USBDeviceClass {
6565
bool configured();
6666
bool connected();
6767

68+
void standby();
69+
6870
// Setup API
6971
bool handleClassInterfaceSetup(USBSetup &setup);
7072
bool handleStandardSetup(USBSetup &setup);

0 commit comments

Comments
 (0)