Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arduino Core for SAMD21 CPU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
Arduino Core for SAMD21 CPU
Commits
dd50d5c4
Commit
dd50d5c4
authored
10 years ago
by
Cristian Maglie
Committed by
Cristian Maglie
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implemented 1200bps-touch to restart bootloader when connected from native port
parent
b11367dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
boards.txt
+2
-2
2 additions, 2 deletions
boards.txt
cores/arduino/Reset.cpp
+17
-1
17 additions, 1 deletion
cores/arduino/Reset.cpp
cores/arduino/delay.c
+3
-0
3 additions, 0 deletions
cores/arduino/delay.c
with
22 additions
and
3 deletions
boards.txt
+
2
−
2
View file @
dd50d5c4
...
...
@@ -28,8 +28,8 @@ arduino_zero_native.pid.0=0x004d
arduino_zero_native.upload.tool=bossac
arduino_zero_native.upload.protocol=sam-ba
arduino_zero_native.upload.maximum_size=262144
arduino_zero_native.upload.use_1200bps_touch=
fals
e
arduino_zero_native.upload.wait_for_upload_port=
fals
e
arduino_zero_native.upload.use_1200bps_touch=
tru
e
arduino_zero_native.upload.wait_for_upload_port=
tru
e
arduino_zero_native.upload.native_usb=true
arduino_zero_native.build.mcu=cortex-m0plus
arduino_zero_native.build.f_cpu=48000000L
...
...
This diff is collapsed.
Click to expand it.
cores/arduino/Reset.cpp
+
17
−
1
View file @
dd50d5c4
...
...
@@ -23,12 +23,28 @@
extern
"C"
{
#endif
#define NVM_MEMORY ((volatile uint16_t *)0x000000)
#define APP_START 0x00002004
static
inline
bool
nvmReady
(
void
)
{
return
NVMCTRL
->
INTFLAG
.
reg
&
NVMCTRL_INTFLAG_READY
;
}
__attribute__
((
long_call
,
section
(
".ramfunc"
)))
static
void
banzai
()
{
// Disable all interrupts
__disable_irq
();
// Reset the device
// Erase application
while
(
!
nvmReady
())
;
NVMCTRL
->
STATUS
.
reg
|=
NVMCTRL_STATUS_MASK
;
NVMCTRL
->
ADDR
.
reg
=
(
uintptr_t
)
&
NVM_MEMORY
[
APP_START
/
4
];
NVMCTRL
->
CTRLA
.
reg
=
NVMCTRL_CTRLA_CMD_ER
|
NVMCTRL_CTRLA_CMDEX_KEY
;
while
(
!
nvmReady
())
;
// Reset the device
NVIC_SystemReset
()
;
while
(
true
);
...
...
This diff is collapsed.
Click to expand it.
cores/arduino/delay.c
+
3
−
0
View file @
dd50d5c4
...
...
@@ -58,10 +58,13 @@ void delay( uint32_t ms )
}
while
(
_ulTickCount
-
start
<=
ms
)
;
}
#include
"Reset.h"
// for tickReset()
void
SysTick_Handler
(
void
)
{
// Increment tick count each ms
_ulTickCount
++
;
tickReset
();
}
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment