Skip to content

Commit 2c0b856

Browse files
committed
bootloader start by pulling pin to LOW is now optional
1 parent 3666479 commit 2c0b856

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

bootloaders/zero/main.c

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ static void check_start_application(void)
138138
return;
139139
}
140140

141+
#if defined(BOOT_LOAD_PIN)
141142
volatile PortGroup *boot_port = (volatile PortGroup *)(&(PORT->Group[BOOT_LOAD_PIN / 32]));
142143
volatile bool boot_en;
143144

@@ -153,6 +154,7 @@ static void check_start_application(void)
153154
/* Stay in bootloader */
154155
return;
155156
}
157+
#endif
156158

157159
led_port->OUTSET.reg = (1<<30);
158160

bootloaders/zero/main.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929

3030
#pragma once
3131

32-
#define CPU_FREQUENCY 8000000
33-
34-
#define APP_START_ADDRESS 0x00002000
35-
3632
/*
3733
* If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by
3834
* quickly tapping two times on the reset button.
@@ -42,9 +38,16 @@
4238
#define BOOT_DOUBLE_TAP_ADDRESS 0x20007FFC
4339
#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS))
4440

45-
#define BOOT_LOAD_PIN PIN_PA21 //Pin 7
46-
//#define BOOT_LOAD_PIN PIN_PA15 //Pin 5
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
4747
#define BOOT_PIN_MASK (1U << (BOOT_LOAD_PIN & 0x1f))
48+
49+
#define CPU_FREQUENCY 8000000
50+
#define APP_START_ADDRESS 0x00002000
4851
#define FLASH_WAIT_STATES 1
4952

5053
#define BOOT_USART_MODULE SERCOM0

bootloaders/zero/samd21_sam_ba.bin

-44 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)