Skip to content
Snippets Groups Projects
Commit 1dacbdc0 authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Sub-chapters for structure

parent bf56315d
No related branches found
No related tags found
No related merge requests found
# Summary
- [Introduction to embedded development](./ch1_00_introduction.md)
- [Introduction to the hardware](./ch1_01_hardware.md)
- [Introduction to the software](./ch1_02_software.md)
- [Installation of toolchain](./ch2_00_installation.md)
- [Exercises - learning by doing](./ch3_00_exercises.md)
- [Getting started with the hardware](./ch3_01_getting_started.md)
- [Blinking a LED](./ch3_02_blinky.md)
- [Serial port communication](./ch3_03_serial.md)
......@@ -10,163 +10,9 @@ Use-cases ranges from heavy industry to tiny sensors in your everyday life.
## Requirements
1. Computer
2. [Installation](ch2_00_installation.md)
2. USB cable
3. ARM Development board
# Overview
![Embedded workflow](images/workflow_chart.png "Flowchart")
# Hardware
## ARM
While your laptop/stationary computer most likely runs some `x86_64` CPU architecture,
odds are your mobile phone is powered by an ARM processor.
The ARM family of Reduced Instruction Set Computing (RISC) architectures is one of the most prevalent processor architectures.
For more information: [ARM on Wikipedia](https://en.wikipedia.org/wiki/ARM_architecture).
## Registers, IO
A typical way to access and interface with the hardware connected to your microcontroller is by accessing various registers, which is memory regions mapped to some hardware.
## Common Features
To name a few...
//// TODO ////
Feels weird. Move out to exercises and explain there I guess... and maybe not all of them.
### System
#### Clock
#### NVIC (Nested Vector Interrupt Controller)
#### DMA (Direct Memory Access)
### Interfaces
#### Debugging
##### SWD (Serial Wire Debug)
##### JTAG (Joint Test Action Group)
##### ISP / ICSP (In-Circuit Serial Programming)
#### Communication
##### USB (Universal Serial Bus)
##### USART (Universal Synchronous and Asynchronous Receiver-Transmitter)
##### I2C (Inter-Integrated Circuit)
##### SPI (Serial Peripheral Interface)
#### IO (Input Output)
##### GPIO (General Purpose Input Output)
The most rudimentary type of interface but equally the most important. As an output this pin can be **ON** or **OFF**, **TRUE** or **FALSE**, **1** or **0**. And as input this pin goes into High-Z (High impedance) mode, this means that the MCU will check the voltage of the pin and if it is above a certain threshold then it will change the register bit corresponding to the state of the pin to 1 and vice versa.
These are often sharing the same physical pin with special functions such as timers, communication busses and the like. So when booting up an MCU one should specify what function is needed on a particular pin. But beware that all functions can **NOT** be mapped to all pins.
There is also a hardware limit to what can be driven by a GPIO pin. Usually, a pin can deliver about 20mA but that´s it.
##### ADC (Analog to Digital Converter)
## Development board
### STM32 Nucleo-64
# Software
In order to instruct the hardware some sort of software is required.
Software is the instructions for the ARM-processor, telling it which registers and what memory to modify.
## Toolchain
"Toolchain" refers to the collection of hardware and/or software which makes it possible to develop for some specific platform.
The **compiler**, **linker** and some **hardware-interface** are typical tools found in a toolchain.
### Compiler
Two of the main open-source compiler projects:
* GCC (Gnu Compiler Collection) Age: 31 years
* LLVM (originally: Low-Level Virtual Machine) Age: 16 years
In this course LLVM will be used to turn our source code, written in Rust,
into ready to run ARM instructions.
### Linker
The job of the linker is to turn often many output object files of the compiler and combine them into an application.
* LD The GNU linker
* LLD The LLVM project linker
### Bare-metal programming via hardware interfaces
#### GDB / LLDB Debugger
When developing software it is very nice to have control over the execution and being able to inspect both hardware and software state.
The debuggers provides an interface for doing exactly that.
#### OpenOCD
The Open On-Chip Debugger
Quoting its [documentation](http://openocd.org/doc-release/pdf/openocd.pdf):
"The Open On-Chip Debugger (OpenOCD) aims to provide debugging, in-system program-ming and boundary-scan testing for embedded target devices."
#### ST-link
STMicroelectronics provides an in-circuit debugger and programmer for the STM8 and STM32 microcontrollers.
A nice feature of the STM Nucleo development boards is that the programmer is included as part of the device.
But it can also program other microcontrollers via pin headers.
#### Blackmagic probe
An open source hardware debugger supporting JTAG and SWD.
Vendor agnostic
[ST-link github page](https://github.com/blacksphere/blackmagic/wiki)
### Git
Git is a distributed revision control system, most likely most of you have heard of it, maybe even used it.
It allows for convenient collaboration and handles everything from small one-file projects to massive
[projects](https://github.com/torvalds/linux).
### Rust
#### Cargo
The package manager for Rust
Taking care of dependencies, compilation and many other things.
For more information see the [rust documentation](https://doc.rust-lang.org/cargo/).
#### Cargo-binutils
Provides cargo subcommands which invokes various LLVM tools.
##### Usage
See [cargo-binutils repo](https://github.com/rust-embedded/cargo-binutils)
# Introduction to the hardware
## ARM
While your laptop/stationary computer most likely runs some `x86_64` CPU architecture,
odds are your mobile phone is powered by an ARM processor.
The ARM family of Reduced Instruction Set Computing (RISC) architectures is one of the most prevalent processor architectures.
For more information: [ARM on Wikipedia](https://en.wikipedia.org/wiki/ARM_architecture).
## Registers, IO
A typical way to access and interface with the hardware connected to your microcontroller is by accessing various registers, which is memory regions mapped to some hardware.
## Common Features
To name a few...
//// TODO ////
Feels weird. Move out to exercises and explain there I guess... and maybe not all of them.
### System
#### Clock
#### NVIC (Nested Vector Interrupt Controller)
#### DMA (Direct Memory Access)
### Interfaces
#### Debugging
##### SWD (Serial Wire Debug)
##### JTAG (Joint Test Action Group)
##### ISP / ICSP (In-Circuit Serial Programming)
#### Communication
##### USB (Universal Serial Bus)
##### USART (Universal Synchronous and Asynchronous Receiver-Transmitter)
##### I2C (Inter-Integrated Circuit)
##### SPI (Serial Peripheral Interface)
#### IO (Input Output)
##### GPIO (General Purpose Input Output)
The most rudimentary type of interface but equally the most important. As an output this pin can be **ON** or **OFF**, **TRUE** or **FALSE**, **1** or **0**. And as input this pin goes into High-Z (High impedance) mode, this means that the MCU will check the voltage of the pin and if it is above a certain threshold then it will change the register bit corresponding to the state of the pin to 1 and vice versa.
These are often sharing the same physical pin with special functions such as timers, communication busses and the like. So when booting up an MCU one should specify what function is needed on a particular pin. But beware that all functions can **NOT** be mapped to all pins.
There is also a hardware limit to what can be driven by a GPIO pin. Usually, a pin can deliver about 20mA but that´s it.
##### ADC (Analog to Digital Converter)
## Development board
### STM32 Nucleo-64
# Introduction to the software
In order to instruct the hardware some sort of software is required.
Software is the instructions for the ARM-processor, telling it which registers and what memory to modify.
## Toolchain
"Toolchain" refers to the collection of hardware and/or software which makes it possible to develop for some specific platform.
The **compiler**, **linker** and some **hardware-interface** are typical tools found in a toolchain.
### Compiler
Two of the main open-source compiler projects:
* GCC (Gnu Compiler Collection) Age: 31 years
* LLVM (originally: Low-Level Virtual Machine) Age: 16 years
In this course LLVM will be used to turn our source code, written in Rust,
into ready to run ARM instructions.
### Linker
The job of the linker is to turn often many output object files of the compiler and combine them into an application.
* LD The GNU linker
* LLD The LLVM project linker
### Bare-metal programming via hardware interfaces
#### GDB / LLDB Debugger
When developing software it is very nice to have control over the execution and being able to inspect both hardware and software state.
The debuggers provides an interface for doing exactly that.
#### OpenOCD
The Open On-Chip Debugger
Quoting its [documentation](http://openocd.org/doc-release/pdf/openocd.pdf):
"The Open On-Chip Debugger (OpenOCD) aims to provide debugging, in-system programming and boundary-scan testing for embedded target devices."
#### ST-link
STMicroelectronics provides an in-circuit debugger and programmer for the STM8 and STM32 microcontrollers.
A nice feature of the STM Nucleo development boards is that the programmer is included as part of the device.
But it can also program other microcontrollers via pin headers.
#### Blackmagic probe
An open source hardware debugger supporting JTAG and SWD.
Vendor agnostic
[ST-link github page](https://github.com/blacksphere/blackmagic/wiki)
### Git
Git is a distributed revision control system, most likely most of you have heard of it, maybe even used it.
It allows for convenient collaboration and handles everything from small one-file projects to massive
[projects](https://github.com/torvalds/linux).
### Rust
#### Cargo
The package manager for Rust
Taking care of dependencies, compilation and many other things.
For more information see the [rust documentation](https://doc.rust-lang.org/cargo/).
#### Cargo-binutils
Provides cargo subcommands which invokes various LLVM tools.
##### Usage
See [cargo-binutils repo](https://github.com/rust-embedded/cargo-binutils)
# Exercises - learning by doing
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment