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

Init Support for Family SAML21 #83

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0c76642
Add CaTSatZero
sabas1080 May 1, 2018
05ecdd6
Add Board MeowMeow
sabas1080 Jun 11, 2018
cd7da02
Add CRYSTALLESS to meow meow
sabas1080 Jun 19, 2018
e6bf928
Merge remote-tracking branch 'origin/master'
sabas1080 Nov 1, 2018
b2cb650
Add bast-pro-mini-m0
sabas1080 Nov 17, 2018
63dd349
add mkr1300
sabas1080 Nov 17, 2018
b365db5
Merge remote-tracking branch 'origin/master'
sabas1080 Nov 17, 2018
fe4ac08
update gitignore
sabas1080 Nov 17, 2018
81ec14f
Add catwan-usb-stick
wero1414 Nov 27, 2018
dd8b003
Merge remote-tracking branch 'origin/master'
sabas1080 Mar 19, 2019
a236ab9
add escornabot makech
sabas1080 Apr 20, 2019
dbdc493
Merge pull request #2 from microsoft/master
sabas1080 Oct 24, 2019
3a14b0b
Merge pull request #3 from ElectronicCats/escornabot-makech
sabas1080 Oct 24, 2019
0f14a58
add CMSIS SAML21
sabas1080 Nov 6, 2019
c2c41bb
add scripts ld
sabas1080 Nov 6, 2019
e0c3e6c
add defines for SAML21
sabas1080 Nov 6, 2019
b135f7d
add bastWAN
sabas1080 Nov 6, 2019
ee941e6
define SAML
sabas1080 Nov 7, 2019
3be057a
update reg to SAML
sabas1080 Nov 7, 2019
f178417
fix remove samd21 :P
sabas1080 Nov 7, 2019
e057dc4
best define
sabas1080 Nov 7, 2019
0a9f69e
board config fix typo
sabas1080 Nov 7, 2019
779375c
Revert "Merge pull request #3 from ElectronicCats/escornabot-makech"
sabas1080 Oct 24, 2019
5ea8ad3
Revert "Merge remote-tracking branch 'origin/master'"
sabas1080 Mar 19, 2019
353cbd0
new random UF2_FAMILY number
sabas1080 Nov 11, 2019
39de39b
Memory Spaces Definitions as SAMD21
sabas1080 Nov 11, 2019
e30bdc1
example of ok compile without nostartfiles
sabas1080 Nov 11, 2019
ef4d810
add flag conditional for SAML21
sabas1080 Nov 12, 2019
ca2e580
fix gclk_sync
sabas1080 Nov 19, 2019
ced912b
correct structure DFLLCTRL
sabas1080 Nov 19, 2019
3c1135c
update OTP for SAML
sabas1080 Nov 19, 2019
09e698d
fix lose OSCCTRL
sabas1080 Nov 19, 2019
39c9082
correct reg for XOSC
sabas1080 Nov 19, 2019
64b1e5c
config bastwan
sabas1080 Nov 21, 2019
99cee8b
add SAML21E Generic
sabas1080 Nov 21, 2019
e237ba5
update reg DIV
sabas1080 Nov 21, 2019
e32b126
add SAML21 cdc
sabas1080 Dec 3, 2019
1711d96
test reg
sabas1080 Dec 3, 2019
6df788e
usart_sam_ba test
sabas1080 Dec 3, 2019
9ebb298
working CRYSTALLESS in SAML21
sabas1080 Dec 4, 2019
b0a6042
CRYSTAL working for SAML21
sabas1080 Dec 4, 2019
13ca335
update PID for BastWAN
sabas1080 Dec 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ CC=arm-none-eabi-gcc
ifeq ($(CHIP_FAMILY), samd21)
COMMON_FLAGS = -mthumb -mcpu=cortex-m0plus -Os -g -DSAMD21
endif
ifeq ($(CHIP_FAMILY), saml21)
COMMON_FLAGS = -mthumb -mcpu=cortex-m0plus -Os -g -DSAML21
endif
ifeq ($(CHIP_FAMILY), samd51)
COMMON_FLAGS = -mthumb -mcpu=cortex-m4 -O2 -g -DSAMD51
endif
Expand Down Expand Up @@ -34,6 +37,12 @@ BOOTLOADER_SIZE=8192
SELF_LINKER_SCRIPT=scripts/samd21j18a_self.ld
endif

