Skip to content

Commit e8b316c

Browse files
committed
DM: adding feather m4
1 parent 63ba6aa commit e8b316c

19 files changed

+1125
-21
lines changed

boards.txt

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ adafruit_metro_m4.build.mcu=cortex-m4
170170
adafruit_metro_m4.build.f_cpu=48000000L
171171
adafruit_metro_m4.build.usb_product="Adafruit Metro M4"
172172
adafruit_metro_m4.build.usb_manufacturer="Adafruit LLC"
173-
adafruit_metro_m4.build.board=SAMD_51
173+
adafruit_metro_m4.build.board=METRO_M4
174174
adafruit_metro_m4.build.core=arduino
175175
adafruit_metro_m4.build.extra_flags=-D__SAMD51J20A__ -D__SAMD51__ {build.usb_flags}
176176
adafruit_metro_m4.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
@@ -184,3 +184,35 @@ adafruit_metro_m4.bootloader.file=metroM4/samd51_sam_ba.bin
184184
adafruit_metro_m4.compiler.c.elf.extra_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
185185
adafruit_metro_m4.compiler.c.extra_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
186186
adafruit_metro_m4.compiler.cpp.extra_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
187+
188+
# Adafruit Feather M4 (SAMD51)
189+
# ------------------------------
190+
adafruit_feather_m4.name=Adafruit Feather M4 (SAMD51)
191+
adafruit_feather_m4.vid.0=0x239A
192+
adafruit_feather_m4.pid.0=0x8022
193+
adafruit_feather_m4.vid.1=0x239A
194+
adafruit_feather_m4.pid.1=0x0022
195+
adafruit_feather_m4.upload.tool=bossac
196+
adafruit_feather_m4.upload.protocol=sam-ba
197+
adafruit_feather_m4.upload.maximum_size=524288
198+
adafruit_feather_m4.upload.use_1200bps_touch=true
199+
adafruit_feather_m4.upload.wait_for_upload_port=true
200+
adafruit_feather_m4.upload.native_usb=true
201+
adafruit_feather_m4.build.mcu=cortex-m4
202+
adafruit_feather_m4.build.f_cpu=48000000L
203+
adafruit_feather_m4.build.usb_product="Adafruit Feather M4"
204+
adafruit_feather_m4.build.usb_manufacturer="Adafruit LLC"
205+
adafruit_feather_m4.build.board=FEATHER_M4
206+
adafruit_feather_m4.build.core=arduino
207+
adafruit_feather_m4.build.extra_flags=-D__SAMD51G19A__ -D__SAMD51__ {build.usb_flags}
208+
adafruit_feather_m4.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
209+
adafruit_feather_m4.build.openocdscript=openocd_scripts/arduino_zero.cfg
210+
adafruit_feather_m4.build.variant=feather_m4
211+
adafruit_feather_m4.build.variant_system_lib=
212+
adafruit_feather_m4.build.vid=0x239A
213+
adafruit_feather_m4.build.pid=0x8022
214+
adafruit_feather_m4.bootloader.tool=openocd
215+
adafruit_feather_m4.bootloader.file=metroM4/samd51_sam_ba.bin
216+
adafruit_feather_m4.compiler.c.elf.extra_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
217+
adafruit_feather_m4.compiler.c.extra_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
218+
adafruit_feather_m4.compiler.cpp.extra_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
Binary file not shown.

bootloaders/metroM4/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ SIZE=$(ARM_GCC_PATH)size
5757

5858
# -----------------------------------------------------------------------------
5959
# Boards definitions
60-
BOARD_ID?=METRO_M4
60+
BOARD_ID?=FEATHER_M4
6161

6262
# -----------------------------------------------------------------------------
6363
# Compiler options
64-
CFLAGS_EXTRA=-D__SAMD51J20A__ -DBOARD_ID_$(BOARD_ID)
64+
CFLAGS_EXTRA=-D__SAMD51G19A__ -DBOARD_ID_$(BOARD_ID)
6565
CFLAGS=-mthumb -mcpu=cortex-m4 -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -ffunction-sections -fdata-sections -nostdlib -nostartfiles --param max-inline-insns-single=500
6666
ifdef DEBUG
6767
CFLAGS+=-g3 -O1 -DDEBUG=1

bootloaders/metroM4/board_definitions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#if defined(BOARD_ID_METRO_M4)
2121
#include "board_definitions_metro_m4.h"
22+
#elif defined(BOARD_ID_FEATHER_M4)
23+
#include "board_definitions_feather_m4.h"
2224
#else
2325
#error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h
2426
#endif
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
Copyright (c) 2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
See the GNU Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#ifndef _BOARD_DEFINITIONS_H_
21+
#define _BOARD_DEFINITIONS_H_
22+
23+
/*
24+
* USB device definitions
25+
*/
26+
#define STRING_PRODUCT "Feather M4"
27+
#define USB_VID_HIGH 0x23
28+
#define USB_VID_LOW 0x9A
29+
#define USB_PID_HIGH 0x00
30+
#define USB_PID_LOW 0x22
31+
32+
/*
33+
* If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by
34+
* quickly tapping two times on the reset button.
35+
* BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not
36+
* be touched from the loaded application.
37+
*/
38+
#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul)
39+
#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS))
40+
41+
/*
42+
* If BOOT_LOAD_PIN is defined the bootloader is started if the selected
43+
* pin is tied LOW.
44+
*/
45+
//#define BOOT_LOAD_PIN PIN_PA21 // Pin 7
46+
//#define BOOT_LOAD_PIN PIN_PA15 // Pin 5
47+
48+
#define GPIO(port, pin) ((((port)&0x7u) << 5) + ((pin)&0x1Fu))
49+
50+
#define BOOK_USART_MASK APBAMASK
51+
#define BOOT_USART_MODULE SERCOM0
52+
#define BOOT_USART_BUS_CLOCK_INDEX MCLK_APBAMASK_SERCOM0
53+
#define BOOT_GCLK_ID_CORE SERCOM0_GCLK_ID_CORE
54+
#define BOOT_GCLK_ID_SLOW SERCOM0_GCLK_ID_SLOW
55+
#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2
56+
#define BOOT_USART_PAD3 PINMUX_UNUSED
57+
#define BOOT_USART_PAD2 PINMUX_UNUSED
58+
59+
#define BOOT_USART_PAD1 PINMUX_PA10C_SERCOM0_PAD2
60+
#define BOOT_USART_PAD0 PINMUX_PA11C_SERCOM0_PAD3
61+
62+
/* Master clock frequency */
63+
#define CPU_FREQUENCY (48000000ul)
64+
#define VARIANT_MCK CPU_FREQUENCY
65+
66+
/* Frequency of the board main oscillator */
67+
#define VARIANT_MAINOSC (32768ul)
68+
69+
/* Calibration values for DFLL48 pll */
70+
#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58)
71+
#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64)
72+
73+
#define BOARD_LED_PORT (0)
74+
#define BOARD_LED_PIN (17)
75+
76+
#define BOARD_LEDRX_PORT (1)
77+
#define BOARD_LEDRX_PIN (3)
78+
79+
#define BOARD_LEDTX_PORT (0)
80+
#define BOARD_LEDTX_PIN (27)
81+
82+
#endif // _BOARD_DEFINITIONS_H_

bootloaders/metroM4/board_definitions_metro_m4.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#ifndef _BOARD_DEFINITIONS_H_
2121
#define _BOARD_DEFINITIONS_H_
22-
2322
/*
2423
* USB device definitions
2524
*/

bootloaders/metroM4/samd51_sam_ba.bin

0 Bytes
Binary file not shown.

bootloaders/metroM4/samd51_sam_ba.cproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ProjectVersion>7.0</ProjectVersion>
66
<ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
77
<ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
8-
<avrdevice>ATSAMD51J20A</avrdevice>
8+
<avrdevice>ATSAMD51G19A</avrdevice>
99
<avrdeviceseries>none</avrdeviceseries>
1010
<OutputType>Executable</OutputType>
1111
<Language>C</Language>
@@ -41,7 +41,7 @@
4141
</AsfFrameworkConfig>
4242
<avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
4343
<avrtoolserialnumber>00000000EZE000006352</avrtoolserialnumber>
44-
<avrdeviceexpectedsignature>0x60060004</avrdeviceexpectedsignature>
44+
<avrdeviceexpectedsignature>0x60060007</avrdeviceexpectedsignature>
4545
<avrtoolinterface>SWD</avrtoolinterface>
4646
<com_atmel_avrdbg_tool_atmelice>
4747
<ToolOptions>
@@ -133,6 +133,9 @@
133133
<SubType>compile</SubType>
134134
<Link>board_definitions.h</Link>
135135
</Compile>
136+
<Compile Include="board_definitions_feather_m4.h">
137+
<SubType>compile</SubType>
138+
</Compile>
136139
<Compile Include="board_definitions_metro_m4.h">
137140
<SubType>compile</SubType>
138141
</Compile>

bootloaders/metroM4/samd51_sam_ba.elf

-53.9 KB
Binary file not shown.

