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
eb014da3
Commit
eb014da3
authored
10 years ago
by
Cristian Maglie
Committed by
Cristian Maglie
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Bootloader: added a command to calculate checksum of blocks of memory
parent
6c53bbe4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bootloaders/zero/sam_ba_monitor.c
+23
-4
23 additions, 4 deletions
bootloaders/zero/sam_ba_monitor.c
bootloaders/zero/samd21_sam_ba.bin
+0
-0
0 additions, 0 deletions
bootloaders/zero/samd21_sam_ba.bin
with
23 additions
and
4 deletions
bootloaders/zero/sam_ba_monitor.c
+
23
−
4
View file @
eb014da3
...
...
@@ -36,7 +36,7 @@
#include
"cdc_enumerate.h"
const
char
RomBOOT_Version
[]
=
SAM_BA_VERSION
;
const
char
RomBOOT_ExtendedCapabilities
[]
=
"[Arduino:XY]"
;
const
char
RomBOOT_ExtendedCapabilities
[]
=
"[Arduino:XY
Z
]"
;
/* Provides one common interface to handle both USART and USB-CDC */
typedef
struct
...
...
@@ -186,9 +186,8 @@ void sam_ba_monitor_run(void)
}
}
#if 0
// Prints a 32-bit integer in hex.
void p
r
int
n
(uint32_t n) {
void
p
ut_u
int
32
(
uint32_t
n
)
{
char
buff
[
8
];
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
...
...
@@ -199,7 +198,6 @@ void printn(uint32_t n) {
}
ptr_monitor_if
->
putdata
(
buff
,
8
);
}
#endif
void
sam_ba_monitor_loop
(
void
)
{
...
...
@@ -393,6 +391,27 @@ void sam_ba_monitor_loop(void)
// Notify command completed
ptr_monitor_if
->
putdata
(
"Y
\n\r
"
,
3
);
}
else
if
(
command
==
'Z'
)
{
// This command calculate CRC for a given area of memory.
// It's useful to quickly check if a transfer has been done
// successfully.
// Syntax: Z[START_ADDR],[SIZE]#
// Returns: Z[CRC]#
uint8_t
*
data
=
(
uint8_t
*
)
ptr_data
;
uint32_t
size
=
current_number
;
uint16_t
crc
=
0
;
uint32_t
i
=
0
;
for
(
i
=
0
;
i
<
size
;
i
++
)
crc
=
add_crc
(
*
data
++
,
crc
);
// Send response
ptr_monitor_if
->
putdata
(
"Z"
,
1
);
put_uint32
(
crc
);
ptr_monitor_if
->
putdata
(
"#
\n\r
"
,
3
);
}
command
=
'z'
;
current_number
=
0
;
...
...
This diff is collapsed.
Click to expand it.
bootloaders/zero/samd21_sam_ba.bin
+
0
−
0
View file @
eb014da3
No preview for this file type
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