projects
/
fw
/
stlink
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a TODO to check for Supply Voltage before setting F4 paralleisme to 32 bits
[fw/stlink]
/
src
/
stlink-common.c
diff --git
a/src/stlink-common.c
b/src/stlink-common.c
index 8493c4ce2858af0e4fbeadaababeda7e53b016e4..5a51314240eceab6d68bf2d4144f4fd1c6b7aecf 100644
(file)
--- a/
src/stlink-common.c
+++ b/
src/stlink-common.c
@@
-812,6
+812,12
@@
int stlink_fread(stlink_t* sl, const char* path, stm32_addr_t addr, size_t size)
return -1;
}
return -1;
}
+ if (size <1)
+ size = sl->flash_size;
+
+ if (size > sl->flash_size)
+ size = sl->flash_size;
+
/* do the copy by 1k blocks */
for (off = 0; off < size; off += 1024) {
size_t read_size = 1024;
/* do the copy by 1k blocks */
for (off = 0; off < size; off += 1024) {
size_t read_size = 1024;
@@
-1239,6
+1245,7
@@
int stlink_write_flash(stlink_t *sl, stm32_addr_t addr, uint8_t* base, unsigned
/* First unlock the cr */
unlock_flash_if(sl);
/* First unlock the cr */
unlock_flash_if(sl);
+ /* TODO: Check that Voltage range is 2.7 - 3.6 V */
/* set parallelisim to 32 bit*/
write_flash_cr_psiz(sl, 2);
/* set parallelisim to 32 bit*/
write_flash_cr_psiz(sl, 2);