Don't tc_printf in the probe.
tc_printf fixed to not crash of no controller connected.
This commit is contained in:
Gareth McMullin 2016-08-22 09:56:24 +12:00
parent df7ad91692
commit ca364a889e
2 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,6 @@ bool stm32f1_probe(target *t)
}
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);
stm32f1_add_flash(t, 0x8000000, flash_size, block_size);
target_add_commands(t, stm32f1_cmd_list, "STM32F0");

View File

@ -446,6 +446,10 @@ void tc_printf(target *t, const char *fmt, ...)
{
(void)t;
va_list ap;
if (t->tc == NULL)
return;
va_start(ap, fmt);
t->tc->printf(t->tc, fmt, ap);
va_end(ap);