Fix #145
Don't tc_printf in the probe. tc_printf fixed to not crash of no controller connected.
This commit is contained in:
parent
df7ad91692
commit
ca364a889e
|
@ -165,7 +165,6 @@ bool stm32f1_probe(target *t)
|
||||||
}
|
}
|
||||||
|
|
||||||
flash_size = (target_mem_read32(t, FLASHSIZE_F0) & 0xffff) *0x400;
|
flash_size = (target_mem_read32(t, FLASHSIZE_F0) & 0xffff) *0x400;
|
||||||
tc_printf(t, "flash size %d block_size %d\n", flash_size, block_size);
|
|
||||||
target_add_ram(t, 0x20000000, 0x5000);
|
target_add_ram(t, 0x20000000, 0x5000);
|
||||||
stm32f1_add_flash(t, 0x8000000, flash_size, block_size);
|
stm32f1_add_flash(t, 0x8000000, flash_size, block_size);
|
||||||
target_add_commands(t, stm32f1_cmd_list, "STM32F0");
|
target_add_commands(t, stm32f1_cmd_list, "STM32F0");
|
||||||
|
|
|
@ -446,6 +446,10 @@ void tc_printf(target *t, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
(void)t;
|
(void)t;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
if (t->tc == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
t->tc->printf(t->tc, fmt, ap);
|
t->tc->printf(t->tc, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
Loading…
Reference in New Issue