Skip to content

Commit

Permalink
ports/samd/boards: Add support for Adafruit Grand Central M4.
Browse files Browse the repository at this point in the history
Include QSPI pin definitions suggested by @robert-hh, and link photograph
of board referenced from micropython-media. Also includes definitions to
allow SD card use, so bake in sdcard driver, and point at 8MB QSPI flash
for file system. ATSAMD51P20A has room for ~1MB compiled code so use.

Includes updated pins.csv from @robert-hh

Co-authored-by: robert-hh <[email protected]>
Signed-off-by: Graeme Winter <[email protected]>
  • Loading branch information
graeme-winter and robert-hh committed Sep 21, 2024
1 parent 557319b commit afba2e5
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ports/samd/boards/ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS/board.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"deploy": [
"../deploy.md"
],
"docs": "",
"features": [
"External Flash",
"RGB LED",
"USB"
],
"mcu": "samd51",
"product": "Grand Central M4 Express",
"images": [
"grand_central_m4_express.jpg"
],
"thumbnail": "",
"url": "https://www.adafruit.com/product/4064",
"vendor": "Adafruit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include("$(PORT_DIR)/boards/manifest.py")
include("$(MPY_DIR)/extmod/asyncio")
require("onewire")
require("ds18x20")
require("neopixel")
require("sdcard")
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define MICROPY_HW_BOARD_NAME "Grand Central M4 Express"
#define MICROPY_HW_MCU_NAME "ATSAMD51P20A"

#define MICROPY_HW_XOSC32K (1)

// 8MB QSPI chip
#define MICROPY_HW_QSPIFLASH GD25Q64C

// fatfs configuration used in ffconf.h
#define MICROPY_FATFS_ENABLE_LFN (1)
#define MICROPY_FATFS_RPATH (2)
#define MICROPY_FATFS_MAX_SS (4096)
#define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
MCU_SERIES = SAMD51
CMSIS_MCU = ATSAMD51P20A
LD_FILES = boards/samd51x20a.ld sections.ld
TEXT0 = 0x4000

# The ?='s allow overriding in mpconfigboard.mk.
# MicroPython settings
MICROPY_VFS_LFS1 ?= 1

FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py

# Greater room for code in flash
MICROPY_HW_CODESIZE ?= 1008K
98 changes: 98 additions & 0 deletions ports/samd/boards/ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS/pins.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# The lines contain pairs of Pin name and Pin number.
# Pin names must be valid Python identifiers.
# Pin numbers have the form Pxnn, with x being A, B, C or D.
# Lines starting with # or empty lines are ignored.

A0,PA02
A1,PA05
A2,PB03
A10,PB07
A11,PB08
A12,PB09
A13,PA04
A14,PA06
A15,PA07
A3,PC00
A4,PC01
A5,PC02
A6,PC03
A7,PB04
A8,PB05
A9,PB06
AREF,PA03
CS,PD10
D0,PB25
D1,PB24
D10,PB22
D11,PB23
D12,PB00
D13,PB01
D2,PC18
D22,PD12
D23,PA15
D3,PC19
D4,PC20
D44,PC11
D45,PC10
D46,PC06
D47,PC07
D48,PC04
D49,PC05
D5,PC21
D6,PD20
D7,PD21
D8,PB18
D9,PB02
MISO,PD11
MOSI,PD08
NEOPIXEL,PC24
PCC_CLK,PA14
PCC_D0,PA16
PCC_D1,PA17
PCC_D10,PC12
PCC_D11,PC13
PCC_D12,PC14
PCC_D13,PC15
PCC_D2,PA18
PCC_D3,PA19
PCC_D4,PA20
PCC_D5,PA21
PCC_D6,PA22
PCC_D7,PA23
PCC_D8,PB14
PCC_D9,PB15
PCC_DEN1,PA12
PCC_DEN2,PA13
PCC_XCLK,PB19
RX1,PB13
RX2,PC23
RX3,PB17
RXLED,PC31
SCK,PD09
SCL,PB21
SCL_1,PC17
SD_CD,PB31
SD_CS,PB28
SD_MISO,PB29
SD_MOSI,PB26
SD_SCK,PB27
SDA,PB20
SDA_1,PC16
SWO,PB30
TX1,PB12
TX2,PC22
TX3,PB16
TXLED,PC30

QSPI_CS,PB11
QSPI_SCK,PB10
QSPI_D0,PA08
QSPI_D1,PA09
QSPI_D2,PA10
QSPI_D3,PA11

USB_DM,PA24
USB_DP,PA25

SWCLK,PA30
SWDIO,PA31

0 comments on commit afba2e5

Please sign in to comment.