Debugging HiFive1b with Visual Studio and VisualGDB


I’m hoping someone can help me here.

I’m building a HiFive1b project with Visual Studio using the VisualGDB plugin under Windows 10.

I’m trying with 2 toolchains. One from the VisualGDB plugin and one from Freedom Studio.

My project runs fine on the RiscvOVPSim emulator when built with either toolchain.

I’m connecting to the HiFive1b with Segger’s GDBServer v6.44g.

I’m setting the flash address in my linker script to 0x20400000. I’ve also tried 0x20010000.

I can download my code to the HiFive1b and examine the code in flash.

However, when I try to step through, the debugger is stepping through the flashing led program which the HiFive1b runs after boot.

Is it simply my linker script is wrong?

Next I’ll try looking for Hifive1b linker scripts and also look at Freedom Metal.

Any suggestions would be welcome.


Your program was not written into the boards flash. It is running the led program because that is what is stored in its flash.