VisualStudio and VisualGDB setup for Daisy

Several of the examples in DaisyExamples (not all of them yet) have solution files for VS that use visual studio and vgdb. They already have references to the two daisy libraries set up.

There is a handy python script in the utility folder for copying/renaming an entire project as a starting point for a new one.

We’ll add some additional documentation for using daisy with VS/VGDB and other IDEs very soon!

4 Likes

Thanks! I will check those out and give it a try.

I just cloned the repo and tried to build some of the samples with VS2019 and VGDB. Questions: which toolchain do I use; the custom one documented in “getting started”, or will the regular ARM toolchain work? None of the samples will build with either, because the libdaisy build fails. I keep getting build errors related to per_i2c.h. It looks like it is treating that file or something it depends on as a C file rather than a C++ file (causes “unknown type name ‘namespace’” error). I have set the file type prop to C/C++ Header, but no dice. I looked at the repo comments and it looks like i2c support was removed but perhaps someone did not check in their config changes along with the code changes. And then what about debugging? Does the Daisy include onboard debugging or do I need to use JTAG or similar? It would be great if you could create a guide to getting set up with VS and VGDB, given that it is probably the best toolchain out there. I am also using VSCode to get by, but having to treat the device as a black box is… well frustrating. Not even sure how to get console output from the device with VSCode. If anyone has gotten VSCode set up, either with PlatformIO or not, it would be great to get that documented too. I am super eager to get over the setup hump and into creating some digital instruments!

There’s a fairly detailed guide about setting up debugger on Windows. If you don’t have a hardware debugger, you should probably get ST-link v3 mini.

Has anyone had more luck with this?
The VGDB settings and project dependencies aren’t working for my VS/VGDB install.
The hal_conf file can’t be found, so theres clearly some include path thats not worked out for me in these projects :confused:

Similar issues here.

What version of Visual Studio should we be using? I have VS2019 Community Edition with the VisualGDB trial but just can’t seem to get the solutions to compile.

The GNU toolchain is working fine by command line, but ideally I’d love to be able to work in VS (and use the ST-Link Mini).

Also which edition of VisualGDB do we need? My trial version will be expiring before too much longer so I’ll need to get a licence.

I have not had a chance to go back and update the VS/VGDB projects since the folder-reorganization for libdaisy (So sorry about that, could be part of your troubles getting it to compile). I’m hoping to get to that this week (I’ve been giving VS Code a try for the last few weeks).

To answer the other questions I have VS2019, and you there is a bundled gcc that works fine with VisualGDB, or you can just point the toolchain to the one you have downloaded/installed for command line.

As for the version, the ‘Embedded’ will do fine for most things, there is a breakdown of additional features on their site.

Once I get the vcxproj files updates I’ll see about adding a basic template project to the DaisyExamples Repo that can be easily copied as a starting point.

1 Like

Ahh that sounds like it could be the culprit! I hunted down the missing file and added it into the project but then another (and another, and another…) file raised an error.

I eventually decided I must have been doing something wrong and stopped. :laughing:

Thanks for the info!

Haha, yeah it probably had out-dated names/locations for all of the files.

If you feel like trying again before I have a chance to update what’s on git you could probably just remove all of the src/ files from the project, and then just re-add everything in (except for the wm8731 and pcm3060 drivers as those won’t properly build until audio is rewritten in C++). Everything in Middleware and Drivers can stay as-is.

Otherwise, I’ll try to get to this some time this week.

1 Like

I have been struggling with the DaisyExamples for weeks trying to get it building in VS. Every time I seem to make progress I run into more issues. I am getting “no input files” and multiple missing file errors when attempting to build libdaisy. I strongly encourage you to either get the examples in a state that developers can just clone them, install VGDB and get going, or create a “starter project”. I am a professional software engineer (though with no real embedded development experience), and I want to get on with building some cool apps for Daisy, NOT muck about trying to get the projects to build. Love the Daisy, but I am getting a little frustrated with the poor state of your developer “onboarding”. I really really do suggest that you create some “official” guides for setting up both VSCode (including PIO) and VS/VGDB, and specifically getting debuggers working (I have a Segger EDU, which I have not been able to get working properly with the Daisy and either of the M$ IDEs). There are some guides in the forums but they are far from complete. I think this will go a long way to creating a healthy developer ecosystem around the Daisy, which I sure is what you want. Also… MicroPython, MSP, PD!

