Skip to content

Commit

Permalink
boards: arm: add the Adafruit Grand Central M4 Express
Browse files Browse the repository at this point in the history
The Adafruit Grand Central M4 Express is an ARM development board
with the form factor of an Arduino Mega.
It features 70 GPIO pins, a microSDHC slot and 8MiB of QSPI Flash.

Signed-off-by: Lukas Jung <lukas.jung@mailbox.org>
  • Loading branch information
lukas-jung authored and henrikbrixandersen committed Dec 4, 2023
1 parent 0a962b8 commit 535ca1c
Show file tree
Hide file tree
Showing 10 changed files with 448 additions and 0 deletions.
8 changes: 8 additions & 0 deletions boards/arm/adafruit_grand_central_m4_express/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Adafruit Grand Central M4 Express board configuration

# Copyright (c) 2023 Lukas Jung <lukas.jung@mailbox.org>
# SPDX-License-Identifier: Apache-2.0

config BOARD_ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS
bool "Adafruit Grand Central M4 Express"
depends on SOC_PART_NUMBER_SAMD51P20A
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Adafruit Grand Central M4 Express board configuration

# Copyright (c) 2023 Lukas Jung <lukas.jung@mailbox.org>
# SPDX-License-Identifier: Apache-2.0

config BOARD
default "adafruit_grand_central_m4_express"
depends on BOARD_ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2023 Lukas Jung <lukas.jung@mailbox.org>
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/samd51p-pinctrl.h>

&pinctrl {
sercom0_uart_default: sercom0_uart_default {
group1 {
pinmux = <PB24C_SERCOM0_PAD0>,
<PB25C_SERCOM0_PAD1>;
};
};

sercom2_spi_default: sercom2_spi_default {
group1 {
pinmux = <PB26C_SERCOM2_PAD0>,
<PB27C_SERCOM2_PAD1>,
<PB29C_SERCOM2_PAD3>;
};
};

sercom3_i2c_default: sercom3_i2c_default {
group1 {
pinmux = <PB20C_SERCOM3_PAD0>,
<PB21C_SERCOM3_PAD1>;
};
};

sercom7_spi_default: sercom7_spi_default {
group1 {
pinmux = <PD8C_SERCOM7_PAD0>,
<PD9C_SERCOM7_PAD1>,
<PD11C_SERCOM7_PAD3>;
};
};

usb_dc_default: usb_dc_default {
group1 {
pinmux = <PA25H_USB_DP>,
<PA24H_USB_DM>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Copyright (c) 2023 Lukas Jung <lukas.jung@mailbox.org>
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <atmel/samd5xx20.dtsi>
#include "adafruit_grand_central_m4_express-pinctrl.dtsi"

/ {
model = "Adafruit Grand Central M4 Express";
compatible = "adafruit,grand-central-m4-express";

chosen {
zephyr,console = &sercom0;
zephyr,shell-uart = &sercom0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};

/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
sdhc0 = &sdhc0;
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&portb 1 0>;
label = "LED";
};
};
};

&cpu0 {
clock-frequency = <120000000>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;

pinctrl-0 = <&sercom0_uart_default>;
pinctrl-names = "default";
};

&sercom2 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <3>;
dopo = <0>;

#address-cells = <1>;
#size-cells = <0>;

pinctrl-0 = <&sercom2_spi_default>;
pinctrl-names = "default";

cs-gpios = <&portb 28 GPIO_ACTIVE_LOW>;

/* microSD Card */
sdhc0: sdhc@0 {
status = "okay";
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
spi-max-frequency = <20000000>;
mmc {
status = "okay";
compatible = "zephyr,sdmmc-disk";
};
};
};

&sercom3 {
status = "okay";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;

#address-cells = <1>;
#size-cells = <0>;

pinctrl-0 = <&sercom3_i2c_default>;
pinctrl-names = "default";
};

&sercom7 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <3>;
dopo = <0>;

#address-cells = <1>;
#size-cells = <0>;

pinctrl-0 = <&sercom7_spi_default>;
pinctrl-names = "default";
};

zephyr_udc0: &usb0 {
status = "okay";

pinctrl-0 = <&usb_dc_default>;
pinctrl-names = "default";
};

&dmac {
status = "okay";
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "uf2";
reg = <0x00000000 DT_SIZE_K(16)>;
read-only;
};

code_partition: partition@4000 {
label = "code";
reg = <0x4000 DT_SIZE_K(1024-16)>;
read-only;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
identifier: adafruit_grand_central_m4_express
name: Adafruit Grand Central M4 Express
type: mcu
arch: arm
ram: 256
flash: 1024
toolchain:
- zephyr
- gnuarmemb
supported:
- dma
- gpio
- i2c
- spi
- uart
- usb_device
- watchdog
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_SERIES_SAMD51=y
CONFIG_SOC_PART_NUMBER_SAMD51P20A=y
CONFIG_BOARD_ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS=y
CONFIG_SOC_ATMEL_SAMD5X_XOSC32K=y
CONFIG_SOC_ATMEL_SAMD5X_XOSC32K_AS_MAIN=y
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_SERIAL=y
CONFIG_GPIO=y

CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_ADAFRUIT_UF2=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_BUILD_OUTPUT_HEX=y
5 changes: 5 additions & 0 deletions boards/arm/adafruit_grand_central_m4_express/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023 Lukas Jung <lukas.jung@mailbox.org>
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Binary file not shown.
Loading

0 comments on commit 535ca1c

Please sign in to comment.