Does the debugger work?

(Ty) #1

I’m trying to get the debugger to work in Freedom Studio and I thought I’d double check that someone else has done it.

I can build the hello world and upload it. I can even modify it and print out a loop of numbers ok. When I set a breakpoint and try to debug it I get this:

Comparing flash […] Done.
Verifying flash […] Done.
Writing register (PC = 0x20010000)
Reading 64 bytes @ address 0x20010180
Read 4 bytes @ address 0x20010188 (Data = 0x2001E7B7)
Read 2 bytes @ address 0x200101A6 (Data = 0x2783)
Received monitor command: clrbp
Received monitor command: reset
ERROR: Timeout while waiting for core to halt after reset and halt request
Resetting target
Received monitor command: halt
Halting target CPU…
…Target halted (PC = 0x200002DC)
Read 4 bytes @ address 0x20010188 (Data = 0x2001E7B7)
Received monitor command: regs
X0 = 00000000, X1 = 2000010E, X2 = 80003FE0, X3 = 80000D80
X4 = 00000000, X5 = 00000000, X6 = 00000000, X7 = 800005D0
X8 = 00000000, X9 = 02000080, X10= 00000111, X11= 00000000
X12= 00000B6B, X13= 00000000, X14= 00004111, X15= 00000000
X16= BED0BED0, X17= 0200C000, X18= 02000080, X19= 00000000
X20= 00000000, X21= 00000000, X22= 00000000, X23= 00000000
X24= 00000000, X25= 00000000, X26= 00000000, X27= 00000000
X28= 80000170, X29= 00000000, X30= 00000000, X31= 00000000
PC = 200002DC
Reading register (PC = 0x200002DC)
Setting breakpoint @ address 0x20010188, Size = 4, BPHandle = 0x0000
WARNING: No more breakpoint resources left
ERROR: Failed to set breakpoint at 0x20010188
Setting breakpoint @ address 0x200101A6, Size = 2, BPHandle = 0x0000
WARNING: No more breakpoint resources left
ERROR: Failed to set breakpoint at 0x200101A6
WARNING: Failed to read memory @ address 0x00000000

It seems to be telling me there are no hardware breakpoints but I only set 1 of them. Any suggestions on how to troubleshoot this; or try it from the command line, would be greatly appreciated.



have you got the debugger up and running in Freedom Studio?
I am struggling myself to get breakpoints working…

After I press the debugging button, the code is beeing uploaded, and the debugger seems to halt at entering main() (seen in breakpoint view).
But there is no button to step into the programm.
I even have to hit the onboard reset button to get my code running…
Setting my own breakpoint seems to have no effect at all.

Any suggestions? The lack of documentation is frustrating…

kind regards

(Ty) #3

I’m afraid I have not been able to get this working and I don’t know enough about command line debugging to try anything else. I think that this kit might be a pit of frustration for beginners like me so I have decided to leave it gather dust for a little while, then come back to it when I’ve recovered my patience. :cry:

It could also be that this stuff doesn’t really work… Perhaps SiFive could invest a few hours in a YouTube video walking through setup on a newly installed system and getting to debugging a program.



Basic debugging seems to be working now for me.
If you want to try again, you could try to set the number of HW break points explicitly.
There are a few ways described in this manual:

For initial testing, I set “set remote hardware-breakpoint-limit 2” in the debug configuration.
This works for me.
4 breakpoints should be possible, at least this is what the device tree file indicates, but it does not work for me. (same error you got)
I also had to shut off all the options under “Startup -> Run/Restart Commands” (just untick all boxes)

Soooo, I only get two break points, better than no breakpoints at all I guess ¯_(ツ)_/¯