boards: add board and DTS definitions for the Arduino Zero.

Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
Michael Hope 2017-11-22 09:01:18 +01:00 committed by Anas Nashif
parent b69c452e6f
commit 4c47c21753
9 changed files with 171 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# Kconfig - Arduino Zero Board configuration
#
# Copyright (c) 2017 Google LLC.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ARDUINO_ZERO
bool "Arduino Zero"
depends on SOC_PART_NUMBER_SAMD21G18A

View file

@ -0,0 +1,11 @@
# Kconfig - Arduino Zero board configuration
#
# Copyright (c) 2017 Google LLC.
# SPDX-License-Identifier: Apache-2.0
if BOARD_ARDUINO_ZERO
config BOARD
default arduino_zero
endif # BOARD_ARDUINO_ZERO

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2017 Google LLC.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <atmel/samd21.dtsi>
/ {
model = "Arduino Zero";
compatible = "arduino,zero", "atmel,samd21g18a", "atmel,samd21";
chosen {
zephyr,console = &sercom5;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
};
&sercom5 {
status = "ok";
current-speed = <115200>;
};
&sercom0 {
status = "ok";
current-speed = <115200>;
};

View file

@ -0,0 +1,9 @@
identifier: arduino_zero
name: Arduino Zero
type: mcu
arch: arm
ram: 32
flash: 256
toolchain:
- zephyr
- gccarmemb

View file

@ -0,0 +1,17 @@
CONFIG_ARM=y
CONFIG_SOC_FAMILY_SAM0=y
CONFIG_SOC_SERIES_SAMD=y
CONFIG_SOC_PART_NUMBER_SAMD21G18A=y
CONFIG_BOARD_ARDUINO_ZERO=y
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_SAM0=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_GPIO=y
CONFIG_GPIO_SAM0=y
CONFIG_WATCHDOG=y
CONFIG_WDT_SAM0=y
CONFIG_SOC_ATMEL_SAMD_XOSC32K=y
CONFIG_SOC_ATMEL_SAMD_XOSC32K_AS_MAIN=y

View file

@ -0,0 +1,4 @@
# Copyright (c) 2017 Google LLC.
# SPDX-License-Identifier: Apache-2.0
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2017 Google LLC.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __INC_BOARD_H
#define __INC_BOARD_H
#include <soc.h>
/* LED on PA17 */
#define LED0_GPIO_PORT CONFIG_GPIO_SAM0_PORTA_LABEL
#define LED0_GPIO_PIN 17
/* TX on PA27 */
#define LED1_GPIO_PORT CONFIG_GPIO_SAM0_PORTA_LABEL
#define LED1_GPIO_PIN 27
/* RX on PB3 */
#define LED2_GPIO_PORT CONFIG_GPIO_SAM0_PORTB_LABEL
#define LED2_GPIO_PIN 3
#endif /* __INC_BOARD_H */

View file

@ -0,0 +1,48 @@
#define CONFIG_GPIO_SAM0_PORTA_LABEL ATMEL_SAM0_GPIO_41004400_LABEL
#define CONFIG_GPIO_SAM0_PORTA_BASE_ADDRESS ATMEL_SAM0_GPIO_41004400_BASE_ADDRESS
#define CONFIG_GPIO_SAM0_PORTB_LABEL ATMEL_SAM0_GPIO_41004480_LABEL
#define CONFIG_GPIO_SAM0_PORTB_BASE_ADDRESS ATMEL_SAM0_GPIO_41004480_BASE_ADDRESS
#define CONFIG_UART_SAM0_SERCOM0_CURRENT_SPEED ATMEL_SAM0_UART_42000800_CURRENT_SPEED
#define CONFIG_UART_SAM0_SERCOM0_IRQ ATMEL_SAM0_UART_42000800_IRQ_0
#define CONFIG_UART_SAM0_SERCOM0_IRQ_PRIORITY ATMEL_SAM0_UART_42000800_IRQ_0_PRIORITY
#define CONFIG_UART_SAM0_SERCOM0_LABEL ATMEL_SAM0_UART_42000800_LABEL
#define CONFIG_UART_SAM0_SERCOM0_BASE_ADDRESS ATMEL_SAM0_UART_42000800_BASE_ADDRESS
#define CONFIG_UART_SAM0_SERCOM1_CURRENT_SPEED ATMEL_SAM0_UART_42000C00_CURRENT_SPEED
#define CONFIG_UART_SAM0_SERCOM1_IRQ ATMEL_SAM0_UART_42000C00_IRQ_0
#define CONFIG_UART_SAM0_SERCOM1_IRQ_PRIORITY ATMEL_SAM0_UART_42000C00_IRQ_0_PRIORITY
#define CONFIG_UART_SAM0_SERCOM1_LABEL ATMEL_SAM0_UART_42000C00_LABEL
#define CONFIG_UART_SAM0_SERCOM1_BASE_ADDRESS ATMEL_SAM0_UART_42000C00_BASE_ADDRESS
#define CONFIG_UART_SAM0_SERCOM2_CURRENT_SPEED ATMEL_SAM0_UART_42001000_CURRENT_SPEED
#define CONFIG_UART_SAM0_SERCOM2_IRQ ATMEL_SAM0_UART_42001000_IRQ_0
#define CONFIG_UART_SAM0_SERCOM2_IRQ_PRIORITY ATMEL_SAM0_UART_42001000_IRQ_0_PRIORITY
#define CONFIG_UART_SAM0_SERCOM2_LABEL ATMEL_SAM0_UART_42001000_LABEL
#define CONFIG_UART_SAM0_SERCOM2_BASE_ADDRESS ATMEL_SAM0_UART_42001000_BASE_ADDRESS
#define CONFIG_UART_SAM0_SERCOM3_CURRENT_SPEED ATMEL_SAM0_UART_42001400_CURRENT_SPEED
#define CONFIG_UART_SAM0_SERCOM3_IRQ ATMEL_SAM0_UART_42001400_IRQ_0
#define CONFIG_UART_SAM0_SERCOM3_IRQ_PRIORITY ATMEL_SAM0_UART_42001400_IRQ_0_PRIORITY
#define CONFIG_UART_SAM0_SERCOM3_LABEL ATMEL_SAM0_UART_42001400_LABEL
#define CONFIG_UART_SAM0_SERCOM3_BASE_ADDRESS ATMEL_SAM0_UART_42001400_BASE_ADDRESS
#define CONFIG_UART_SAM0_SERCOM4_CURRENT_SPEED ATMEL_SAM0_UART_42001800_CURRENT_SPEED
#define CONFIG_UART_SAM0_SERCOM4_IRQ ATMEL_SAM0_UART_42001800_IRQ_0
#define CONFIG_UART_SAM0_SERCOM4_IRQ_PRIORITY ATMEL_SAM0_UART_42001800_IRQ_0_PRIORITY
#define CONFIG_UART_SAM0_SERCOM4_LABEL ATMEL_SAM0_UART_42001800_LABEL
#define CONFIG_UART_SAM0_SERCOM4_BASE_ADDRESS ATMEL_SAM0_UART_42001800_BASE_ADDRESS
#define CONFIG_UART_SAM0_SERCOM5_CURRENT_SPEED ATMEL_SAM0_UART_42001C00_CURRENT_SPEED
#define CONFIG_UART_SAM0_SERCOM5_IRQ ATMEL_SAM0_UART_42001C00_IRQ_0
#define CONFIG_UART_SAM0_SERCOM5_IRQ_PRIORITY ATMEL_SAM0_UART_42001C00_IRQ_0_PRIORITY
#define CONFIG_UART_SAM0_SERCOM5_LABEL ATMEL_SAM0_UART_42001C00_LABEL
#define CONFIG_UART_SAM0_SERCOM5_BASE_ADDRESS ATMEL_SAM0_UART_42001C00_BASE_ADDRESS
#define CONFIG_WDT_SAM0_IRQ ATMEL_SAM0_WATCHDOG_40001000_IRQ_0
#define CONFIG_WDT_SAM0_IRQ_PRIORITY ATMEL_SAM0_WATCHDOG_40001000_IRQ_0_PRIORITY
#define CONFIG_WDT_SAM0_LABEL ATMEL_SAM0_WATCHDOG_40001000_LABEL
#define CONFIG_WDT_SAM0_BASE_ADDRESS ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS
#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS

View file

@ -0,0 +1,22 @@
source [find interface/cmsis-dap.cfg]
transport select swd
# chip name
set CHIPNAME at91samd21e18
set ENDIAN little
set CPUTAPID 0x0bc11477
source [find target/at91samdXX.cfg]
reset_config trst_and_srst separate
$_TARGETNAME configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
$_TARGETNAME configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}