stm32h7: Don't tc_printf from flash functions (#747)

* stm32h7: Don't tc_printf from flash functions

Receving an 'O' packet while flashing confuses GDB and then
weird stuff happens.

* Replace tc_printf with DEBUG_WARN
This commit is contained in:
Gareth McMullin 2020-10-05 01:45:18 -07:00 committed by GitHub
parent 9bba3165fb
commit dc8924a2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -250,10 +250,10 @@ static bool stm32h7_flash_unlock(target *t, uint32_t addr)
if(target_check_error(t))
return false;
}
uint32_t sr = target_mem_read32(t, regbase + FLASH_SR);
if (sr & FLASH_SR_ERROR_MASK) {
tc_printf(t, "Error 0x%08lx", sr & FLASH_SR_ERROR_MASK);
target_mem_write32(t, regbase + FLASH_CCR, sr & FLASH_SR_ERROR_MASK);
uint32_t sr = target_mem_read32(t, regbase + FLASH_SR) & FLASH_SR_ERROR_MASK;
if (sr) {
DEBUG_WARN("%s error 0x%08" PRIx32, __func__, sr);
target_mem_write32(t, regbase + FLASH_CCR, sr);
return false;
}
if (target_mem_read32(t, regbase + FLASH_CR) & FLASH_CR_LOCK) {