rust-embedded / cortex-m-quickstart

Template to develop bare metal applications for Cortex-M microcontrollers
782 stars 164 forks source link

VS Code build tasks #82

Closed rubberduck203 closed 4 years ago

rubberduck203 commented 4 years ago

Adds the following build tasks for VS Code:

It should be noted that --examples won't build successfully, because in general, you can't run cargo build --examples on projects generated from the quickstart. It does trigger the correct behavior and I have tested these tasks on projects where it does build cleanly.

https://github.com/rubberduck203/stm32f3-discovery/blob/4933a160eee6ca53cc94c50d0470ea6e8ab03928/.vscode/tasks.json

rust-highfive commented 4 years ago

r? @ithinuel

(rust_highfive has picked a reviewer for you, use r? to override)

pigrew commented 4 years ago

Thanks for making this PR.

Can we also make a "Release (OpenOCD)" launch? That was the (unstated) intent of issue #80.

rubberduck203 commented 4 years ago

Well, we can, but debugging in release won’t behave as expected for most people @pigrew.

pigrew commented 4 years ago

Good point, I agree that the experience would not be as many would expect. I defer to you judgement.

I use the launch as a way to conveniently flash the release build onto the MCU, and occasionally use semihosting, but not for stepping through code.

rubberduck203 commented 4 years ago

Hmm. That’s fair. What if we created some tasks that just did that?

pigrew commented 4 years ago

@rubberduck203

Fine by me, can one task depend on another (so it would call the build task, and then flash)?

It seems simpler to add the launch, versus another task? To me, using a task has more implementation complexity in order to prevent the user from having an easy way to debug release builds. It also means the user most look one place (launches) to run a debug build, but another to run a release build.

rubberduck203 commented 4 years ago

You make a good point. I think I’d like someone from the QuickStart team to weigh in.

rubberduck203 commented 4 years ago

@ithinuel have you had a chance to look at this? Despite the conversation here which means this does not address the original issue (#80), I believe these changes are still good to go.

bors[bot] commented 4 years ago

Configuration problem

bors.toml: not found