Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
card10
openocd
Commits
8817de52
Commit
8817de52
authored
Dec 20, 2018
by
Kevin Gillespie
Committed by
Kevin
Apr 17, 2019
Browse files
Making sure algorithm runs and pads with 0xFF.
Change-Id: I188af7676395993d4800549b511af77f9c5086b1
parent
8f39fafb
Changes
1
Show whitespace changes
Inline
Side-by-side
src/flash/nor/max32xxx.c
View file @
8817de52
...
...
@@ -397,10 +397,6 @@ static int max32xxx_write_block(struct flash_bank *bank, const uint8_t *buffer,
/* power of two, and multiple of word size */
static
const
unsigned
buf_min
=
128
;
/* for small buffers it's faster not to download an algorithm */
if
(
wcount
*
4
<
buf_min
)
return
ERROR_TARGET_RESOURCE_NOT_AVAILABLE
;
LOG_DEBUG
(
"(bank=%p buffer=%p offset=%08"
PRIx32
" wcount=%08"
PRIx32
""
,
bank
,
buffer
,
offset
,
wcount
);
...
...
@@ -518,13 +514,19 @@ static int max32xxx_write(struct flash_bank *bank, const uint8_t *buffer,
/* 128-bit align the words_remaining */
words_remaining
=
remaining
/
4
;
words_remaining
-=
words_remaining
%
4
;
/* Algorithm will pad with 0xFF */
// words_remaining -= words_remaining % 4;
retval
=
max32xxx_write_block
(
bank
,
buffer
,
offset
,
words_remaining
);
if
(
retval
!=
ERROR_OK
)
{
if
(
retval
==
ERROR_TARGET_RESOURCE_NOT_AVAILABLE
)
if
(
retval
==
ERROR_TARGET_RESOURCE_NOT_AVAILABLE
)
{
if
(
info
->
options
&
OPTIONS_ENC
)
{
LOG_ERROR
(
"Must use algorithm in working area for encryption"
);
return
ERROR_FLASH_OPERATION_FAILED
;
}
LOG_DEBUG
(
"writing flash word-at-a-time"
);
else
{
}
else
{
max32xxx_flash_op_post
(
bank
);
return
ERROR_FLASH_OPERATION_FAILED
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment