I use the OpenOCD to debug my kernel. The OpenOCD connect to board succeed, I target remote my board, Then use ‘file kernel.elf’, OpenOCD get the error messages:
Info : accepting 'gdb' connection on tcp/3333
Info : New GDB Connection: 1, Target riscv.cpu, state: halted
Warn : Prefer GDB command "target extended-remote 3333" instead of "target remote 3333"
Warn : Failed to read memory via program buffer.
Warn : Failed to read memory via abstract access.
Error: Target riscv.cpu: Failed to read memory (addr=0x49883ae0ce8bfd4e)
Error: progbuf=failed, sysbus=skipped (unsupported size), abstract=failed
Error: Target riscv.cpu: Failed to read memory (addr=0x49883ae0ce8bfd4e)
Error: progbuf=failed, sysbus=skipped (unsupported size), abstract=failed
I find the issue:
And this issue had been solved by OpenOCD:
It seems that SiFive OpenOCD didn’t merge this branch, this issue repaired on Dec 15, 2020. SiFive OpenOCD only provide the bin file, the last time is on Dec 1, 2020.
The problem you’re experiencing might be caused by the issue you identified, but we can’t be certain. We don’t have a newer version of OpenOCD available publicly, so we suggest rebuilding OpenOCD yourself from the following repo: