Merge branch 'edit-beginner-book' of github.com:ferrous-systems/embedded-trainings-2020 into edit-book

This commit is contained in:
Mirabellensaft 2020-07-09 12:18:59 +02:00
commit bcd5df0035
20 changed files with 67 additions and 21 deletions

View file

@ -1,18 +0,0 @@
# Summary
- [Intro](./intro.md)
- [Hardware](./hardware.md)
- [Parts of an Embedded Program](./parts-embedded-programm.md)
- [Building an Embedded Program](./building-programm.md)
- [Flashing the Program](./flashing-programm.md)
- [Viewing Logs](./viewing-logs.md)
- [Runnging the Program from VS Code](./running-from-vsc.md)
- [Panicking](./panicking.md)
- [Using a Hardware Abstraction Layer](./using-hal.md)
- [Timers and Time](./time.md)
- [nRF52840 Dongle](./dongle.md)
- [Radio Out](./radio-out.md)
- [Radio In ](./radio-in.md)
- [Radio Puzzle](./radio-puzzle.md)
- [Starting a Project from Scatch](./from-scatch.md)
- [References and Ressources](./references-ressources.md)

View file

@ -0,0 +1,44 @@
# Summary
- [Intro](./intro.md)
- [Hardware](./hardware.md)
- [Beginner Workbook](./beginner-workbook.md)
- [Parts of an Embedded Program](./parts-embedded-programm.md)
- [Building an Embedded Program](./building-programm.md)
- [Flashing the Program](./flashing-programm.md)
- [Viewing Logs](./viewing-logs.md)
- [Runnging the Program from VS Code](./running-from-vsc.md)
- [Panicking](./panicking.md)
- [Using a Hardware Abstraction Layer](./using-hal.md)
- [Timers and Time](./time.md)
- [nRF52840 Dongle](./dongle.md)
- [Radio Out](./radio-out.md)
- [Radio In ](./radio-in.md)
- [Radio Puzzle](./radio-puzzle.md)
- [Starting a Project from Scatch](./from-scatch.md)
- [Advanced Workbook](./advanced-workbook.md)
- [Code Organization](./code-organisation.md)
- [Listing USB Devices](./listing-usb-devices.md)
- [Hello, world!](./hello-world.md)
- [Checking the API documentation](./api-documentation.md)
- [RTIC hello](./rtic-hello.md)
- [Dealing with Registers](./dealing-with-registers.md)
- [Event Handling](./event-handling.md)
- [Task State](./task-state.md)
- [USB Enumeration](./usb-enumeration.md)
- [Dealing with USB Events](./usb-events.md)
- [USB Endpoints](./usb-endpoints.md)
- [Control Transfers](./control-transfers.md)
- [SETUP Stage](./setup-stage.md)
- [Device Descriptor](./device-descriptor.md)
- [DATA Stage](./data-stage.md)
- [DMA](./dma.md)
- [More Standard Requests](./more-standart-requests.md)
- [Error Handling](./error-handling.md)
- [Device State](./device-state.md)
- [SET_ADDRESS](./set-address.md)
- [GET_DESCRIPTOR Configuration](./get-descriptor-config.md)
- [Interface](./interface.md)
- [Configuration Descriptor](./configuration-descriptor.md)
- [Interface Descriptor](./interface-descriptor.md)
- [References and Ressources](./references-ressources.md)

View file

@ -1,5 +1,8 @@
# Building an Embedded Program
[❗Intro ]
[❗Do you want the people to use this command?]
The following command cross compiles the program to the ARM Cortex-M4 architecture. The `--target` arguments instructs Cargo to cross compile the program.

View file

@ -4,6 +4,8 @@ In this workshop we'll use both the nRF52840 Development Kit (DK) and the nRF528
For the span of this workshop keep the nRF52840 DK connected to your PC using a micro-USB cable. Connect the USB cable to the J2 port on the nRF52840 DK. Instructions to identify the USB ports on the nRF52840 board can be found in the top level README file.
[❗link or crosspost J2 instructions, for less clicking]
## The nRF52840
Some details about the nRF52840 microcontroller that are relevant to this workshop.

View file

@ -4,3 +4,9 @@
### in development
❗️ To do
### in Production
## About the Course

View file

@ -1,5 +1,6 @@
# Parts of an Embedded Program
[❗Intro ]
Open the `beginner/apps` folder in VS Code.
``` console
@ -10,11 +11,16 @@ $ code beginner/apps
Then open the `src/bin/hello.rs` file.
If you find it more convenient to open the repository at the root then please also add the `beginner/apps` folder to the VS Code workspace: right click the left side panel, select "Add folder to workspace" and add the `beginner/apps` folder.
[❗No optional way of doing things here]
Note the differences between this embedded program and a desktop program:
The `#![no_std]` attribute indicates that the program will not make use of the standard library, `std` crate. Instead it will use the `core` library, a subset of the standard library that does not on a underlying operating system (OS).
[❗Have a non embedded program up to compare]
The `#![no_std]` attribute indicates that the program will not make use of the standard library, `std` crate. Instead it will use the `core` library, a subset of the standard library that does depend not on a underlying operating system (OS).
The `#![no_main]` attribute indicates that the program will use a custom entry point instead of the default `fn main() { .. }` one.
The `#[entry]` attribute declares the custom entry point of the program. The entry point must be a divergent function; note that the return type is the never type `!`. The function is not allowed to return; therefore the program is not allowed to terminate.

View file

@ -26,4 +26,4 @@ stack backtrace:
`cargo run` will compile the application and then invoke the `dk-run` tool with its argument set to the path of the output ELF file.
Unlike `cargo-embed`, `dk-run` will terminate when the program reaches a breakpoint (`asm::bkpt`) that halts the device. Before exiting `dk-run` will print a stack backtrace of the program starting from the breakpoint. This can be used to write small test programs that are meant to perform some work and then terminate.
Unlike `cargo-embed`, `dk-run` will terminate when the program reaches a breakpoint (`asm::bkpt`) that halts the device. Before exiting, `dk-run` will print a stack backtrace of the program starting from the breakpoint. This can be used to write small test programs that are meant to perform some work and then terminate.

View file

@ -10,4 +10,6 @@ This program will blink (turn on and off) one of the LEDs on the board. The time
The other time related API exposed by the `dk` HAL is the `dk::uptime` function. This function returns the time that has elapsed since the call to the `dk::init` function. This function is used in the program to log the time of each LED toggle operation.
Next, we'll look into the radio API exposed by the `dk` HAL. But before that we'll need to set up the nRF52840 Dongle.
Next, we'll look into the radio API exposed by the `dk` HAL. But before that we'll need to set up the nRF52840 Dongle.
[❗assignment to chnge something]

View file

@ -1,5 +1,6 @@
# Using a Hardware Abstraction Layer
[❗Idea: explain HAL, run program, open doc with an assignment to change led pattern]
In this section we'll start using the hardware features of the nRF52840 and the board.
Open the `src/bin/led.rs` file.