I had a debugging model of following:
gdb <--> jlinkgdbserver <--> jlink <--> RISCV board
when I issue "monitor regs" from gdb, I got ARM regsters set:
(gdb) monitor regs
X0 = 00000000, X1 = 7001CA5A, X2 = 7001F6B0, X3 = 22400150
X4 = 405D3080, X5 = 64000038, X6 = 00000025, X7 = 64000030
X8 = 0014112D, X9 = 00000001, X10= 7001D062, X11= 00000000
X12= 00000000, X13= 00000000, X14= 00000000, X15= 64000000
X16= 7001D490, X17= 00000015, X18= 00000002, X19= 00000003
X20= 00000003, X21= 00000002, X22= 00000001, X23= 64000020
X24= 64000018, X25= 0C006200, X26= 10459C04, X27= 00242120
X28= 00000009, X29= 00000000, X30= 00000000, X31= 64000040
PC = 7001CA5A
and log from JlinkGDBserver
Received monitor command: regs
X0 = 00000000, X1 = 7001CA5A, X2 = 7001F6B0, X3 = 22400150
X4 = 405D3080, X5 = 64000038, X6 = 00000025, X7 = 64000030
X8 = 0014112D, X9 = 00000001, X10= 7001D062, X11= 00000000
X12= 00000000, X13= 00000000, X14= 00000000, X15= 64000000
X16= 7001D490, X17= 00000015, X18= 00000002, X19= 00000003
X20= 00000003, X21= 00000002, X22= 00000001, X23= 64000020
X24= 64000018, X25= 0C006200, X26= 10459C04, X27= 00242120
X28= 00000009, X29= 00000000, X30= 00000000, X31= 64000040
PC = 7001CA5A
if I did it from JLink prompt:
J-Link>regs
pc = 000000007001DE5C sp = 000000007001FB70 ra = 000000007001E048
gp = C96B449222400910 tp = 6801201A404DA080 fp = 0000000000000001
t0 = 0000000000006000 t1 = 0000000000000025 t2 = 00000000000000FF
t3 = 0000000000000009 t4 = 0000000000000000 t5 = 0000000000000000 t6 = 0000000070001000
a0 = 000000007001FBA0 a1 = 0000000000000003 a2 = 0000000000000000 a3 = 000000007001D630
a4 = 0000000000000000 a5 = 000000007001D590 a6 = 000000007001FBC0 a7 = 0000000000000015
s1 = 0000000000000002 s2 = 0000000000000003 s3 = 1E85121402203004 s4 = 09A92352240C6800
s5 = 0021202000817A20 s6 = 980C0921920840F2 s7 = 4F50044898000060 s8 = 4A08101182132801
s9 = 5125CF320C004200 s10 = 2426400010419804 s11 = D005488200242121
Here are the command line and configurations that I used to bring up these tools:
/usr/bin/JLinkExe -device RV64 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1 -Log ~/jlink.log
/usr/bin/JLinkGDBServerCLExe -select USB -device FE310 -endian little -if JTAG -speed 40
So, what went wrong ?
gdb <--> jlinkgdbserver <--> jlink <--> RISCV board
when I issue "monitor regs" from gdb, I got ARM regsters set:
(gdb) monitor regs
X0 = 00000000, X1 = 7001CA5A, X2 = 7001F6B0, X3 = 22400150
X4 = 405D3080, X5 = 64000038, X6 = 00000025, X7 = 64000030
X8 = 0014112D, X9 = 00000001, X10= 7001D062, X11= 00000000
X12= 00000000, X13= 00000000, X14= 00000000, X15= 64000000
X16= 7001D490, X17= 00000015, X18= 00000002, X19= 00000003
X20= 00000003, X21= 00000002, X22= 00000001, X23= 64000020
X24= 64000018, X25= 0C006200, X26= 10459C04, X27= 00242120
X28= 00000009, X29= 00000000, X30= 00000000, X31= 64000040
PC = 7001CA5A
and log from JlinkGDBserver
Received monitor command: regs
X0 = 00000000, X1 = 7001CA5A, X2 = 7001F6B0, X3 = 22400150
X4 = 405D3080, X5 = 64000038, X6 = 00000025, X7 = 64000030
X8 = 0014112D, X9 = 00000001, X10= 7001D062, X11= 00000000
X12= 00000000, X13= 00000000, X14= 00000000, X15= 64000000
X16= 7001D490, X17= 00000015, X18= 00000002, X19= 00000003
X20= 00000003, X21= 00000002, X22= 00000001, X23= 64000020
X24= 64000018, X25= 0C006200, X26= 10459C04, X27= 00242120
X28= 00000009, X29= 00000000, X30= 00000000, X31= 64000040
PC = 7001CA5A
if I did it from JLink prompt:
J-Link>regs
pc = 000000007001DE5C sp = 000000007001FB70 ra = 000000007001E048
gp = C96B449222400910 tp = 6801201A404DA080 fp = 0000000000000001
t0 = 0000000000006000 t1 = 0000000000000025 t2 = 00000000000000FF
t3 = 0000000000000009 t4 = 0000000000000000 t5 = 0000000000000000 t6 = 0000000070001000
a0 = 000000007001FBA0 a1 = 0000000000000003 a2 = 0000000000000000 a3 = 000000007001D630
a4 = 0000000000000000 a5 = 000000007001D590 a6 = 000000007001FBC0 a7 = 0000000000000015
s1 = 0000000000000002 s2 = 0000000000000003 s3 = 1E85121402203004 s4 = 09A92352240C6800
s5 = 0021202000817A20 s6 = 980C0921920840F2 s7 = 4F50044898000060 s8 = 4A08101182132801
s9 = 5125CF320C004200 s10 = 2426400010419804 s11 = D005488200242121
Here are the command line and configurations that I used to bring up these tools:
/usr/bin/JLinkExe -device RV64 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1 -Log ~/jlink.log
/usr/bin/JLinkGDBServerCLExe -select USB -device FE310 -endian little -if JTAG -speed 40
So, what went wrong ?