kopia lustrzana https://github.com/stlink-org/stlink
Reset CPU before and after flash writing.
rodzic
4b9486f51d
commit
32045151e9
|
@ -223,6 +223,9 @@ static int flash_populate(stm32_addr_t addr, uint8_t* data, unsigned length) {
|
|||
static int flash_go(struct stlink* sl) {
|
||||
int error = -1;
|
||||
|
||||
// Some kinds of clock settings do not allow writing to flash.
|
||||
stlink_reset(sl);
|
||||
|
||||
for(struct flash_block* fb = flash_root; fb; fb = fb->next) {
|
||||
#ifdef DEBUG
|
||||
printf("flash_do: block %08x -> %04x\n", fb->addr, fb->length);
|
||||
|
@ -236,6 +239,8 @@ static int flash_go(struct stlink* sl) {
|
|||
}
|
||||
}
|
||||
|
||||
stlink_reset(sl);
|
||||
|
||||
error = 0;
|
||||
|
||||
error:
|
||||
|
@ -451,8 +456,6 @@ int serve(struct stlink* sl, int port) {
|
|||
} else {
|
||||
reply = strdup("OK");
|
||||
}
|
||||
|
||||
stlink_reset(sl);
|
||||
}
|
||||
|
||||
if(reply == NULL)
|
||||
|
|
Ładowanie…
Reference in New Issue