1 Like

But the Kickstarter looked good.

Did you run through this howto guide?
I assume you can replace the stlink with the segger definition and get it going. I managed to get debug running this way on both PC and mac (though its not nearly as pretty as VGDB).

Sorry to hear about your frustration. I should be able to get to patching the broken vs project file in libdaisy today.

And you make a good point about IDE/debugging resources. We’ll get to work on creating some official guides for what seems like the most common debug methods being used so far (vs+vgdb, vscode, etc.).

Re. Visual Studio Project woes – I just merged a fix that fixes all of the missing files/references, etc. in libdaisy (and also some weird stuff in DaisySP). I also cleaned added filters to match the folder structure to make it a little more manageable.

For testing purposes I cleaned up the Keyboard Test example a little and used that to test. So if you want to verify things are installed set up correctly, I suggest opening the field/KeyboardTest/KeyboardTest.sln and trying to build there.

If you see a BSP migration notice you can Download/Migrate to the latest (2020.06), though anything arm-none-eabi 2019 or newer should work

For starting your own project there is a utility script in DaisyExamples called copy_project.py that can be used to copy and rename a project (including all of the contents/paths in the vsx project files). We will be adding a few ‘template’ projects and a utility for generating new projects from those.

As I mentioned earlier, we’ll be working on putting together some resources for working with Visual Studio, and also with VS Code in the coming weeks.

3 Likes

Thanks for sorting that out @shensley !
I’ve got my Seed up and running in VGDB via your updated HWTest project, and I have even run with the VGDB fast semihosting!

I’d like to try and replicate a project setup ‘from scratch’ for understanding, but will start with your copying utility script.

I managed to make a fresh VGDB Daisy Seed project from scratch, so I will make a Blog tutorial and share here.

1 Like

Step-by-step can be found here
I will try to clean it up, but there is enough there to get started.

4 Likes

I want to thank everyone who toiled over or contributed to getting the files in order for the Visual Studio and VisualGDB environment. I have VS2013 Professional and eval copy of VisualGDB. I’m going to purchase the Embedded version when my evaluation period expires. I inquired about senior or disabled discounts and was informed that only validated students or quantities in bundles of 10 or more qualify (anybody want to go in on a group buy?). My experience was relatively pain free.

  1. Followed Getting Started instructions in the Wiki repo to get the feel and understanding of what is happening when building and compiling.

  2. Used the Dithering instructions as a guide for setting up VisualGDB to get a feeling of what it is and what it does.

Deviated from Dithering instructions by;

  1. I created a Libraries folder in the path where I plan to create and store my solutions and used Git to copy libDaisy and DaisySP into it. I ran rebuild scripts and make for each library.

  2. I’m not using Fast Semihosting. Instead, I selected fp support in printf() and scanf() in Embedded Project page in C Library Type pull down list.

  3. On MSBuild settings page I made no attempt to fill in anything in the Common Build Settings except for Linker Script. Click on the edit icon and it turns into a browse icon. Browse to …\Libraries\libDaisy\core and select the .lds file. Now click ‘Copy to project directory’ button.

  4. Add the Libraries above to your solution as existing projects then add them as references in your new project.

  5. Attempt to build your solution. In the code window for your main .ccp file there will be a yellow highlighted notice that it can’t find some dependent files. Follow the instructions carefully. This is a two step process where you find the path(s) then you have the system make adjustments to the settings for you (no chasing your tale back and forth or hunting for files! And best of all, no unnecessary inclusions or unneeded directory search paths!)

As I get a little more familiar with the GDB side of things I envision delving into my IOT development stuff and say goodbye to Arduino IDE altogether.

1 Like

FWIW:
The reason I wrote the guide to include fast semihosting is because semihosting slows your runtime down massively.

1 Like

@SEDur I’m just getting my feet wet in this cross platform environment. I’m glad you brought the fact that processing will be slower without the Semihosting option to the forefront because although I’m quite familiar with Visual Studio, it’s my first endeavor using a hardware debugging device.

Right now I’m relearning how to code for buttons, knobs, and SPI for the Daisy Seed as I attempt to migrate Arduino code to add more effects to the Guitar Amplifier that I recently completed now that I have access to SDRAM.

I will definitely change my VisualGDB config to perform Semihosting as you suggest. Thanks for sharing.