Skip to content

Commit 7d481c1

Browse files
deadprogramaykevl
authored andcommitted
machine/atsamd21: uses different required magic values for BOSSA and UF2 bootloaders
Signed-off-by: Ron Evans <[email protected]>
1 parent 69aaea4 commit 7d481c1

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

src/machine/board_arduino_nano33.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ package machine
88

99
import "device/sam"
1010

11+
// used to reset into bootloader
12+
const RESET_MAGIC_VALUE = 0x07738135
13+
1114
// GPIO Pins
1215
const (
1316
RX0 Pin = PB23 // UART2 RX

src/machine/board_circuitplay_express.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ package machine
44

55
import "device/sam"
66

7+
// used to reset into bootloader
8+
const RESET_MAGIC_VALUE = 0xf01669ef
9+
710
// GPIO Pins
811
const (
912
D0 = PB09

src/machine/board_feather-m0.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ package machine
44

55
import "device/sam"
66

7+
// used to reset into bootloader
8+
const RESET_MAGIC_VALUE = 0xf01669ef
9+
710
// GPIO Pins
811
const (
912
D0 = PA11 // UART0 RX

src/machine/board_itsybitsy-m0.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import (
66
"device/sam"
77
)
88

9+
// used to reset into bootloader
10+
const RESET_MAGIC_VALUE = 0xf01669ef
11+
912
// GPIO Pins
1013
const (
1114
D0 = PA11 // UART0 RX

src/machine/board_trinket.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ package machine
44

55
import "device/sam"
66

7+
// used to reset into bootloader
8+
const RESET_MAGIC_VALUE = 0xf01669ef
9+
710
// GPIO Pins
811
const (
912
D0 = PA08 // PWM available

src/machine/machine_atsamd21.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,7 @@ func ResetProcessor() {
20812081

20822082
// Perform magic reset into bootloader, as mentioned in
20832083
// https://github.com/arduino/ArduinoCore-samd/issues/197
2084-
*(*uint32)(unsafe.Pointer(uintptr(0x20007FFC))) = 0x07738135
2084+
*(*uint32)(unsafe.Pointer(uintptr(0x20007FFC))) = RESET_MAGIC_VALUE
20852085

20862086
arm.SystemReset()
20872087
}

0 commit comments

Comments
 (0)