# Debugging HiFive1b with Visual Studio and VisualGDB

**URL:** https://forums.sifive.com/t/debugging-hifive1b-with-visual-studio-and-visualgdb/2358
**Category:** HiFive1 Rev B
**Created:** [May 22, 2019, 12:37pm UTC](https://forums.sifive.com/t/debugging-hifive1b-with-visual-studio-and-visualgdb/2358 "2019-05-22T12:37:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Andy](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Andy](https://forums.sifive.com/u/Andy)
#### Post date: [May 22, 2019, 12:37pm UTC](https://forums.sifive.com/t/debugging-hifive1b-with-visual-studio-and-visualgdb/2358/1 "2019-05-22T12:37:00Z")

</div>

Hi.

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.

Thanks  
Andy

---

<div class="post-metadata">

### Author: ![bwooster0](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@bwooster0](https://forums.sifive.com/u/bwooster0)
#### Post date: [April 22, 2020, 1:30am UTC](https://forums.sifive.com/t/debugging-hifive1b-with-visual-studio-and-visualgdb/2358/2 "2020-04-22T01:30:59Z")

</div>

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