Reset CPU before and after flash writing.

pull/1/head
Peter Zotov 2011-02-16 14:28:20 +03:00
rodzic 4b9486f51d
commit 32045151e9
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -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)