ifeq ($(CHIP_FAMILY), saml21)
LINKER_SCRIPT=scripts/saml21j18b.ld
BOOTLOADER_SIZE=8192
SELF_LINKER_SCRIPT=scripts/saml21j18b_self.ld
endif

ifeq ($(CHIP_FAMILY), samd51)
LINKER_SCRIPT=scripts/samd51j19a.ld
BOOTLOADER_SIZE=16384
Expand All @@ -50,6 +59,9 @@ INCLUDES = -I. -I./inc -I./inc/preprocessor
INCLUDES += -I./boards/$(BOARD) -Ilib/cmsis/CMSIS/Include -Ilib/usb_msc
INCLUDES += -I$(BUILD_PATH)

ifeq ($(CHIP_FAMILY), saml21)
INCLUDES += -Ilib/saml21/saml21b/include/
endif

ifeq ($(CHIP_FAMILY), samd21)
INCLUDES += -Ilib/samd21/samd21a/include/
Expand Down
2 changes: 2 additions & 0 deletions boards/bast-wan/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHIP_FAMILY = saml21
CHIP_VARIANT = SAML21J18B
18 changes: 18 additions & 0 deletions boards/bast-wan/board_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H

#define __SAML21J18B__ 1

#define VENDOR_NAME "Generic Corp."
#define PRODUCT_NAME "SAML21 Board"
#define VOLUME_LABEL "SAML21"

#define USB_VID 0x03EB // Atmel
#define USB_PID 0x2402 // Generic HID device

#define BOARD_ID "SAML21J18B-Generic"

#define LED_PIN PIN_PA17


#endif
7 changes: 5 additions & 2 deletions inc/uf2.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,17 @@ void padded_memcpy(char *dst, const char *src, int len);
#ifdef SAMD21
#define DBL_TAP_PTR ((volatile uint32_t *)(HMCRAMC0_ADDR + HMCRAMC0_SIZE - 4))
#endif
#ifdef SAML21
#define DBL_TAP_PTR ((volatile uint32_t *)(HSRAM_ADDR + LPRAM_SIZE - 4))
#endif
#ifdef SAMD51
#define DBL_TAP_PTR ((volatile uint32_t *)(HSRAM_ADDR + HSRAM_SIZE - 4))
#endif
#define DBL_TAP_MAGIC 0xf01669ef // Randomly selected, adjusted to have first and last bit set
#define DBL_TAP_MAGIC_QUICK_BOOT 0xf02669ef

#if USE_SINGLE_RESET
#ifdef SAMD21
#if defined(SAMD21) || defined(SAML21)
#define SINGLE_RESET() (*((uint32_t *)0x20B4) == 0x87eeb07c)
#endif
#ifdef SAMD51
Expand Down Expand Up @@ -292,7 +295,7 @@ void handoverPrep(void);
#define CONCAT_0(a, b) CONCAT_1(a, b)
#define STATIC_ASSERT(e) enum { CONCAT_0(_static_assert_, __LINE__) = 1 / ((e) ? 1 : 0) }

#ifdef SAMD21
#if defined(SAMD21) || defined(SAML21)
STATIC_ASSERT(FLASH_ROW_SIZE == FLASH_PAGE_SIZE * 4);
STATIC_ASSERT(FLASH_ROW_SIZE == NVMCTRL_ROW_SIZE);
STATIC_ASSERT(FLASH_NUM_ROWS * 4 == FLASH_NB_OF_PAGES);
Expand Down
4 changes: 4 additions & 0 deletions inc/uf2format.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#define APP_START_ADDRESS 0x00002000
#define UF2_FAMILY 0x68ed2b88
#endif
#ifdef SAML21
#define APP_START_ADDRESS 0x00002000
#define UF2_FAMILY 0x68ed2b88
sabas1080 marked this conversation as resolved.
Show resolved Hide resolved
#endif
#ifdef SAMD51
#define APP_START_ADDRESS 0x00004000
#define UF2_FAMILY 0x55114460
Expand Down
Loading