Skip to content

Commit 4d8adc9

Browse files
committed
Merge branch 'master' of https://github.com/arduino/ArduinoCore-samd into arduino-master
2 parents 1b2de9f + 07c2e57 commit 4d8adc9

Some content is hidden

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

41 files changed

+4232
-40
lines changed

CHANGELOG

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
SAMD CORE ?.?.?? ????.??.??
22

3+
SAMD CORE 1.6.20 2018.11.28
4+
5+
* Replaced boolean type with bool in examples. Thanks @per1234
6+
* Added c++ linker command to allow to include libstdc++ when linking. Thanks @helmut64
7+
* CPX driver fixes. Thanks @dhalbert
8+
* I2S: Changed library to use 8 MHz oscillator source if 48MHz divider does not fit in 8 bits
9+
* UART: Added frame error handling
10+
* USB: Fixed memory leak on reconnects
11+
* SDU: Added support for Arduino M0. Thanks @jandrassy
12+
* Added arduinoOTA upload keys for Arduino M0. Thanks @jandrassy
13+
* USB: Fixed USB Host failures and fixed memory overwrite in USBHost. Thanks @gdsports
14+
* USB: Added method to return USB error code. Thanks @MarkFischer
15+
* CDC: Clear line state on end()
16+
* USB: Added USB device end() method
17+
* Removed requirement that the DAC is on A0. Thanks @GabrielNotman
18+
* Added alternate ports 44, 45 to make the SWCLK and SWDIO pins available on the Zero. Thanks @helmut64
19+
* Added defines for MKR pin layout
20+
* Fixed freeze in tone()
21+
* Added MKR NB 1500 variant and bootloader
22+
* Increased the default serial buffer size to 256
23+
24+
SAMD CORE 1.6.19 2018.07.11
25+
26+
* Fixed bootloader tools for .org boards
27+
* M0: Updated pin definitions for D6, D7 and D13 to match Zero
28+
* SPI: Fixed interrupt mask to block. Thanks @ggajoch
29+
* Added MKR WiFi 1010 variant and bootloader
30+
* Updated Windows Drivers to 1.4.0 and re-signed Adafruit_Circuit_Playground_Express.inf
31+
332
SAMD CORE 1.6.18 2018.03.05
433

534
* Wire: Added support for general call (broadcast)
Binary file not shown.

bootloaders/mkrnb1500/samd21_sam_ba_arduino_mkrnb1500.hex

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

bootloaders/zero/board_definitions.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,35 @@
2020
#ifndef _BOARD_DEFINITIONS_H_
2121
#define _BOARD_DEFINITIONS_H_
2222

23+
#if defined(BOARD_ID_arduino_zero)
24+
#include "board_definitions_arduino_zero.h"
25+
#elif defined(BOARD_ID_genuino_zero)
26+
#include "board_definitions_genuino_zero.h"
27+
#elif defined(BOARD_ID_arduino_mkr1000)
28+
#include "board_definitions_arduino_mkr1000.h"
29+
#elif defined(BOARD_ID_genuino_mkr1000)
30+
#include "board_definitions_genuino_mkr1000.h"
31+
#elif defined(BOARD_ID_arduino_mkrzero)
32+
#include "board_definitions_arduino_mkrzero.h"
33+
#elif defined(BOARD_ID_arduino_mkrfox1200)
34+
#include "board_definitions_arduino_mkrfox1200.h"
35+
#elif defined(BOARD_ID_arduino_mkrgsm1400)
36+
#include "board_definitions_arduino_mkrgsm1400.h"
37+
#elif defined(BOARD_ID_arduino_mkrwan1300)
38+
#include "board_definitions_arduino_mkrwan1300.h"
39+
#elif defined(BOARD_ID_arduino_mkrwifi1010)
40+
#include "board_definitions_arduino_mkrwifi1010.h"
41+
#elif defined(BOARD_ID_arduino_mkrnb1500)
42+
#include "board_definitions_arduino_mkrnb1500.h"
43+
#else
44+
#error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h
45+
#endif
46+
47+
// Common definitions
48+
// ------------------
49+
50+
#define BOOT_PIN_MASK (1U << (BOOT_LOAD_PIN & 0x1f))
51+
2352
/*
2453
* If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by
2554
* quickly tapping two times on the reset button.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 MKR NB 1500"
26+
#define USB_VID_HIGH 0x23
27+
#define USB_VID_LOW 0x41
28+
#define USB_PID_HIGH 0x00
29+
#define USB_PID_LOW 0x55
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+
#define CONFIGURE_PMIC 1
75+
#define PMIC_PIN_SCL 12
76+
#define PMIC_PIN_SDA 11
77+
#define PMIC_SERCOM SERCOM0
78+
79+
// No RX/TX led
80+
//#define BOARD_LEDRX_PORT
81+
//#define BOARD_LEDRX_PIN
82+
83+
//#define BOARD_LEDTX_PORT
84+
//#define BOARD_LEDTX_PIN
85+
86+
#endif // _BOARD_DEFINITIONS_H_

bootloaders/zero/build_all_bootloaders.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ mv -v samd21_sam_ba_arduino_mkrwan1300.* ../mkrwan1300/
2525
BOARD_ID=arduino_mkrwifi1010 NAME=samd21_sam_ba_arduino_mkrwifi1010 make clean all
2626
mv -v samd21_sam_ba_arduino_mkrwifi1010.* ../mkrwifi1010/
2727

28+
BOARD_ID=arduino_mkrnb1500 NAME=samd21_sam_ba_arduino_mkrnb1500 make clean all
29+
mv -v samd21_sam_ba_arduino_mkrnb1500.* ../mkrnb1500/
30+
2831
echo Done building bootloaders!
2932

cores/arduino/RingBuffer.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
// using a ring buffer (I think), in which head is the index of the location
2828
// to which to write the next incoming character and tail is the index of the
2929
// location from which to read.
30-
#define SERIAL_BUFFER_SIZE 164
30+
31+
#ifndef SERIAL_BUFFER_SIZE
32+
#define SERIAL_BUFFER_SIZE 256
33+
#endif
3134

3235
template <int N>
3336
class RingBufferN

cores/arduino/Tone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void tone (uint32_t outputPin, uint32_t frequency, uint32_t duration)
136136
default: break;
137137
}
138138

139-
toggleCount = (duration > 0 ? frequency * duration * 2 / 1000UL : -1);
139+
toggleCount = (duration > 0 ? frequency * duration * 2 / 1000UL : -1LL);
140140

141141
resetTC(TONE_TC);
142142

cores/arduino/USB/CDC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ void Serial_::begin(uint32_t /* baud_count */, uint8_t /* config */)
150150

151151
void Serial_::end(void)
152152
{
153+
memset((void*)&_usbLineInfo, 0, sizeof(_usbLineInfo));
153154
}
154155

155156
int Serial_::available(void)

cores/arduino/USB/SAMD21_USBDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class DoubleBufferedEPOutHandler : public EPHandler {
237237
release();
238238
}
239239

240-
~DoubleBufferedEPOutHandler() {
240+
virtual ~DoubleBufferedEPOutHandler() {
241241
free((void*)data0);
242242
free((void*)data1);
243243
}

0 commit comments

Comments
 (0)