Skip to content

Commit 14d69e4

Browse files
committed
Update support for Cynthion boards
- Rename LUNA to Cynthion - Add support for newer revisions (>=0.6) - Bootloader (saturn-v) default size is now 2K
1 parent f5d0510 commit 14d69e4

File tree

10 files changed

+39
-15
lines changed

10 files changed

+39
-15
lines changed

docs/reference/supported.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ SAMD11 & SAMD21
175175
- `Adafruit Feather M0 Express <https://www.adafruit.com/product/3403>`__
176176
- `Adafruit ItsyBitsy M0 Express <https://www.adafruit.com/product/3727>`__
177177
- `Adafruit Metro M0 Express <https://www.adafruit.com/product/3505>`__
178-
- `Great Scott Gadgets LUNA <https://greatscottgadgets.com/luna/>`__
178+
- `Great Scott Gadgets Cynthion <https://greatscottgadgets.com/cynthion/>`__
179179
- `Microchip SAMD11 Xplained Pro <https://www.microchip.com/developmenttools/ProductDetails/atsamd11-xpro>`__
180180
- `Microchip SAMD21 Xplained Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/ATSAMD21-XPRO>`__
181181
- `Seeeduino Xiao <https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html>`__

hw/bsp/samd11/boards/luna_d11/board.h renamed to hw/bsp/samd11/boards/cynthion_d11/board.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@
3636
#define LED_STATE_ON 0
3737

3838
// Button
39+
#if ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 6))
3940
#define BUTTON_PIN PIN_PA16 // pin PB22
41+
#define BUTTON_PULL_MODE GPIO_PULL_UP
42+
#else
43+
#define BUTTON_PIN PIN_PA02
44+
#define BUTTON_PULL_MODE GPIO_PULL_OFF
45+
#endif
4046
#define BUTTON_STATE_ACTIVE 0
4147

4248
#ifdef __cplusplus
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
BOARD_REVISION_MAJOR ?= 1
2+
BOARD_REVISION_MINOR ?= 0
3+
4+
CFLAGS += -D__SAMD11D14AM__ \
5+
-D_BOARD_REVISION_MAJOR_=$(BOARD_REVISION_MAJOR) \
6+
-D_BOARD_REVISION_MINOR_=$(BOARD_REVISION_MINOR)
7+
8+
# All source paths should be relative to the top level.
9+
LD_FILE = $(BOARD_PATH)/samd11d14am_flash.ld
10+
11+
# Default bootloader size is now 2K, allow to specify other
12+
ifeq ($(BOOTLOADER_SIZE), )
13+
BOOTLOADER_SIZE := 0x800
14+
endif
15+
LDFLAGS += -Wl,--defsym=BOOTLOADER_SIZE=$(BOOTLOADER_SIZE)
16+
17+
# For flash-jlink target
18+
JLINK_DEVICE = ATSAMD11D14
19+
20+
# flash using dfu-util
21+
flash: $(BUILD)/$(PROJECT).bin
22+
dfu-util -a 0 -d 1d50:615c -D $< || dfu-util -a 0 -d 16d0:05a5 -D $<

hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld renamed to hw/bsp/samd11/boards/cynthion_d11/samd11d14am_flash.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
3535
/* Memory Spaces Definitions */
3636
MEMORY
3737
{
38-
rom (rx) : ORIGIN = 0x00000000 + 4K, LENGTH = 0x00004000 - 4K
38+
rom (rx) : ORIGIN = 0x00000000 + BOOTLOADER_SIZE, LENGTH = 0x00004000 - BOOTLOADER_SIZE
3939
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00001000
4040
}
4141

hw/bsp/samd11/boards/luna_d11/board.mk

Lines changed: 0 additions & 11 deletions
This file was deleted.

hw/bsp/samd11/boards/samd11_xplained/board.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
// Button
3939
#define BUTTON_PIN PIN_PA14 // pin PB22
4040
#define BUTTON_STATE_ACTIVE 0
41+
#define BUTTON_PULL_MODE GPIO_PULL_UP
4142

4243
#ifdef __cplusplus
4344
}

hw/bsp/samd11/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void board_init(void)
7878

7979
// Button init
8080
gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
81-
gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
81+
gpio_set_pin_pull_mode(BUTTON_PIN, BUTTON_PULL_MODE);
8282

8383
/* USB Clock init
8484
* The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock

hw/bsp/samd21/boards/luna_d21/board.mk renamed to hw/bsp/samd21/boards/cynthion_d21/board.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ CFLAGS += -D__SAMD21G18A__ -DCFG_EXAMPLE_VIDEO_READONLY
22

33
LD_FILE = $(BOARD_PATH)/samd21g18a_flash.ld
44

5+
# Default bootloader size is now 2K, allow to specify other
6+
ifeq ($(BOOTLOADER_SIZE), )
7+
BOOTLOADER_SIZE := 0x800
8+
endif
9+
LDFLAGS += -Wl,--defsym=BOOTLOADER_SIZE=$(BOOTLOADER_SIZE)
10+
511
# For flash-jlink target
612
JLINK_DEVICE = ATSAMD21G18
713

hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld renamed to hw/bsp/samd21/boards/cynthion_d21/samd21g18a_flash.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
3535
/* Memory Spaces Definitions */
3636
MEMORY
3737
{
38-
rom (rx) : ORIGIN = 0x00000000 + 4K, LENGTH = 0x00040000 - 4K
38+
rom (rx) : ORIGIN = 0x00000000 + BOOTLOADER_SIZE, LENGTH = 0x00040000 - BOOTLOADER_SIZE
3939
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
4040
}
4141

0 commit comments

Comments
 (0)