knurling-rs / app-template Goto Github PK
View Code? Open in Web Editor NEWQuickly set up a `probe-rs` + `defmt` + `flip-link` embedded project
License: Apache License 2.0
Quickly set up a `probe-rs` + `defmt` + `flip-link` embedded project
License: Apache License 2.0
I am trying to find a hello world/blinky project for getting started with the nRF52840-dk. When I follow the steps in the read me I get a linker error for the cortex-m-rt crate
cargo rb hello
Updating crates.io index
error: failed to select a version for `cortex-m-rt`.
... required by package `nrf-hello-world v0.1.0 (/Users/me/Code/Embedded/nrf-hello-world)`
versions that meet the requirements `^0.7` are: 0.7.3, 0.7.0
the package `cortex-m-rt` links to the native library `cortex-m-rt`, but it conflicts with a previous package which links to `cortex-m-rt` as well:
package `cortex-m-rt v0.6.15`
... which satisfies dependency `cortex-m-rt = "^0.6.8"` of package `nrf52840-pac v0.9.0`
... which satisfies dependency `nrf52840-pac = "^0.9.0"` of package `nrf52840-hal v0.11.0`
... which satisfies dependency `nrf52840-hal = "^0.11.0"` of package `nrf-hello-world v0.1.0 (/Users/me/Code/Embedded/nrf-hello-world)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "cortex-m-rt"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
failed to select a version for `cortex-m-rt` which could resolve this conflict
I've written a simple button application based on the app-template. However, after some time of firmware being run on the STM32F027B-DISCO board, it stopped. I started to dig in and found HardFault occurred. The breakpoint in the HardFault handler in lib.rs never hit even if I press Run after the automatic stop caused by the debugger.
The repo: https://github.com/itxs/embedded_rust_learning
The screenshot of an issue:
Adding it to cargo-generate.toml
's exclude
list only means that placeholders inside of it won't be expanded. Instead, we apparently need to create a .genignore
and add it there (as per https://github.com/ashleygwilliams/cargo-generate#templates).
In Step 2
of the Setup
has an incorrect command.
probe-rs list chips
is not a valid command.
It should be probe-rs chip list
instead.
also worth noting that v0.2.0 of probe-run must be used
perhaps delete the next
branch after that
I followed the defmt setup guide from this post and finished the todos. However I get the following when running the hello
example. The repo is here: https://github.com/hamptokr/voltron-testing
(HOST) INFO flashing program
(HOST) INFO success!
────────────────────────────────────────────────────────────────────────────────
(HOST) ERROR Max number of RTT attach retries exceeded.
Error: RTT control block not found in target memory. Make sure RTT is initialized on the target.
Here are some versions of things I am using
cargo 1.46.0 (149022b1d 2020-07-17)
rustc 1.46.0 (04488afe3 2020-08-24)
stm32f4xx-hal = { version = "0.8.3", features = ["rt", "stm32f429"] }
probe-run 0.1.3
(from master branch)right now the setup steps live in https://ferrous-systems.com/blog/defmt/#setup but they should be moved into this repo (README). That way we can keep them updated and also make them easier to find
I'm getting linking errors during cargo build --bin hello
error: linking with `rust-lld` failed: exit code: 1
|
= note: "rust-lld" "-flavor" "gnu" "-L" "/home/dkhayes117/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o" "-o" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350" "--gc-sections" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/debug/deps" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/build/defmt-786b78cb5fb56c90/out" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/build/hifive1-12e6de30a7c42179/out" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/build/e310x-c9d6b8bcdebcec36/out" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/build/riscv-b96e58c41469ec83/out" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/build/riscv-rt-7fa43864cbb5bfaa/out" "-L" "/home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/build/riscv-rt-7fa43864cbb5bfaa/out" "-L" "/home/dkhayes117/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "--start-group" "-Bstatic" "/tmp/rustcQiAIxg/libriscv_rt-c7d2a202c972997c.rlib" "/tmp/rustcQiAIxg/libriscv-6fb334952367127a.rlib" "--end-group" "/home/dkhayes117/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-c1fdd1f60c58bc16.rlib" "-Bdynamic"
= note: rust-lld: error: undefined symbol: _mp_hook
>>> referenced by lib.rs:301 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-rt-0.6.2/src/lib.rs:301)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
rust-lld: error: undefined symbol: __pre_init
>>> referenced by lib.rs:302 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-rt-0.6.2/src/lib.rs:302)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
rust-lld: error: undefined symbol: _sbss
>>> referenced by lib.rs:302 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-rt-0.6.2/src/lib.rs:302)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
>>> referenced by lib.rs:302 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-rt-0.6.2/src/lib.rs:302)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
rust-lld: error: undefined symbol: _ebss
>>> referenced by lib.rs:302 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-rt-0.6.2/src/lib.rs:302)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
>>> referenced by lib.rs:302 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-rt-0.6.2/src/lib.rs:302)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
rust-lld: error: undefined symbol: _sdata
>>> referenced by lib.rs:0 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/r0-0.2.2/src/lib.rs:0)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
>>> referenced by lib.rs:0 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/r0-0.2.2/src/lib.rs:0)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
rust-lld: error: undefined symbol: _sidata
>>> referenced by lib.rs:0 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/r0-0.2.2/src/lib.rs:0)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
>>> referenced by lib.rs:0 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/r0-0.2.2/src/lib.rs:0)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_rust)
rust-lld: error: undefined symbol: trap_handler
>>> referenced by lib.rs:329 (/home/dkhayes117/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-rt-0.6.2/src/lib.rs:329)
>>> /home/dkhayes117/IdeaProjects/defmt_test/target/riscv32imac-unknown-none-elf/debug/deps/hello-a9b45fbc99b62350.hello.1n7pvg5w-cgu.0.rcgu.o:(_start_trap_rust)
rust-lld: error: undefined symbol: _max_hart_id
>>> referenced by riscv-rt.o:(.init+0x52) in archive /tmp/rustcQiAIxg/libriscv_rt-c7d2a202c972997c.rlib
>>> referenced by riscv-rt.o:(.init+0x56) in archive /tmp/rustcQiAIxg/libriscv_rt-c7d2a202c972997c.rlib
rust-lld: error: undefined symbol: _stack_start
>>> referenced by riscv-rt.o:(.init+0x5E) in archive /tmp/rustcQiAIxg/libriscv_rt-c7d2a202c972997c.rlib
rust-lld: error: undefined symbol: _hart_stack_size
>>> referenced by riscv-rt.o:(.init+0x66) in archive /tmp/rustcQiAIxg/libriscv_rt-c7d2a202c972997c.rlib
>>> referenced by riscv-rt.o:(.init+0x6A) in archive /tmp/rustcQiAIxg/libriscv_rt-c7d2a202c972997c.rlib
error: aborting due to previous error
error: could not compile `defmt_test`.
To learn more, run the command again with --verbose.
I tried to do the following:
cargo install \
--git https://github.com/knurling-rs/probe-run \
--branch main \
--features defmt --force
cargo install cargo-generate --force
cargo install flip-link --force
cargo generate \
--git https://github.com/knurling-rs/app-template \
--branch main \
--name knurling-template
I then performed the edits suggested from the README.md file: https://github.com/knurling-rs/app-template
and when I do:
cargo run --bin hello
I get the following error:
Running `probe-run --chip nRF52840_xxAA --defmt target/thumbv7em-none-eabihf/debug/hello`
Error: defmt version mismatch (firmware is using 148009e3bb1d99b5a1938a1a816ad0b0b6423aeb, host is using 28c1afb4d3bad747ef47737a83f5c8b13928cb8a); are you using the same git version of defmt and related tools?
Try `cargo install`-ing the latest git version of `probe-run` AND updating your project's `Cargo.lock` with `cargo update`
I even did cargo uninstall probe-run and reran the install command above with no change.
Hi. Does anyone know what could cause this? Have been using probe-run
for a while; got this error on modifying project to be like the template, using defmt
and flip-link
. Thank you.
warning: Linking globals named '_SEGGER_RTT': symbol multiply defined!
error: failed to load bc of "defmt_rtt-744a0a5cfb69d4e1.defmt_rtt.awuu50kv-cgu.0.rcgu.o":
error: aborting due to previous error; 34 warnings emitted
I'm using Windows.
When I try to build for nrf51822 (cortex-m0) with nrf-51-hal crate the build never ends.
Steps to reproduce:
rustup target add thumbv6m-none-eabi
cargo generate --git https://github.com/knurling-rs/app-template --branch main --name my-app
Add nrf51-hal = "0.14" to Cargo.toml dependencies
cargo build
cargo build output:
Compiling proc-macro2 v1.0.34
Compiling unicode-xid v0.2.2
Compiling syn v1.0.82
Compiling semver-parser v0.7.0
Compiling cortex-m v0.7.3
Compiling version_check v0.9.3
Compiling nb v1.0.0
Compiling vcell v0.1.3
Compiling void v1.0.2
Compiling cortex-m-rt v0.7.1
Compiling bitfield v0.13.2
Compiling defmt v0.3.0
Compiling az v1.2.0
Compiling typenum v1.14.0
Compiling defmt-macros v0.3.1
Compiling fixed v1.11.0
Compiling nrf51-pac v0.10.1
Compiling defmt-parser v0.3.0
Compiling half v1.8.2
Compiling stable_deref_trait v1.2.0
Compiling bitflags v1.3.2
Compiling nrf-hal-common v0.14.0
Compiling bytemuck v1.7.3
Compiling cast v0.3.0
Compiling rand_core v0.6.3
Compiling cfg-if v1.0.0
Compiling defmt-rtt v0.3.1
Compiling panic-probe v0.3.0
Compiling nrf51-hal v0.14.0
Compiling embedded-storage v0.2.0
Compiling volatile-register v0.2.1
Compiling nb v0.1.3
Compiling semver v0.9.0
Compiling embedded-dma v0.1.2
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling embedded-hal v0.2.6
Compiling rustc_version v0.2.3
Compiling bare-metal v0.2.5
Compiling quote v1.0.10
Compiling cortex-m-rt-macros v0.7.0
Compiling my-app v0.1.0 (/home/honza/tmp/my-app)
Building [=======================> ] 75/82: fixed
This is in readme and returns 404: https://github.com/knurling-rs/flip-link/blob/main/.github/workflows/0001-configure-test-flip-link-app-for-nrf52840.patch
Hi. After I used app-template
to generate a project and opened it with vscode, the rust extension emitted an error can't find crate for test
. Could you tell me how to avoid this.
Dear Knurling-rs community,
Most of us maintainers of Knurling-rs will be on vacation from this week until the beginning of January. Therefore please do not expect too much activity in our repositories and issue tracker.
We wish you a great holiday season (if you have it) or, otherwise, just a good time.
Best, your Knurling-rs team ❄️
We should update the template to defmt 0.3
and release the new template at the same time as defmt
.
The print-defmt
feature, which is enabled by default here:
app-template/testsuite/Cargo.toml
Line 25 in b131e11
is not enabled in the root Cargo.toml
Lines 19 to 21 in b131e11
which results into this linker error on my machine, when envoking cargo test -p testsuite
:
Updating git repository `https://github.com/knurling-rs/defmt.git`
Compiling testsuite v0.1.0 (/home/fabian/Projects/probe-rs-test/testsuite)
error: linking with `rust-lld` failed: exit code: 1
|
= note: "rust-lld" "-flavor" "gnu" "--eh-frame-hdr" "-L" "/home/fabian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabihf/lib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/test-daf5c426a107f9de.3f85ep5l4tmq4cjz.rcgu.o" "-o" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/test-daf5c426a107f9de" "--gc-sections" "-L" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps" "-L" "/home/fabian/Projects/probe-rs-test/target/debug/deps" "-L" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/build/cortex-m-9e8e16258a49aff5/out" "-L" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-de80db1368e4e709/out" "-L" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/build/defmt-63ffe4a8f615f792/out" "-L" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/build/defmt-9193441bd5229fe0/out" "-L" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/build/stm32f3-79ff9fbfd025df4d/out" "-L" "/home/fabian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabihf/lib" "-Bstatic" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libprobe_rs_test-fc8a21b9535a2bb9.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libstm32f3xx_hal-969d10ed50bf8cb0.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libheapless-937b344ffad95b46.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libhash32-43140fd7893bf3c5.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libbyteorder-6fad586717fa02c4.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libembedded_hal_can-87549cd3a05caaee.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libstm32_usbd-86e8030cdc26258d.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libusb_device-b72e166c77966672.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libcfg_if-90796c704deea078.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/librtcc-9eb407e85b02babd.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libchrono-a670157da5d0ae28.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libnum_integer-c618218e6106f58c.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libnum_traits-13c286d7d20ca587.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libembedded_dma-dcfaf13f8f551ee0.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libcast-44574ff949e37aae.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libstm32f3-68ec9081389bd82f.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libembedded_hal-f7e699ffe96e3c2e.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libvoid-6f3bc16521189212.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libnb-47a67e8f2360fe58.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libnb-5a5434ccd7996659.rlib" "--start-group" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libpanic_probe-79dd64c85d461f83.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libdefmt-875d097bce3c0ced.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libdefmt_common-ff5cd0653fae5eee.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libdefmt_rtt-c5ca225d2c9d8903.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libdefmt-15d46e343b789076.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-0eb7bb1de769cc23.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libvolatile_register-b6339df8b54634ba.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libvcell-9695512adac47d45.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libbare_metal-b5b81c0dc4b2d60b.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libaligned-75df737b2ac89ff7.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libas_slice-5fd1956ac6d2cddc.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libstable_deref_trait-fcdcb203a2b90bb3.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libgeneric_array-fda4f9a3eb1be905.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libgeneric_array-25409c8c76176d2e.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libgeneric_array-02caaeed88b43efc.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libtypenum-94045a785496a94d.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libcortex_m_rt-148379300858178c.rlib" "/home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libr0-31ea11b2b4afebea.rlib" "/home/fabian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabihf/lib/librustc_std_workspace_core-cd2885036a83a85f.rlib" "/home/fabian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabihf/lib/libcore-638f4f8c5b5e5844.rlib" "--end-group" "/home/fabian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabihf/lib/libcompiler_builtins-93db0b79f9e8c6f2.rlib" "-Tlink.x" "-Tdefmt.x" "-Bdynamic"
= note: rust-lld: error: duplicate symbol: __defmt_default_timestamp
>>> defined at lib.rs:444 (/home/fabian/.cargo/git/checkouts/defmt-7f5b74b4e6ff55d4/be7f4a7/src/lib.rs:444)
>>> defmt-875d097bce3c0ced.defmt.m7gzhem3-cgu.0.rcgu.o:(__defmt_default_timestamp) in archive /home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libdefmt-875d097bce3c0ced.rlib
>>> defined at lib.rs:442 (/home/fabian/.cargo/git/checkouts/defmt-7f5b74b4e6ff55d4/77bef85/src/lib.rs:442)
>>> defmt-15d46e343b789076.defmt.1dquk1wd-cgu.0.rcgu.o:(.text.__defmt_default_timestamp+0x1) in archive /home/fabian/Projects/probe-rs-test/target/thumbv7em-none-eabihf/debug/deps/libdefmt-15d46e343b789076.rlib
Removing or disabling the print-defmt
feature resolves the issue.
Have been trying to retrofit defmt::test to a library. Ran into issues, thought I'd better start with something working
Ran through the readme instructions (cargo rb hello
builds and runs)
cargo test
just complains about "can't find crate test`
Other than readme instructions for device specific bits, no modifications have been made
This was removed in #2 to work around a rustc bug. It should be restored once that bug is fixed and in stable.
when rust-lang/rust#90357 is fixed on stable
I think it could be better to replace cargo-generate
with a similar but more powerful tool kickstart
. This tool supports custom template variables. This should free the user of most of the manual actions of replacing {{variables}}
that aren't supported by cargo-generate.
If it makes sense to do so, I'll be happy to make a PR for this.
Hello knurling-rs,
I can't seem to get semihosting to work with the app-template and my STM32F103C8T6 "blue pill" board. I'm using VSCode and the "Debugger for probe-rs" behind an STLink V2:
$ probe-rs list
The following debug probes were found:
[0]: STLink V2 (VID: 0483, PID: 3748, Serial: [...], StLink)
$ probe-rs info
Probing target via JTAG
ARM Chip:
Debug Port: Version 1, DP Designer: ARM Ltd
└── 0 MemoryAP
└── ROM Table (Class 1)
├── Cortex-M3 SCS (Generic IP component)
│ └── CPUID
│ ├── IMPLEMENTER: ARM Ltd
│ ├── VARIANT: 1
│ ├── PARTNO: 3107
│ └── REVISION: 1
├── Cortex-M3 DWT (Generic IP component)
├── Cortex-M3 FBP (Generic IP component)
├── Cortex-M3 ITM (Generic IP component)
└── Cortex-M3 TPIU (Coresight Component)
[...]
Now, whenever I start debugging anything, I end up in line 212 of cortex-m-semihosting/src/lib.rs, indicative of a failed semihosting attempt.
In a more "bare" setup (without knurling-rs, using the "Cortex-Debug" VSC extension and a manually setup "cargo build" prelaunch task) I was able to resolve the same issue leveraging "preLaunchCommands" for the gdb process, i.e. "monitor arm semihosting enable"
. I can't seem to find a similar setting with the arguably better approach using probe-rs and knurling.
I've selfhosted both experimental projects in my gitea instance and added a containers.dev config for convenience.
Any ideas forward?
Crossposted at probe-rs/vscode/issues/89
Hi! I'm trying out this template on a Bluepill board with STM32F103C8 and stm32f1xx-hal
. After following the setup steps (and working around #18) I get a linker error about missing memory.x
when running cargo rb hello
.
Copying memory.x
from the HAL's repository into the root of the project as suggested by their readme solves the problem.
https://github.com/stm32-rs/stm32f1xx-hal/blob/master/memory.x
Is this expected to be part of step 5 ("5. Import your HAL")? I could make a PR on the readme but I'm not sure if this works differently for other HAL's?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.