mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-22 13:29:01 +00:00
machine/atsamd21: uses different required magic values for BOSSA and UF2 bootloaders
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
@@ -8,6 +8,9 @@ package machine
|
|||||||
|
|
||||||
import "device/sam"
|
import "device/sam"
|
||||||
|
|
||||||
|
// used to reset into bootloader
|
||||||
|
const RESET_MAGIC_VALUE = 0x07738135
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
RX0 Pin = PB23 // UART2 RX
|
RX0 Pin = PB23 // UART2 RX
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ package machine
|
|||||||
|
|
||||||
import "device/sam"
|
import "device/sam"
|
||||||
|
|
||||||
|
// used to reset into bootloader
|
||||||
|
const RESET_MAGIC_VALUE = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
D0 = PB09
|
D0 = PB09
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ package machine
|
|||||||
|
|
||||||
import "device/sam"
|
import "device/sam"
|
||||||
|
|
||||||
|
// used to reset into bootloader
|
||||||
|
const RESET_MAGIC_VALUE = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
D0 = PA11 // UART0 RX
|
D0 = PA11 // UART0 RX
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import (
|
|||||||
"device/sam"
|
"device/sam"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// used to reset into bootloader
|
||||||
|
const RESET_MAGIC_VALUE = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
D0 = PA11 // UART0 RX
|
D0 = PA11 // UART0 RX
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ package machine
|
|||||||
|
|
||||||
import "device/sam"
|
import "device/sam"
|
||||||
|
|
||||||
|
// used to reset into bootloader
|
||||||
|
const RESET_MAGIC_VALUE = 0xf01669ef
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
D0 = PA08 // PWM available
|
D0 = PA08 // PWM available
|
||||||
|
|||||||
@@ -2081,7 +2081,7 @@ func ResetProcessor() {
|
|||||||
|
|
||||||
// Perform magic reset into bootloader, as mentioned in
|
// Perform magic reset into bootloader, as mentioned in
|
||||||
// https://github.com/arduino/ArduinoCore-samd/issues/197
|
// https://github.com/arduino/ArduinoCore-samd/issues/197
|
||||||
*(*uint32)(unsafe.Pointer(uintptr(0x20007FFC))) = 0x07738135
|
*(*uint32)(unsafe.Pointer(uintptr(0x20007FFC))) = RESET_MAGIC_VALUE
|
||||||
|
|
||||||
arm.SystemReset()
|
arm.SystemReset()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user