Open bradjc opened 3 years ago
Hi, @bradjc. Could you please provide a verbose OpenOCD log?
This can be done by either -d3
flag or debug_level 3
command.
Please, note that the log is quite large. It can be redirected to a file by -l <filename>
or log_output <filename>
FWIW I tried this against a HiFive1 Rev A01 (not Rev B) and get similar results as the original post:
openocd -c " source [find board/sifive-hifive1.cfg]; init; reset init; halt; flash fillb 0x20040000 0xff 512; exit"
Open On-Chip Debugger 0.12.0+dev-03592-g4fc0d86ff-dirty (2024-01-17-15:20)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1)
Warn : Got exception 0xffffffff when reading tinfo
Warn : Got exception 0xffffffff when reading tinfo
Info : [riscv.cpu] Found 2 triggers
halted at 0x400 due to software breakpoint
Info : Examined RISCV core; XLEN=32, misa=0x40001105
[riscv.cpu] Target successfully examined.
Info : [riscv.cpu] Examination succeed
Info : starting gdb server for riscv.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Found flash device 'issi is25lp128d' (ID 0x0018609d)
Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1)
halted at 0x400 due to software breakpoint
Info : Retrying memory read starting from 0x80000000 with more delays
Error: [riscv.cpu] Algorithm timed out after 1027 ms.
halted at 0x204000b4 due to debug interrupt
Error: [riscv.cpu] ra = 0x20400102
Error: [riscv.cpu] sp = 0x68ccc1f8
Error: [riscv.cpu] gp = 0x8000096c
Error: [riscv.cpu] tp = 0x0
Error: [riscv.cpu] t0 = 0x80000370
Error: [riscv.cpu] t1 = 0x80000370
Error: [riscv.cpu] t2 = 0x204000b4
Error: [riscv.cpu] fp = 0x80000028
Error: [riscv.cpu] s1 = 0x0
Error: [riscv.cpu] a0 = 0x1
Error: [riscv.cpu] a1 = 0xe7f7b2
Error: [riscv.cpu] a2 = 0x80000028
Error: [riscv.cpu] a3 = 0x800000d8
Error: [riscv.cpu] a4 = 0x8000016c
Error: [riscv.cpu] a5 = 0xe7f7b3
Error: [riscv.cpu] a6 = 0x200c000
Error: [riscv.cpu] a7 = 0x7ffffffb
Error: [riscv.cpu] s2 = 0x0
Error: [riscv.cpu] s3 = 0x0
Error: [riscv.cpu] s4 = 0x0
Error: [riscv.cpu] s5 = 0x0
Error: [riscv.cpu] s6 = 0x0
Error: [riscv.cpu] s7 = 0x0
Error: [riscv.cpu] s8 = 0x0
Error: [riscv.cpu] s9 = 0x0
Error: [riscv.cpu] s10 = 0x0
Error: [riscv.cpu] s11 = 0x0
Error: [riscv.cpu] t3 = 0x0
Error: [riscv.cpu] t4 = 0x0
Error: [riscv.cpu] t5 = 0x0
Error: [riscv.cpu] t6 = 0x0
Error: [riscv.cpu] pc = 0x204000b4
Error: [riscv.cpu] mstatus = 0x1800
Error: [riscv.cpu] mepc = 0x204000b6
Error: [riscv.cpu] mcause = 0x7
Error: Failed to execute algorithm at 0x80000000: -302
Error: error writing to flash at address 0x20000000 at offset 0x00040000
Here is the zipped verbose log: openocd.zip
I haven't looked at it in detail yet.
Isn't the address 0x2004_0000
used in the original post incorrect?
Shouldn't it be 0x2040_0000
?
See here for example:
However, even if I use 0x2040_0000
I still get the same behaviour so there's still some issue even if the correct (?) flash address is used:
openocd -c " source [find board/sifive-hifive1.cfg]; init; reset init; halt; flash fillb 0x20400000 0xff 512; exit"
Open On-Chip Debugger 0.12.0+dev-03592-g4fc0d86ff-dirty (2024-01-17-15:20)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1)
Warn : Got exception 0xffffffff when reading tinfo
Warn : Got exception 0xffffffff when reading tinfo
Info : [riscv.cpu] Found 2 triggers
halted at 0x204000b4 due to debug interrupt
Info : Examined RISCV core; XLEN=32, misa=0x40001105
[riscv.cpu] Target successfully examined.
Info : [riscv.cpu] Examination succeed
Info : starting gdb server for riscv.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Found flash device 'issi is25lp128d' (ID 0x0018609d)
Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive Inc), part: 0x0e31, ver: 0x1)
halted at 0x400 due to software breakpoint
Info : Retrying memory read starting from 0x80000000 with more delays
Error: [riscv.cpu] Algorithm timed out after 1027 ms.
halted at 0x204000b4 due to debug interrupt
Error: [riscv.cpu] ra = 0x20400102
Error: [riscv.cpu] sp = 0x254d39f8
Error: [riscv.cpu] gp = 0x8000096c
Error: [riscv.cpu] tp = 0x0
Error: [riscv.cpu] t0 = 0x80000370
Error: [riscv.cpu] t1 = 0x80000370
Error: [riscv.cpu] t2 = 0x204000b4
Error: [riscv.cpu] fp = 0x4000f063
Error: [riscv.cpu] s1 = 0x0
Error: [riscv.cpu] a0 = 0x10014000
Error: [riscv.cpu] a1 = 0x100
Error: [riscv.cpu] a2 = 0x8000031c
Error: [riscv.cpu] a3 = 0x400000
Error: [riscv.cpu] a4 = 0x200
Error: [riscv.cpu] a5 = 0x2
Error: [riscv.cpu] a6 = 0x200c000
Error: [riscv.cpu] a7 = 0x7fffeffb
Error: [riscv.cpu] s2 = 0x0
Error: [riscv.cpu] s3 = 0x0
Error: [riscv.cpu] s4 = 0x0
Error: [riscv.cpu] s5 = 0x0
Error: [riscv.cpu] s6 = 0x0
Error: [riscv.cpu] s7 = 0x0
Error: [riscv.cpu] s8 = 0x0
Error: [riscv.cpu] s9 = 0x0
Error: [riscv.cpu] s10 = 0x0
Error: [riscv.cpu] s11 = 0x0
Error: [riscv.cpu] t3 = 0x0
Error: [riscv.cpu] t4 = 0x0
Error: [riscv.cpu] t5 = 0x0
Error: [riscv.cpu] t6 = 0x0
Error: [riscv.cpu] pc = 0x204000b4
Error: [riscv.cpu] mstatus = 0x1800
Error: [riscv.cpu] mepc = 0x204000b6
Error: [riscv.cpu] mcause = 0x7
Error: Failed to execute algorithm at 0x80000000: -302
Error: error writing to flash at address 0x20000000 at offset 0x00400000
Edit: or are the "user" flash base addresses different for HiFive1 Rev A01 (0x204_0000
) and HiFive1 Rev B (0x2004_0000
)?
Edit 2: Ok - the original HiFive1 (e.g. Rev A01) and Rev B do seem to have different memory maps:
The HiFive1 and HiFive1 Rev B have different memory maps. On the HiFive1, the boot program is at 0x20000000 and the user program is at 0x20400000. On the HiFive1 Rev B, the boot program is at 0x20000000 and the user program is at 0x20010000. See the appropriate getting started guides.
I'm running into the following error when using the
fillb
command:I'm on macOS 10.14.6 (intel) and
which I installed via brew.
I tried installing openocd via
brew install --HEAD openocd
but that gave me an error, and I also tried building this repo but ran into too many compilation errors before I gave up. So it's entirely possible this is fixed in later versions and I will wait until I can get one of those to work, but I wanted to check in case this is a more obscure command that isn't used much.