Skip to content

Commit 5a6fec4

Browse files
committed
Suggested PR fixes
1 parent 338457a commit 5a6fec4

File tree

19 files changed

+43
-63
lines changed

19 files changed

+43
-63
lines changed

README.md

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Every nRF chip has its own crate, listed below:
3434
| [`nRF52833`](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52833) | [`v1.3`](https://infocenter.nordicsemi.com/pdf/nRF52833_PS_v1.3.pdf) | [`v1.0.1`](http://infocenter.nordicsemi.com/pdf/nRF52833_DK_User_Guide_v1.0.1.pdf) |
3535
| [`nRF52840`](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52840) | [`v1.1`](https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.1.pdf) | [`v1.2`](https://infocenter.nordicsemi.com/pdf/nRF52840_DK_User_Guide_v1.2.pdf) |
3636
| [`nRF9160`](https://www.nordicsemi.com/Products/Low-power-cellular-IoT/nRF9160) | [`v2.0`](https://infocenter.nordicsemi.com/pdf/nRF9160_PS_v2.0.pdf) | [`v0.9.3`](https://infocenter.nordicsemi.com/pdf/nRF9160_DK_HW_User_Guide_v0.9.3.pdf) |
37-
\* These devices do not have a seperate developement kit and share the [NRF52 DK](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52-DK)
37+
\* These devices do not have a separate development kit and share the [NRF52 DK](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52-DK)
3838

3939
## License
4040

@@ -71,6 +71,7 @@ Here follows a brief description of each demo for quick reference. For a more in
7171
| [qdec-demo](./qdec-demo/README.md) | Sensor Decoding | Quadrature sensor decoder (QDEC) demo |
7272
| [rtic-demo](./rtic-demo/README.md) | Framework | The Real-Time Interrupt-driven Concurrency framework demo |
7373
| [spi-demo](./spi-demo/README.md) | Digital Pins | Serial peripheral interface master (SPIM) with EasyDMA demo |
74+
| [spis-demo](./spis-demo/README.md) | Digital Pins | Serial peripheral interface slave (SPIS) demo |
7475
| [twi-ssd1306](./twi-ssd1306/README.md) | Digital Pins | I2C compatible Two-Wire Interface with the SSD1306 OLED Display demo |
7576
| [twim-demo](./twim-demo/README.md) | Digital Pins | I2C compatible Two-Wire Interface Master mode demo |
7677
| [twis-demo](./twis-demo/README.md) | Digital Pins | I2C compatible Two-Wire Interface Slave mode demo |
@@ -79,41 +80,20 @@ Here follows a brief description of each demo for quick reference. For a more in
7980

8081
## Running the Examples
8182

82-
Each demo readme should contain instructions on how to run it. However, the information below describes the technologies used and can be used to troubleshoot your system setup. Run the demos from within their respective project directories. E.g. to run `ccm-demo`, you must be in the `nrf-hal/examples/ccm-demo/` directory and run `cargo run`.
83+
Each demo readme should contain instructions on how to run it. However, the information below describes the technologies used and can be used to troubleshoot your system setup. Run the demos from within their respective project directories. E.g. to run `ccm-demo`, you must be in the `nrf-hal/examples/ccm-demo/` directory.
8384
> Since the demos are stand-alone projects you would **NOT** typically run them with `cargo run --example xyz-demo` like some cargo projects are configured to do.
8485
85-
There are many ways to setup programming and debugging with an embedded device. Here we will describe how to do this on the nRF52840-DK using the [probe-rs](https://probe.rs/) set of tools.
86-
8786
### Once Off System Setup
8887

89-
Install the cross compilation toolchain to target the device.
88+
Install the cross compilation toolchain to target your device. You would typically pass the target as a parameter to cargo or explicitly set it in your cargo config file. If you get compilation errors about `eh_personality` then you have not set the target correctly. Here is an example of the target for a nRF52840 chip:
9089
```console
9190
$ rustup target add thumbv7em-none-eabihf
9291
```
93-
Install the tools to program and run on the device. See [probe-rs](https://github.com/probe-rs/probe-rs) for more details on other required dependencies.
92+
Install the tools to flash the device.
9493
```console
95-
$ cargo install probe-run
94+
$ cargo install cargo-embed
9695
```
9796

9897
### For Every Project (optional)
9998

100-
Optional if you want to use `cargo run` and `cargo check` without extra args. Setup your `.cargo/config` file (create one in the project root if it does not exist. E.g., `nrf-hal/examples/ccm-demo/.cargo/config`). This example will call the prope-run executable configured for the nrf52840 chip when you call `cargo run`:
101-
```
102-
[target.thumbv7em-none-eabihf]
103-
runner = "probe-run --chip nRF52840_xxAA"
104-
105-
[build]
106-
target = "thumbv7em-none-eabihf"
107-
```
108-
Setup the `Cargo.toml` file to use the correct features. Features allow for conditional compilation which is essential for a library like this that supports multiple different devices. Under the `[features]` section add the following line `default = ["52840"]` for the nRF52840-DK device. This is optional but it will allow you to simply call `cargo run` and `cargo build` instead of `cargo run --features 52840` and `cargo build --features 52840` respectively. Note that some demo projects do not have features so this step may not be necessary. If you get a whole bunch of compilation errors then check that you have set the default features correctly.
109-
110-
### To Run
111-
112-
Plug in your device (on the nRF52840-DK it is the J2 usb port)
113-
`cargo run`
114-
This will flash the device, reset it and send `rprintln!` debug messages from the device to the terminal automatically.
115-
116-
### An Alternative to probe-run. Try cargo embed
117-
118-
You can also use `cargo embed` instead of the probe-run tool to flash the demos to your device. This tool uses the `Embed.toml` file to configure logging and other device characteristics and can be installed by running `cargo install cargo-embed`. The editing of `Cargo.toml` to set the default features still apply but you can pass them into the `cargo embed` tool instead if you wish. Some of the demo readme files show examples of command line arguments to pass to the tool without any additional configuration.
119-
99+
Setup the `Cargo.toml` file to use the correct features. Features allow for conditional compilation which is essential for a library like this that supports multiple different devices. Under the `[features]` section add the following line `default = ["52840"]` for the nRF52840-DK device or whatever other feature is applicable for your device. This is optional but it will allow you to simply call `cargo run` and `cargo build` instead of `cargo run --features 52840` and `cargo build --features 52840` respectively. Note that some demo projects do not have features so this step may not be necessary. If you get a whole bunch of compilation errors or plugins like rust-analyzer are not working then check that you have set the chip features correctly.

examples/blinky-button-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# The blinky button demo
1+
# Blinky button demo
22

33
This hello world example turns on LED 1 when you press Button 1 on the nrf52-dk (PCA10040).
4-
> You will have to change the pin numbers if you use a nRF52840-DK device.
4+
> Note: You will have to change the pin numbers if you use a different device.
55
66
## Set up with `cargo-embed`
77

examples/ccm-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# The cipher block chaining - message authentication code (CCM) mode demo - Encryption
1+
# CCM encryption demo
22

3-
This demo initialises a text message of the maximum size of 251 bytes and encrypts and decrypts it, measuring the time it takes. It then repeats the process with smaller and smaller chunks of data to demonstrate how long smaller packets take to process.
3+
This CCM (cipher block chaining) encryption demo initialises a text message of the maximum size of 251 bytes and encrypts and decrypts it, measuring the time it takes. It then repeats the process with smaller and smaller chunks of data to demonstrate how long smaller packets take to process.
44

55
## How to run
66

examples/comp-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# The comparator peripheral demo - Analog Pins
1+
# Comp demo
22

3-
This demo uses the comp peripheral to compare the differential voltages between two pins. If the voltage on Pin 30 is higher than Pin 31 (reference voltage) the built in LED will switch off otherwise it will switch on. The demo uses `nrf52840-hal` but this can be swapped out with an alternative if required.
3+
This demo uses the Comparator (comp) peripheral to compare the differential voltages between two pins. If the voltage on Pin 30 is higher than Pin 31 (reference voltage) the built in LED will switch off otherwise it will switch on. The demo uses `nrf52840-hal` but this can be swapped out with an alternative if required.
44

55
## How to run
66

examples/ecb-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# AES electronic codebook mode encryption demo - Encryption
1+
# ECB encryption demo
22

3-
Blocking 128-bit AES encryption of 16 bytes of data using a 16 byte key. Encryption only, no decryption.
3+
The AES electronic codebook mode (ECB) demo demonstrates a blocking 128-bit AES encryption of 16 bytes of data using a 16 byte key. Encryption only, no decryption.
44

55
## How to run
66

examples/gpiote-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# General-Purpose Input Output Tasks and Events module demo - Digital Pins
1+
# Gpiote demo
22

3-
This demo targets the nRF52840-DK in particular because of the 4 available hardware buttons on the board itself. The demo shows how you can use the `cortex-m-rtic` crate to easily debounce some buttons without blocking the CPU. GPIO pin state changes fire events which can be used to carry out tasks. This showcases the PPI (programmable peripheral interconnect) system for which there is also a dedicated demo.
3+
The General-Purpose Input Output Tasks and Events (gpiote) module demo targets the nRF52840-DK in particular because of the 4 available hardware buttons on the board itself. The demo shows how you can use the `cortex-m-rtic` crate to easily debounce some buttons without blocking the CPU. GPIO pin state changes fire events which can be used to carry out tasks. This showcases the PPI (programmable peripheral interconnect) system for which there is also a dedicated demo.
44

55
## How to run
66

examples/i2s-controller-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Inter-IC Sound interface "controller mode (aka master mode)" - Digital Pins
1+
# I2S controller demo
22

3-
This demo generates Morse code audio signals from text received over UART and plays them back over I2S. Tested with nRF52840-DK and a UDA1334a DAC.
3+
The Inter-IC Sound interface (I2S) controller mode (aka master mode) demo. This demo generates Morse code audio signals from text received over UART and plays them back over I2S. Tested with nRF52840-DK and a UDA1334a DAC.
44

55
## How to run
66

examples/i2s-peripheral-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Inter-IC Sound interface "peripheral mode (aka slave mode)" demo - Digital Pins
1+
# I2S peripheral demo
22

3-
This demonstrates full duplex communication between a controller and peripheral mode I2S peripheral using the EasyDMA capabilities of the chip. This targets the nrf52840 family of devices.
3+
The Inter-IC Sound interface (I2S) peripheral mode (aka slave mode) demo. This demonstrates full duplex communication between a controller and peripheral mode I2S peripheral using the EasyDMA capabilities of the chip. This targets the nrf52840 family of devices.
44

55
## How to run
66

examples/lpcomp-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Low power voltage comparator demo - Analog Pins
1+
# Lpcomp demo
22

3-
This demo shows how you would keep the device in low power mode and power it up when an analog voltage on a pin changes with respect to a voltage on a reference pin. This targets the nrf52840 family of devices.
3+
This low power voltage comparator (lpcomp) demo shows how you would keep the device in low power mode and power it up when an analog voltage on a pin changes with respect to a voltage on a reference pin. This targets the nrf52840 family of devices.
44

55
## How to run
66

examples/ppi-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Programmable peripheral interconnect (PPI) demo - Channels
1+
# PPI demo
22

3-
The PPI allows peripherals to interact with each other without having to go through the CPU. Note that you need to choose a default feature in order for this demo to build. See above. This demo uses the Bluetooth RADIO peripheral as an example but does nothing special with Bluetooth itself so this is not the demo to learn about that capability.
3+
The Programmable Peripheral Interconnect (PPI) allows peripherals to interact with each other without having to go through the CPU. Note that you need to choose a chip feature in order for this demo to build. See above. This demo uses the Bluetooth RADIO peripheral as an example but does nothing special with Bluetooth itself so this is not the demo to learn about that capability.
44

55
## How to run
66

0 commit comments

Comments
 (0)