bootloaders/metroM4/samd51_sam_ba.hex

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
:1000700000800648036813B1054B03B1984708BDDB
99
:1000800000000000041C0000600000205800002058
1010
:10009000000000001A4B1B7813F0FF0F0AD1194B18
11-
:1000A0001A78194909780A44D2B21A704FF400122A
11+
:1000A0001A78194909780A44D2B21A704FF400320A
1212
:1000B000164BDA61124B1A780132D2B21A70114B18
1313
:1000C0001B78DBB2F02B04D80E4B1B78DBB2092B6C
1414
:1000D0000AD80D4B1A785242D2B21A70094A1178D6
1515
:1000E0001B780B44DBB21370054B1A78054B1B7859
16-
:1000F000D2B29A4203D14FF40012044BDA61704736
16+
:1000F000D2B29A4203D14FF40032044BDA61704716
1717
:100100007800002001000020000000200080004155
1818
:1001100010B4C36913F0020FFBD104686FF34104FC
1919
:100120000460C36913F0010FFBD1046844F00104BB
@@ -114,8 +114,8 @@
114114
:100710002D4B19602E4B013BFDD100212A4B196056
115115
:10072000254B1B6883F3088822F07F02294B9A60CF
116116
:10073000234B1B681B681847FFF708FF62B600F0E1
117-
:10074000D1FE00F055F80546234B4FF400129A6095
118-
:100750004022C3F88820C3F898204FF000629A60C6
117+
:10074000D1FE00F055F80546234B4FF400329A6075
118+
:100750000822C3F88820C3F898204FF000629A60FE
119119
:100760009A611E4B40F2E7325A60C021194A82F862
120120
:10077000231000229A6007221A60194C0126AB68E8
121121
:100780002846984700B12670237813F0FF0F05D054
@@ -173,10 +173,10 @@
173173
:100AC000C2F34012C2F30012164B1A803068154967
174174
:100AD00002220023FFF754FCFEE020460121FFF72D
175175
:100AE000DDFCF9E020460121FFF7D8FCF4E02046C8
176-
:100AF000FFF7E4FCF0E000BF94000020830000203A
177-
:100B0000860000207C000020800000207E00002065
176+
:100AF000FFF7E4FCF0E000BF94000020810000203C
177+
:100B000084000020860000207C0000207E00002061
178178
:100B10004C190000040000203019000034190000B6
179-
:100B20004019000084000020820000206B4B1988CF
179+
:100B20004019000082000020800000206B4B1988D3
180180
:100B300089B221F07F01C9B2694A11701A8802F0A6
181181
:100B40000F021A80674B1B889BB2DBB9634B1B8873
182182
:100B50009BB2BBB1614B1B889BB2032B12D8604B7D
@@ -203,8 +203,8 @@
203203
:100CA0000DFC19E03068104B1B889BB2082B9DBFD0
204204
:100CB0000D4B1A8892B208220C490023FFF760FB03
205205
:100CC0000AE0084B1B8873712046FFF7F7FB03E02F
206-
:100CD00020460121FFF7E2FB03B0F0BD80000020B9
207-
:100CE000820000207C0000207E00002048000020C0
206+
:100CD00020460121FFF7E2FB03B0F0BD7C000020BD
207+
:100CE00080000020860000207E00002048000020B8
208208
:100CF00000B583B002A941F8040D054B1868012224
209209
:100D00001346FFF73DFB012003B05DF804FB00BF75
210210
:100D10001802002000B583B0054B18680DF10701DB
@@ -238,15 +238,15 @@
238238
:100ED00043681847704700BF8C0200200E4B1B88E8
239239
:100EE0009BB24BB10C4A1388013B9BB213801BB9D8
240240
:100EF0004FF00062094B9A61094B1B889BB24BB1C2
241-
:100F0000074A1388013B9BB213801BB94022034B55
241+
:100F0000074A1388013B9BB213801BB90822034B8D
242242
:100F1000C3F89820704700BF900000200080004177
243243
:100F20008E0000202DE9F0438BB002AC894D0FCD2F
244244
:100F30000FC495E80F0084E80F00874A9368C3F355
245245
:100F400002430AA901EB830353F8203C83490B6059
246246
:100F5000926892B282490A6002FB03F381490B60F6
247247
:100F60000022814B1A607A22804B1A707A4C7B4D9A
248248
:100F70007F4B1B681B697F4840219847034630B16F
249-
:100F800040217D4AC2F8941064217C4A11807C4A39
249+
:100F800008217D4AC2F8941064217C4A11807C4A71
250250
:100F9000136078497B4A116000217B4A1160002B65
251251
:100FA000E6D0784B1B681B78FF2B00F06682232B62
252252
:100FB00040F00482754B1B7813F0FF0F05D06C4B8B
@@ -258,7 +258,7 @@
258258
:1010100011605C4A116819441160604A13705A4BA0
259259
:101020001A68013A1A60574B1A68013A1A605B4B0A
260260
:101030001B78584A11688B420ED24D4A1268926949
261-
:1010400049480068C91A904730B140224A4BC3F85A
261+
:1010400049480068C91A904730B108224A4BC3F892
262262
:1010500094206422494B1A8000BF9DE1522B0FD18E
263263
:10106000434B1B685B69404A10684A4A11689847BD
264264
:101070004FF00062404B5A616422494B1A808BE169
@@ -402,14 +402,14 @@
402402
:10191000181A013870470000F8B500BFF8BC08BCC1
403403
:101920009E467047F8B500BFF8BC08BC9E4670479D
404404
:101930000403090441726475696E6F204C4C4300C6
405-
:101940004D6574726F204D340000000012010002DA
406-
:10195000020000409A232000000201020001000062
405+
:1019400046656174686572204D3400001201000222
406+
:10195000020000409A232200000201020001000060
407407
:1019600008000000100000002000000040000000FF
408408
:1019700080000000000100000002000000040000E0
409409
:1019800099150000BD150000AD150000F11500000F
410410
:101990000D160000B1160000DD170000322E3000D9
411411
:1019A0000A0D000076000000200000004F63742044
412-
:1019B000203420323031370031303A35353A313049
412+
:1019B000313320323031370031353A32343A33392D
413413
:1019C00000000000580A0D00590A0D005A000000DE
414414
:1019D000230A0D003E000000F10C0000150D000070
415415
:1019E000350D0000550D0000710D0000550D000073

0 commit comments

Comments
 (0)