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

Embedded fixups #98

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"editor.inlayHints.enabled": "offUnlessPressed",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500,
"rust-analyzer.linkedProjects": [
Expand Down
16 changes: 11 additions & 5 deletions book/src/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ More info:
- <https://rust-analyzer.github.io/>
- <https://code.visualstudio.com/learn/collaboration/live-share>

### Tip

This repo contains quite a lot of rust projects and due to the complicated setup of the repo Rust Analyzer can't autodiscover them well.

To fix this we've specified the projects manually in the `.vscode/settings.json` file. To reduce the burden on your computer, you can comment out any of the projects that we're not using in our training.

## Git
During the trainings, you'll need the Git version control tool.
If you haven't installed Git already, you can find instructions here: <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>.
Expand Down Expand Up @@ -121,7 +127,7 @@ You can view variable values by hovering over them while execution is paused, or
*This part is relevant only if you're partaking in one of the workshops on embedded Rust.*

## Hardware
You should have a [BBC micro:bit](https://microbit.org/buy/bbc-microbit-single/ V2) available.
We will use the [BBC micro:bit](https://microbit.org/buy/bbc-microbit-single/ V2) and either you've already got it or we will bring it with us.

You'll also need a Micro-USB cable, but we're sure you've got one to spare.

Expand Down Expand Up @@ -154,10 +160,10 @@ sudo udevadm control --reload-rules
sudo udevadm trigger
```

If you're on `windows`, we need to install a generic WinUSB driver. You can use [Zadig](https://zadig.akeo.ie/) to select the usb device that uses the jlink driver and install WinUSB on it.
*This will uninstall the official driver, which means that the official Segger tools will not work anymore after this.* To revert, go to `device manager` and uninstall the usb device. The jlink driver will then be used again for that usb connection.

Then, unplug the USB cable and plug it in again.
It's possible that probe-rs detects two debugging interfaces. This is known to happen on Windows.
In that case, go to the `.cargo/config.toml` and change the runner to the one that specifies the exact probe
it needs to use. Make sure the values are the same as what probe-rs reports is one of the interfaces.
Unsure? You can run `probe-rs list` to get a list of all connected probes.

## Trying it out
Before we begin, we need to test our hardware. We'll be testing the nRF52833 microcontroller and the LSM303AGR motion sensor, that are present on the micro:bit V2. Make sure you have checked out the latest version of the workshop source.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs run --chip nRF52833_xxAA --catch-reset --catch-hardfault --allow-erase-all"
# runner = "probe-rs run --chip nRF52833_xxAA --catch-reset --catch-hardfault --allow-erase-all"
runner = "probe-rs run --chip nRF52833_xxAA --catch-reset --catch-hardfault --allow-erase-all --probe 0d28:0204:990636020005282085E7C008F3731B68000000006E052820"

rustflags = [
"-C", "link-arg=-Tlink.x",
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2021"
cortex-m = { version = "0.7.7", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7.3"
panic-probe = { version = "0.3.0", features = ["print-rtt"] }
embedded-hal = "0.2.7"
embedded-hal = "1.0.0"
rtt-target = "0.5.0"
lsm303agr = "1.0.0"
lsm303agr = "1.1.0"

[dependencies.nrf52833-hal]
version = "0.18.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs run --chip nRF52833_xxAA --catch-reset --catch-hardfault --allow-erase-all"
# runner = "probe-rs run --chip nRF52833_xxAA --catch-reset --catch-hardfault --allow-erase-all --probe 0d28:0204:990636020005282085E7C008F3731B68000000006E052820"

rustflags = [
"-C", "link-arg=-Tlink.x",
Expand Down
51 changes: 41 additions & 10 deletions exercises/8-embedded/1-embedded-ecosystem/1-lsm303agr-id/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cortex-m = { version = "0.7.7", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7.3"
rtt-target = "0.5.0"
embedded-hal = "1.0.0"
embassy-nrf = { version = "0.1.0", features = ["nrf52833", "unstable-pac"] }
embassy-nrf = { version = "0.2.0", features = ["nrf52833", "unstable-pac"] }

[profile.release]
debug = true
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs run --chip nRF52833_xxAA --catch-reset --catch-hardfault --allow-erase-all"
# runner = "probe-rs run --chip nRF52833_xxAA --catch-reset --catch-hardfault --allow-erase-all --probe 0d28:0204:990636020005282085E7C008F3731B68000000006E052820"

rustflags = [
"-C", "link-arg=-Tlink.x",
Expand Down
Loading