summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/reference/supported.rst2
-rw-r--r--hw/bsp/samd11/boards/cynthion_d11/board.h (renamed from hw/bsp/samd11/boards/luna_d11/board.h)6
-rw-r--r--hw/bsp/samd11/boards/cynthion_d11/board.mk22
-rw-r--r--hw/bsp/samd11/boards/cynthion_d11/samd11d14am_flash.ld (renamed from hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld)2
-rw-r--r--hw/bsp/samd11/boards/luna_d11/board.mk11
-rw-r--r--hw/bsp/samd11/boards/samd11_xplained/board.h1
-rw-r--r--hw/bsp/samd11/family.c2
-rw-r--r--hw/bsp/samd21/boards/cynthion_d21/board.h (renamed from hw/bsp/samd21/boards/luna_d21/board.h)0
-rw-r--r--hw/bsp/samd21/boards/cynthion_d21/board.mk (renamed from hw/bsp/samd21/boards/luna_d21/board.mk)6
-rw-r--r--hw/bsp/samd21/boards/cynthion_d21/samd21g18a_flash.ld (renamed from hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld)2
10 files changed, 39 insertions, 15 deletions
diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst
index a5d055893..aed64782c 100644
--- a/docs/reference/supported.rst
+++ b/docs/reference/supported.rst
@@ -175,7 +175,7 @@ SAMD11 & SAMD21
- `Adafruit Feather M0 Express <https://www.adafruit.com/product/3403>`__
- `Adafruit ItsyBitsy M0 Express <https://www.adafruit.com/product/3727>`__
- `Adafruit Metro M0 Express <https://www.adafruit.com/product/3505>`__
-- `Great Scott Gadgets LUNA <https://greatscottgadgets.com/luna/>`__
+- `Great Scott Gadgets Cynthion <https://greatscottgadgets.com/cynthion/>`__
- `Microchip SAMD11 Xplained Pro <https://www.microchip.com/developmenttools/ProductDetails/atsamd11-xpro>`__
- `Microchip SAMD21 Xplained Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/ATSAMD21-XPRO>`__
- `Seeeduino Xiao <https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html>`__
diff --git a/hw/bsp/samd11/boards/luna_d11/board.h b/hw/bsp/samd11/boards/cynthion_d11/board.h
index 1bda92934..b13c8eeea 100644
--- a/hw/bsp/samd11/boards/luna_d11/board.h
+++ b/hw/bsp/samd11/boards/cynthion_d11/board.h
@@ -36,7 +36,13 @@
#define LED_STATE_ON 0
// Button
+#if ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 6))
#define BUTTON_PIN PIN_PA16 // pin PB22
+#define BUTTON_PULL_MODE GPIO_PULL_UP
+#else
+#define BUTTON_PIN PIN_PA02
+#define BUTTON_PULL_MODE GPIO_PULL_OFF
+#endif
#define BUTTON_STATE_ACTIVE 0
#ifdef __cplusplus
diff --git a/hw/bsp/samd11/boards/cynthion_d11/board.mk b/hw/bsp/samd11/boards/cynthion_d11/board.mk
new file mode 100644
index 000000000..d36c91970
--- /dev/null
+++ b/hw/bsp/samd11/boards/cynthion_d11/board.mk
@@ -0,0 +1,22 @@
+BOARD_REVISION_MAJOR ?= 1
+BOARD_REVISION_MINOR ?= 0
+
+CFLAGS += -D__SAMD11D14AM__ \
+ -D_BOARD_REVISION_MAJOR_=$(BOARD_REVISION_MAJOR) \
+ -D_BOARD_REVISION_MINOR_=$(BOARD_REVISION_MINOR)
+
+# All source paths should be relative to the top level.
+LD_FILE = $(BOARD_PATH)/samd11d14am_flash.ld
+
+# Default bootloader size is now 2K, allow to specify other
+ifeq ($(BOOTLOADER_SIZE), )
+ BOOTLOADER_SIZE := 0x800
+endif
+LDFLAGS += -Wl,--defsym=BOOTLOADER_SIZE=$(BOOTLOADER_SIZE)
+
+# For flash-jlink target
+JLINK_DEVICE = ATSAMD11D14
+
+# flash using dfu-util
+flash: $(BUILD)/$(PROJECT).bin
+ dfu-util -a 0 -d 1d50:615c -D $< || dfu-util -a 0 -d 16d0:05a5 -D $<
diff --git a/hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld b/hw/bsp/samd11/boards/cynthion_d11/samd11d14am_flash.ld
index cb633c195..f175e6504 100644
--- a/hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld
+++ b/hw/bsp/samd11/boards/cynthion_d11/samd11d14am_flash.ld
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
- rom (rx) : ORIGIN = 0x00000000 + 4K, LENGTH = 0x00004000 - 4K
+ rom (rx) : ORIGIN = 0x00000000 + BOOTLOADER_SIZE, LENGTH = 0x00004000 - BOOTLOADER_SIZE
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00001000
}
diff --git a/hw/bsp/samd11/boards/luna_d11/board.mk b/hw/bsp/samd11/boards/luna_d11/board.mk
deleted file mode 100644
index ad9cfb25d..000000000
--- a/hw/bsp/samd11/boards/luna_d11/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -D__SAMD11D14AM__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/samd11d14am_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD11D14
-
-# flash using dfu-util
-flash: $(BUILD)/$(PROJECT).bin
- dfu-util -a 0 -d 1d50:615c -D $< || dfu-util -a 0 -d 16d0:05a5 -D $<
diff --git a/hw/bsp/samd11/boards/samd11_xplained/board.h b/hw/bsp/samd11/boards/samd11_xplained/board.h
index cfeac673c..2bbec4958 100644
--- a/hw/bsp/samd11/boards/samd11_xplained/board.h
+++ b/hw/bsp/samd11/boards/samd11_xplained/board.h
@@ -38,6 +38,7 @@
// Button
#define BUTTON_PIN PIN_PA14 // pin PB22
#define BUTTON_STATE_ACTIVE 0
+#define BUTTON_PULL_MODE GPIO_PULL_UP
#ifdef __cplusplus
}
diff --git a/hw/bsp/samd11/family.c b/hw/bsp/samd11/family.c
index 8d9633971..e232761cc 100644
--- a/hw/bsp/samd11/family.c
+++ b/hw/bsp/samd11/family.c
@@ -78,7 +78,7 @@ void board_init(void)
// Button init
gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
+ gpio_set_pin_pull_mode(BUTTON_PIN, BUTTON_PULL_MODE);
/* USB Clock init
* The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
diff --git a/hw/bsp/samd21/boards/luna_d21/board.h b/hw/bsp/samd21/boards/cynthion_d21/board.h
index 776063636..776063636 100644
--- a/hw/bsp/samd21/boards/luna_d21/board.h
+++ b/hw/bsp/samd21/boards/cynthion_d21/board.h
diff --git a/hw/bsp/samd21/boards/luna_d21/board.mk b/hw/bsp/samd21/boards/cynthion_d21/board.mk
index 508a72b1f..52c9d60cb 100644
--- a/hw/bsp/samd21/boards/luna_d21/board.mk
+++ b/hw/bsp/samd21/boards/cynthion_d21/board.mk
@@ -2,6 +2,12 @@ CFLAGS += -D__SAMD21G18A__ -DCFG_EXAMPLE_VIDEO_READONLY
LD_FILE = $(BOARD_PATH)/samd21g18a_flash.ld
+# Default bootloader size is now 2K, allow to specify other
+ifeq ($(BOOTLOADER_SIZE), )
+ BOOTLOADER_SIZE := 0x800
+endif
+LDFLAGS += -Wl,--defsym=BOOTLOADER_SIZE=$(BOOTLOADER_SIZE)
+
# For flash-jlink target
JLINK_DEVICE = ATSAMD21G18
diff --git a/hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld b/hw/bsp/samd21/boards/cynthion_d21/samd21g18a_flash.ld
index 158593036..ecb6b8523 100644
--- a/hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld
+++ b/hw/bsp/samd21/boards/cynthion_d21/samd21g18a_flash.ld
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
- rom (rx) : ORIGIN = 0x00000000 + 4K, LENGTH = 0x00040000 - 4K
+ rom (rx) : ORIGIN = 0x00000000 + BOOTLOADER_SIZE, LENGTH = 0x00040000 - BOOTLOADER_SIZE
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}