diff options
author | Gleb Gagarin <gleb@sifive.com> | 2018-02-23 16:41:14 -0800 |
---|---|---|
committer | Gleb Gagarin <gleb@sifive.com> | 2018-02-23 16:41:14 -0800 |
commit | fb7009fc38eff2f169385589e0f71ca4f9626cb2 (patch) | |
tree | 7f1343ff8879033c47a47eec5a2abd813bd90596 | |
parent | e09dd62229bd2c152bf403e601aa098e29aaa850 (diff) | |
download | riscv-openocd-compliance_dev.zip riscv-openocd-compliance_dev.tar.gz riscv-openocd-compliance_dev.tar.bz2 |
Make some error messages to be printed oncecompliance_dev
-rw-r--r-- | src/target/riscv/riscv-013.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 2387188..0879d51 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -383,7 +383,11 @@ static dmi_status_t dmi_scan(struct target *target, uint16_t *address_in, int retval = jtag_execute_queue(); if (retval != ERROR_OK) { - LOG_INFO("dmi_scan failed jtag scan"); + static int once = 1; + if (once) { + LOG_ERROR("dmi_scan failed jtag scan"); + once = 0; + } return DMI_STATUS_FAILED; } @@ -418,13 +422,22 @@ static uint32_t dmi_read(struct target *target, uint16_t address) } else if (status == DMI_STATUS_SUCCESS) { break; } else { - LOG_INFO("failed read from 0x%x, status=%d", address, status); + static int once = 1; + if (once) { + LOG_ERROR("failed read from 0x%x, status=%d", address, status); + once = 0; + } break; } + usleep(100000); } if (status != DMI_STATUS_SUCCESS) { - LOG_INFO("Failed read from 0x%x; status=%d", address, status); + static int once = 1; + if (once) { + LOG_INFO("Failed read from 0x%x; status=%d", address, status); + once = 0; + } return ~0; } |