Skip to content

Commit

Permalink
Merge pull request #93 from richardeoin/stm_bugfix
Browse files Browse the repository at this point in the history
[Bugfix] stm32f1_probe would always return true, breaking support for…
  • Loading branch information
gsmcmullin committed Jul 31, 2015
2 parents 762e540 + beacf9c commit e4bb1e8
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/stm32f1.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,16 @@ bool stm32f1_probe(target *t)
t->driver = "STM32F09";
block_size = 0x800;
break;
}
if (t->driver) {
flash_size = (target_mem_read32(t, FLASHSIZE_F0) & 0xffff) *0x400;
gdb_outf("flash size %d block_size %d\n", flash_size, block_size);
target_add_ram(t, 0x20000000, 0x5000);
stm32f1_add_flash(t, 0x8000000, flash_size, block_size);
target_add_commands(t, stm32f1_cmd_list, "STM32F0");
return true;
default: /* NONE */
return false;
}

return false;
flash_size = (target_mem_read32(t, FLASHSIZE_F0) & 0xffff) *0x400;
gdb_outf("flash size %d block_size %d\n", flash_size, block_size);
target_add_ram(t, 0x20000000, 0x5000);
stm32f1_add_flash(t, 0x8000000, flash_size, block_size);
target_add_commands(t, stm32f1_cmd_list, "STM32F0");
return true;
}

static void stm32f1_flash_unlock(target *t)
Expand Down Expand Up @@ -353,4 +352,3 @@ static bool stm32f1_cmd_option(target *t, int argc, char *argv[])
}
return true;
}

0 comments on commit e4bb1e8

Please sign in to comment.