Skip to content

Commit da3291d

Browse files
committed
DM: updated bootloader size to 16k, fixed USB vid/pid
1 parent e42ab7b commit da3291d

File tree

13 files changed

+19
-23
lines changed

13 files changed

+19
-23
lines changed

boards.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ adafruit_metro_m4.build.variant_system_lib=
180180
adafruit_metro_m4.build.vid=0x2341
181181
adafruit_metro_m4.build.pid=0x804d
182182
adafruit_metro_m4.bootloader.tool=openocd
183-
adafruit_metro_m4.bootloader.file=metroM4/samdx1_sam_ba.bin
183+
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
512 Bytes
Binary file not shown.

bootloaders/metroM4/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ endif
7171

7272
#DM: hack b/c I don't know how things work
7373
#ELF=$(NAME).elf
74-
ELF=samdx1_sam_ba.elf
75-
BIN=samdx1_sam_ba.bin
76-
HEX=samdx1_sam_ba.hex
74+
ELF=samd51_sam_ba.elf
75+
BIN=samd51_sam_ba.bin
76+
HEX=samd51_sam_ba.hex
7777

7878

7979
INCLUDES=-I"$(MODULE_PATH)/tools/CMSIS/4.5.0/CMSIS/Include/" -I"$(MODULE_PATH)/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/"
@@ -114,7 +114,7 @@ all: print_info $(SOURCES) $(BIN) $(HEX) $(AS_BUILD)
114114
$(ELF): Makefile $(BUILD_PATH) $(OBJECTS)
115115
@echo ----------------------------------------------------------
116116
@echo Creating ELF binary
117-
"$(CC)" -L. -L$(BUILD_PATH) $(LDFLAGS) -Os -Wl,--gc-sections -save-temps -Tbootloader_samdx1.ld -Wl,-Map,"$(BUILD_PATH)/$(NAME).map" -o "$(BUILD_PATH)/$(ELF)" -Wl,--start-group $(OBJECTS) -lm -Wl,--end-group
117+
"$(CC)" -L. -L$(BUILD_PATH) $(LDFLAGS) -Os -Wl,--gc-sections -save-temps -Tbootloader_samd51.ld -Wl,-Map,"$(BUILD_PATH)/$(NAME).map" -o "$(BUILD_PATH)/$(ELF)" -Wl,--start-group $(OBJECTS) -lm -Wl,--end-group
118118
"$(NM)" "$(BUILD_PATH)/$(ELF)" >"$(BUILD_PATH)/$(NAME)_symbols.txt"
119119
"$(SIZE)" --format=sysv -t -x $(BUILD_PATH)/$(ELF)
120120

bootloaders/metroM4/board_definitions_metro_m4.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
*/
2626
#define STRING_PRODUCT "Metro M4"
2727
#define USB_VID_HIGH 0x23
28-
#define USB_VID_LOW 0x41
28+
#define USB_VID_LOW 0x9A
2929
#define USB_PID_HIGH 0x00
30-
#define USB_PID_LOW 0x4D
30+
#define USB_PID_LOW 0x20
3131

3232
/*
3333
* If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by

bootloaders/metroM4/bootloader_samdx1.ld renamed to bootloaders/metroM4/bootloader_samd51.ld

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@
2525
* RAM.LENGTH: length of RAM bank 0
2626
*/
2727

28-
/*
29-
* TODO: DM: fix this!!
30-
*/
31-
3228
MEMORY
3329
{
34-
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x2000 /* First 8KB used by bootloader */
30+
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x4000 /* First 16KB used by bootloader */
3531
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000-0x0004 /* 4 bytes used by bootloader to keep data between resets */
3632
}
3733

bootloaders/metroM4/samdx1_sam_ba.cproj renamed to bootloaders/metroM4/samd51_sam_ba.cproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<OutputFileExtension>.elf</OutputFileExtension>
1414
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
1515
<AssemblyName>samd21_sam_ba</AssemblyName>
16-
<Name>samdx1_sam_ba</Name>
16+
<Name>samd51_sam_ba</Name>
1717
<RootNamespace>samd21_sam_ba</RootNamespace>
1818
<ToolchainFlavour>Native</ToolchainFlavour>
1919
<KeepTimersRunning>true</KeepTimersRunning>
@@ -133,7 +133,7 @@
133133
<SubType>compile</SubType>
134134
<Link>board_definitions.h</Link>
135135
</Compile>
136-
<Compile Include="board_definitions_arduino_x1.h">
136+
<Compile Include="board_definitions_metro_m4.h">
137137
<SubType>compile</SubType>
138138
</Compile>
139139
<Compile Include="board_driver_led.c">
@@ -206,7 +206,7 @@
206206
</Compile>
207207
</ItemGroup>
208208
<ItemGroup>
209-
<None Include="bootloader_samdx1.ld">
209+
<None Include="bootloader_samd51.ld">
210210
<SubType>compile</SubType>
211211
</None>
212212
<None Include="Makefile">

bootloaders/metroM4/samd51_sam_ba.elf

-25 KB
Binary file not shown.

bootloaders/metroM4/samdx1_sam_ba.hex renamed to bootloaders/metroM4/samd51_sam_ba.hex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
:10079000237813F0FF0F05D0002000F02DFB00F0B0
123123
:1007A000C5FBFCE7237813F0FF0FECD100F016FF38
124124
:1007B0000028E8D0012000F01FFB00F0B7FBFCE7A9
125-
:1007C000002000000420000014020020000C004063
125+
:1007C000004000000440000014020020000C004023
126126
:1007D000FC7F002035817307808D5B0000ED00E019
127127
:1007E0000080004110E000E07B00002008B5FFF72A
128128
:1007F00051FC00F077FB08BD10B5064C4FF082436A
@@ -402,15 +402,15 @@
402402
:1019100013F8012B002AFBD1181A01387047000078
403403
:10192000F8B500BFF8BC08BC9E467047F8B500BFCC
404404
:10193000F8BC08BC9E4670470403090441726475F4
405-
:10194000696E6F204C4C430041726475696E6F2064
406-
:1019500078310000120100020200004041234D00D6
405+
:10194000696E6F204C4C43004D6574726F204D34AE
406+
:101950000000000012010002020000409A23200053
407407
:101960000002010200010000080000001000000059
408408
:101970002000000040000000800000000001000086
409409
:101980000002000000040000A1150000C5150000C1
410410
:10199000B5150000F915000015160000B916000075
411411
:1019A000E5170000322E30000A0D0000760000001E
412-
:1019B000200000004175672020312032303137008F
413-
:1019C00031373A33343A333400000000580A0D00FE
412+
:1019B000200000004F637420203420323031370083
413+
:1019C00031303A35353A313000000000580A0D0008
414414
:1019D000590A0D005A000000230A0D003E000000C5
415415
:1019E000F90C00001D0D00003D0D00005D0D000014
416416
:1019F000790D00005D0D00009D0D00005B417264DB

0 commit comments

Comments
 (0)