Skip to content

Commit 4f072bc

Browse files
committed
DM: fix upload bug
1 parent c62a2be commit 4f072bc

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed
Binary file not shown.

bootloaders/metroM4/samd51_sam_ba.cproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,12 @@
193193
</ToolchainSettings>
194194
<UsesExternalMakeFile>True</UsesExternalMakeFile>
195195
<OutputDirectory />
196-
<BuildTarget>DEBUG=1 all BOARD_ID=METRO_M4 BOARD_CHIP=__SAMD51J19A__</BuildTarget>
196+
<BuildTarget>DEBUG=0 all BOARD_ID=METRO_M4 BOARD_CHIP=__SAMD51J19A__</BuildTarget>
197197
<CleanTarget>clean BOARD_ID=METRO_M4</CleanTarget>
198198
<ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
199199
<OutputPath>bin\metrom4\</OutputPath>
200+
<OutputFileName>METRO_M4_sam_ba</OutputFileName>
201+
<OutputFileExtension>.elf</OutputFileExtension>
200202
</PropertyGroup>
201203
<ItemGroup>
202204
<Compile Include="board_definitions.h">

cores/arduino/Reset.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@ extern "C" {
3030
extern const uint32_t __text_start__;
3131
#define APP_START ((volatile uint32_t)(&__text_start__) + 4)
3232

33+
#else
34+
35+
#if defined(__SAMD51__)
36+
#define APP_START 0x00004004
3337
#else
3438
#define APP_START 0x00002004
3539
#endif
3640

41+
#endif
42+
3743
static inline bool nvmReady(void) {
3844
#if defined(__SAMD51__)
3945
return NVMCTRL->STATUS.reg & NVMCTRL_STATUS_READY;
@@ -50,7 +56,7 @@ static void banzai() {
5056
#if defined(__SAMD51__)
5157
//THESE MUST MATCH THE BOOTLOADER
5258
#define DOUBLE_TAP_MAGIC 0x07738135
53-
#define BOOT_DOUBLE_TAP_ADDRESS 0x20007FFC
59+
#define BOOT_DOUBLE_TAP_ADDRESS 0x2002FFFCul
5460

5561
unsigned long *a = (unsigned long *)BOOT_DOUBLE_TAP_ADDRESS;
5662
*a = DOUBLE_TAP_MAGIC;

0 commit comments

Comments
 (0)