Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected default VSCode build task. #83

Merged
merged 2 commits into from
Mar 5, 2020

Conversation

david-boles
Copy link
Contributor

My VSCode install wasn't showing the default build task. Based on the other ones, this seems to have fixed it.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @korken89 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@adamgreig
Copy link
Member

@rubberduck203 any thoughts on this PR?

@david-boles
Copy link
Contributor Author

Whoops, just noticed the clean task is formatted the same way. On the assumption that what I did is correct, I'll make another commit to change that too.

@david-boles
Copy link
Contributor Author

Some other notes: I tried restarting vscode as I hadn't since installing rust-lang's rust extension and the problem persists. I got a notification pointing to the following error:

Error: The cargo task detection didn't contribute a task for the following configuration:
{
    "label": "cargo clean",
    "type": "cargo",
    "subcommand": "clean",
    "group": "build"
}
The task will be ignored.

@rubberduck203
Copy link
Contributor

@adamgreig I can test it sometime in the next 24 hrs.

Copy link
Contributor

@rubberduck203 rubberduck203 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured out what's going on here.
It's an artifact of RLS behaving itself and only triggering when there's a *.rs file open.
It's both the cause of the task not showing and the error you mentioned.

Switching to use a process and calling cargo directly side steps all of this.
I've tested this PR and it's definitely the way to go.

This note needs to be removed from the .vscode/README.md file, but LGTM.

Note: When you open the project in the editor, you must open an *.rs file to trigger the Rust Language Server. Failure to do so will cause a failure to find the build task.

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, and thanks for checking it @rubberduck203.

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 5, 2020

Configuration problem

bors.toml: not found

@adamgreig adamgreig merged commit 23a74e9 into rust-embedded:master Mar 5, 2020
rubberduck203 added a commit to rubberduck203/cortex-m-quickstart that referenced this pull request Mar 5, 2020
adamgreig added a commit that referenced this pull request Mar 5, 2020
Update vscode docs to reflect fixes from PR #83
rubberduck203 added a commit to rubberduck203/stm32f3-discovery-quickstart that referenced this pull request Mar 5, 2020
9977613eac33c0db052219b93fbf4b54c9b8ab0e
6c2621961159a52769fe0709eecf531385bc38ba

rust-embedded/cortex-m-quickstart#83
@david-boles david-boles deleted the patch-1 branch March 6, 2020 17:06
crlnmhd pushed a commit to crlnmhd/Pong that referenced this pull request Nov 12, 2022
This project was originally based on
https://github.com/rust-embedded/cortex-m-quickstart however most of
those parts are no longer relevant. The squash is in no way intended to
take credit for their work, only to simplify the history.

initial commit

enable LTO

fix `cargo new` invocation

adapt to changes in cortex-m-srp

build compiler-builtins as part of the Xargo sysroot

update dependencies

add nrf51 to the list of supported families

add an example of overriding an exception

closes #2

link using ld

use an older Cargo to instantiate the template

no need to enable the cortex-m-rt/linker-script feature

as it's enabled by default

more docs, sort examples

note where code is device dependent

all dependencies are dev-dependencies

add a comment to the SRP example

turn into a Cargo crate

v0.1.1

Include debug information in release builds.

Without debug information, `tbreak cortex_m_rt::reset_handler` does not work:
rustc does not include the Rust support script directive, gdb does not load it,
      and breakpoints can only be set on functions using their full mangled name.

      v0.1.2

      Fix documentation mistype in examples/crash.rs

      add troubleshooting section

      v0.1.3

      add dependencies section to documentation

      add 'used stable toolchain' sub-section to the troubleshooting section

      v0.1.4

      warn against using CARGO_INCREMENTAL

      v0.1.5

      set default runner to arm-none-eabi-gdb

      with this `xargo run` will build the program *and* immediately start a GDB
      session.

      v0.1.6

      document how to use the heap and a dynamic allocator

      v0.1.7

      gdbinit: don't reset the microcontroller

      simply `step` after the `load` command. This should just work now that we are
      using cortex-m-rt v0.2.2

      .gdbinit: add a commented out option to make the SWO pin functional when ...

      it's not connected to a programmer / debugger SWO pin

      bump cortex-m-rt version to v0.2.3; document the _stext symbol

      v0.1.8

      Remove 'monitor tpiu itm port 0 on' from .gdbinit

      This happens automatically when openocd sets up the tpiu; see openocd manual 16.5.4.

      Revert "Remove 'monitor tpiu itm port 0 on' from .gdbinit"

      This reverts commit f88a44f.

      It's required on OpenOCD 0.10.0

      v0.2.0

      fix CHANGELOG

      Build compiler-builtins from rust source instead of github repository.

      expand the device example

      enable the "mem" feature of the compiler-builtins crate

      turns out it *is* required if your application ends up requiring a `memcmp`
      operation.

      document another common error

      overwriting the `.cargo/config` file instead of appending text to it

      v0.2.1

      gdbinit: print demangled symbols by default

      this change turns this:

      ``` console
      (gdb) x/4 0x200003f0
      0x200003f0 <_ZN3app2XS17h4b49405669958fd2E+1008>:       0x20000400      0x080004f5      0x00000000      0x00000001
      ```

      into this:

      ``` console
      (gdb) x/4 0x200003f0
      0x200003f0 <app::XS+1008>:      0x20000400      0x080004f5      0x00000000      0x00000001
      ```

      bump the cortex-m-rt dependency

      disable incremental compilation and parallel codegen in dev mode

      document workaround for "Ignoring packet error"

      update the CHANGELOG

      v0.2.3

      v0.2.4

      Update examples to newer svd2rust api.

      Similarly, the cortex-m crate API was also updated.

      Add comments to Cargo.toml/Xargo.toml.

      This should make it easier to comment/uncomment stuff for the various
      examples.

      use stable release of alloc-cortex-m

      remove unused #[allow]

      examples/panic: add column information

      fix the allocator example

      v0.2.5

      remove all mentions of Xargo

      as you can use plain Cargo to do ARM Cortex-M development

      v0.2.6

      bump the cortex-m-rt to v0.4.0

      ci: don't install cargo-edit

      remove panic-itm dependency

      don't call ci/after_success.sh

      use less unstable dependencies

      make the hello example work

      drop linker-flavor, port more examples

      update examples and docs

      TODO: drop opt-level=s

      use published versions, doc up, update CHANGELOG

      fix tests

      v0.3.0

      document the no #![no_main] issue

      v0.3.1

      Update lib.rs

      fixed doc: clone command should be cargo, not git

      Update panic-semihosting dependency to 0.3.0

      This is due to #[lang = "panic_fmt"] -> #[panic_implementation] breakage

      v0.3.2

      stop recommending LLD

      until https://bugs.llvm.org/show_bug.cgi?id=38435 is fixed

      fix the allocator example

      add CODEOWNERS, CoC; tweak bors and Travis

      README: mention the CoC and who maintains this repo

      Add comment to build script about rerun-if-changed, and remove redundant line for build.rs

      Update comment on rerun-if-changed to better reflect what it does

      v0.3.3

      tweak bors.toml

      use LLD as the default linker

      closes #39

      update symptom for the 'overwrite .cargo/config' problem

      bump dependencies to not depend on arm-none-eabi-gcc

      publish docs on GH pages

      update the minimal example

      fix some warnings

      use size instead of arm-none-eabi-size

      v0.3.4

      add CHANGELOG for v0.3.4

      deduplicate the contents .cargo/config

      using `cfg`s. Also add all the possible compilation targets to .cargo/config.

      be explicit about the GDB script to use

      with this change the user doesn't need to set an [auto-load-safe-path]

      [auto-load-safe-path]: https://sourceware.org/gdb/onlinedocs/gdb/Auto_002dloading-safe-path.html

      workaround rust-lang/cargo#5946

      add a comment indicating which core each target maps to

      bump dependencies

      move to cargo-generate; start with QEMU

      move out most of text

      see rust-embedded/book#20

      backport fixes from the book plus other small updates

      openocd.cfg: add support for older revisions of the discovery

      change the link to the book

      book.rust-embedded.org is pointing to an old version

      quieter GDB

      minify

      note that 1.30-beta is not out yet

      bump dependencies

      try to break at `main`

      the symbol is now stable. However, in optimized build it may be inlined into
      Reset

      add commented out ITM configuration

      this got lost in a previous commit

      Update rust version requirements in README.md

      As Cargo.toml now includes edition = "2018", it won't build with rust 1.30-stable. 1.31-stable will be the first stable version to have the edition feature enabled. (See https://internals.rust-lang.org/t/rust-2018-release-schedule-and-extended-beta/8076 for details.)

      At the same time, remove the remark about 1.30-beta not being out yet, as it's out by now.

      Add example moving .bss data into custom memory

      We're using a STM32F429 and wanted to move stuff around in memory, notably put stack+data into CPU coupled memory, and put framebuffers for the integrated LCD controller into the normal SRAM.

      Getting this right while not completely overriding the default `link.x` was quite tricky (especially finding the `INSERT AFTER` life-saver...) so I thought an example would not hurt here.

      It should probably also be mentioned in other places (book/...)?

      fix example

      Default to extended-remote instead of remote mode

      Extended remote allows a lot more features like attaching and detaching and much more fine-grained execution options. If a gdbserver implementation supports it (and OpenOCD sure does) it should be preferred over `remote`.

      Add additional meta data to improve crate experience

      * Add readme setting, so README.md is shown on https://crates.io/

      use hprint macros

      fix the allocator example

      importing alloc is a bit weird

      use NVIC::pend

      instead of the deprecated NVIC.set_pending

      bump dependencies

      Workaround for loop {} until it is fixed

      Fixes code of conduct link.

      Closes #60

      Add example of writing tests that run on host machine

      Make sure we can actually test prod code

      Add more documentation for testing on host

      Adjust the default breakpoint name to match cortex-m-rt pull #144

      update interrupt usage

      Added backtrace limit to mitigate infinite backtraces

      Bump dependency versions

      added missing import

      NVIC wasn't imported from the stm32f30x crate

      add openocd.gdb hint how to print panic immediatly

      Update instructions for device example, closes #73

      Update of cortex-m-rt for coming stable breakage

      Add VS Code support

      Adds basic configuration for VS Code for QEMU and STM32F3DISCOVERY.

      Track launch.json, tasks.json, md & svd files

      Ignoring the .vscode/ directory is good default behavior,
      but it's probably best to track the files that define build tasks, debug
      configs, documentation, and any system view description files.

      The gitignore.io sample takes the same approach.
      https://www.gitignore.io/api/visualstudiocode

      > We in the VS Code team share debug and task specific settings as well because we want our team to have the same set of debug targets and task targets for VS Code.

      https://stackoverflow.com/a/32979933/3198973

      Even people who vehemently argue that .vscode shouldn't be track, agree
      that complex debug configs should be tracked and shared.

      > The only .vscode that makes sense to include are complex launch configs for debugging.

      https://stackoverflow.com/a/47668283/3198973

      Add recommended extensions file

      Add vscode build tasks for examples and release

      Corrected default VSCode build task.

      Corrected default VSCode clean task.

      Update vscode docs to reflect fixes from PR #83

      9977613
      6c26219

      rust-embedded/cortex-m-quickstart#83

      Remove unnecessary build.rs

      Replace unidiomatic 'extern crate' to 'use x as _'

      Re-add build script with note this time

      Update build.rs

      Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>

      Add --nmagic linker arg, for unaligned flash origin support.

      Without this, the linker places some extra program header entries that can confuse flashing tools.

      Many thanks to @jonas-schievink for pointing me to this flag in Matrix.

      Also add examples to target Armv8-M

      Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>

      Fix alloc example

      Fixes #99: Disambiguates VSCode Tasks

      Using the equivalent command line as the task name caused some confusion.
      Users were under the impression that they could use any valid cargo command as a preLaunchTask in the launch configurations.

      move .cargo/config to .cargo/config.toml

      openocd.cfg: use the unified stlink.cfg configuration

      In newer versions of openocd, all the stlink-v* configuration files are
      deprecated, and just source stlink.cfg.

      docs: updates documentation to include correct path and full list of ISAs
therealfrauholle pushed a commit to therealfrauholle/cortex-m-quickstart that referenced this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants