Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards: adafruit: add initial support for feather m4 express #81081

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
Terezvent marked this conversation as resolved.
Show resolved Hide resolved
# SPDX-License-Identifier: Apache-2.0

config BOARD_ADAFRUIT_FEATHER_M4_EXPRESS
select SOC_SAMD51J19A
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2022, Gerson Fernando Budke <[email protected]>
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

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

&pinctrl {
sercom1_spi_default: sercom1_spi_default {
group1 {
pinmux = <PB23C_SERCOM1_PAD3>,
<PA17C_SERCOM1_PAD1>,
<PB22C_SERCOM1_PAD2>;
};
};

sercom2_i2c_default: sercom3_i2c_default {
group1 {
pinmux = <PA12C_SERCOM2_PAD0>,
<PA13C_SERCOM2_PAD1>;
};
};

sercom5_uart_default: sercom5_uart_default {
group1 {
pinmux = <PB17C_SERCOM5_PAD1>,
<PB16C_SERCOM5_PAD0>;
};
};

pwm0_default: pwm0_default {
group1 {
pinmux = <PA22G_TCC0_WO2>;
};
};
pwm1_default: pwm1_default {
group1 {
pinmux = <PA18F_TCC1_WO2>,
<PA19F_TCC1_WO3>;
};
};

usb_dc_default: usb_dc_default {
group1 {
pinmux = <PA25H_USB_DP>,
<PA24H_USB_DM>;
};
};
};
111 changes: 111 additions & 0 deletions boards/adafruit/feather_m4_express/adafruit_feather_m4_express.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* Copyright (c) 2020 Google LLC.
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <atmel/samd5xx19.dtsi>
#include "adafruit_feather_m4_express-pinctrl.dtsi"

/ {
model = "Adafruit Feather M4 Express";
compatible = "adafruit,feather-m4-express";

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

/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
pwm-0 = &tcc0;
};

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

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

&sercom5 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;
pinctrl-0 = <&sercom5_uart_default>;
pinctrl-names = "default";
};

&sercom1 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <3>;
dopo = <0>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom1_spi_default>;
pinctrl-names = "default";
};

&tcc0 {
status = "okay";
compatible = "atmel,sam0-tcc-pwm";
prescaler = <8>;
#pwm-cells = <2>;
pinctrl-0 = <&pwm0_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(512-16-16)>;
read-only;
};

/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@7c000 {
label = "storage";
reg = <0x7c000 DT_SIZE_K(16)>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
identifier: adafruit_feather_m4_express
name: Adafruit Feather M4 Express
type: mcu
arch: arm
ram: 192
flash: 512
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- dma
- gpio
- hwinfo
- pwm
- spi
- uart
- usb_device
- watchdog
vendor: adafruit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_ATMEL_SAMD5X_OSCULP32K_AS_MAIN=y

CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_ADAFRUIT_UF2=y
CONFIG_BUILD_OUTPUT_HEX=y
CONFIG_BUILD_OUTPUT_UF2=y

CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y

CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
5 changes: 5 additions & 0 deletions boards/adafruit/feather_m4_express/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2020 Google LLC.
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
6 changes: 6 additions & 0 deletions boards/adafruit/feather_m4_express/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: adafruit_feather_m4_express
Terezvent marked this conversation as resolved.
Show resolved Hide resolved
full_name: Feather M4 Express
vendor: adafruit
socs:
- name: samd51j19a
Binary file not shown.
Loading
Loading