Difference between "make" and "Run Build Task"?

Hi everyone,

I’m such a noob here so don’t be too harsh if I say something stupid please hehe.
I’m still trying to set up VS Code properly to compile and debug using the examples from the DaisyExamples repo and there’s something I don’t get here:

  • If I use GitBash inside, let’s say de Blink example folder, and type make it builds all the necessary files:


    and the “build” folder is created inside de Blink folder:
    image
    Cool.

  • If I’m in VSC with my Blink project open and type “make” in the terminal or click on Terminal > Run Build Task (which form the “tasks.json” I’ve figured out is the same thing) the files are supposed to be created:


    but the build folder doesn’t show up:
    image

  • If I then try to run the “program” task (which I suppose should create the files and put them in a “build” folder) I get this error:


    But still I can run the “program-dfu” task and the program flashes to the Daisy Seed with no problem and you can see the LED blinking:

I don’t get iiiiit!!! Is this of any importance? Should I be worried about trying to compile and flash my own programs or everything is going to just work anyway?

I still have to get into creating my own project and coding on my own, any particular workflow or configuration for VSC recommended to make sure everything runs smoothly?

Thanks everyone and keep building this amazing comunity!

Openocd is used for programming and debugging with hardware programer (ST-Link). It’s not found on your machine, apparently. But you don’t use that programmer, so it doesn’t matter.

DFU mode is used to flash your application binary and it only uses USB connection.

That last error happens on some versions of dfu-util, it’s a false alarm that you can ignore.

Thanks for answering @antisvin!

Good to know the las error is just a false alarm, it was anoying me a bit haha Is there any way I can debug with the DFU mode as I would with an ST-Link or do I have to use an ST-Link no matter what?

There is a Logger class in libdaisy that would allow you to print-style debugging, but there isn’t currently a method for actual debugging (a la breakpoints, stack traces, etc.) via USB.

The DaisySeed class has wrappers for the common logger functions: StartLog Print and PrintLine

OK thank you very much for clarifying this!

I’ll try experimenting a bit with the Logger class then before going into ST-Link and see if that works for me.

Hope I can help you out some day too!

The Logger class is very easy to use!

In your main() place

hardware.StartLog(false);

(before starting your audio).

You can then output text and variable values with

hardware.PrintLine("mytext = %d", myvar);

or

hardware.PrintLine("mytext");

I even use it to export MIDI in XML form! (see OscPocketD - Portable music tool (sequencing drums and synths) - #13 by StaffanMelin).

I use GNU Linux (Debian) so I can mointor the serial port with

cu -l /dev/ttyACM0

and

screen /dev/ttyACM0

or for logging

screen -L -Logfile mylogfile.xml /dev/ttyACM0

5 Likes

Great!

Going to try and tell you how it goes.

Thanks so much for the help :raised_hands: :raised_hands:

2 Likes

Hey! I’ve been trying the Logger class to print the knob values of a tremolo effect but I don’t know how to make it work. Are there any commands I have to type on the VSC terminal? Because I flashed the logger example as in your post but I don’t get anything on screen.

There must be something I’m missing. Can you think about something that happened to you when you started using this?

Thanks so much again!

1 Like

The Logger class allows the daisy to appear as a virtual COM Port on a host (PC). So just having the code won’t start updating anything on your VS Code screen. In order to read what is being output you’ll need to use a Serial Monitor of some sort.

If you have Arduino installed, you can open it up and use the Tools->Serial Monitor from there. There are also other programs available depending on your OS (like PuTTY on Windows). Depending on your OS the Daisy will show up with a different name, but it should appear/disappear when you connect the cable. For example, the one connected to my PC right now shows up as COM7. It should also have a name in device manager/system information, like “STM32 Virtual ComPort” or “Daisy Seed Built In”

You can also use linux cli tools as @StaffanMelin mentioned above.

3 Likes

Yeah, as @shensley pointed out, you have to have some program on your laptop/computer that is listening and displaying the stuff that is sent back.

I don’t know what platform you are on, but these two pages from Adafruit might be able to help you get the things working:

  1. Advanced Serial Console on Windows | Welcome to CircuitPython! | Adafruit Learning System
  2. Advanced Serial Console on Mac and Linux | Welcome to CircuitPython! | Adafruit Learning System
2 Likes

Oook this makes complete sense. I think I saw something about PuTTY on another post so I’ll definitely cheack it out.

Thanks you both I’ll let you know!

1 Like

I see in your first screenshot that you have Blink.sln in your folder. How did you create that?

Hello all,

I have been looking around for code sample showing how to use the ST-Link + debug output and I am not sure I have found the answer quite yet… or at least a code sample where I can look at it and go - OK, I think I have it. :smiley: Any help or pointers here would be greatly appreciated.

here is my situation:

  1. I am using the external USB port for MIDI over USB
  2. I am using the internal USB port for the ST Link debugger

I would like to be able to do some debug output prints for timing and other data while still debugging with the ST Link. This looks very possible from what I have read, but I am not clear on how to set this up in code.

Any and all help here would be greatly appreciated in helping me with a code example for doing this.

Thank you for your time and help with this.
Brett

Hey Brett,

Here’s a video (timestamped link) where debug is demonstrated. I hope this is what you were looking for. There’s a link in the description where you can learn more about debugging.

If you were looking for a specific type of code, would you tell us more about what you want to accomplish? Feel free to get specific about your project :slight_smile:

1 Like

Hello @Takumi_Ogata ,

Thank you for the link, I do have all of that up and running and have been debugging quite a bit via breakpoints and such.

What I am looking to do is use the logger and be able to print debug info, such as timing data, so I can keep the system running and look for timing glitches.

In looking at this link that discusses the logger I noticed it talks about using the “Logger<LOGGER_SEMIHOST>” but it was not clear to me how to set this up.

In short i’m looking to be able to do a logger.PirntLine to put out timing data when VSCode is running via the ST-Link [Edit removed part of this line].

[update]
When the internal USB is in use, what is the proper way to have debug output go to/through the ST-Link, if that is possible at all.

Thank you for your help so far, it is greatly appreciated.

Brett