From 1dacbdc0b2fd110694f512aec23ae6443e570d32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= <henrik@tjaders.com>
Date: Fri, 19 Apr 2019 23:13:43 +0200
Subject: [PATCH] Sub-chapters for structure

---
 src/SUMMARY.md             |   9 ++-
 src/ch1_00_introduction.md | 158 +------------------------------------
 src/ch1_01_hardware.md     |  67 ++++++++++++++++
 src/ch1_02_software.md     |  88 +++++++++++++++++++++
 src/ch3_00_exercises.md    |   1 +
 5 files changed, 164 insertions(+), 159 deletions(-)
 create mode 100644 src/ch1_01_hardware.md
 create mode 100644 src/ch1_02_software.md
 create mode 100644 src/ch3_00_exercises.md

diff --git a/src/SUMMARY.md b/src/SUMMARY.md
index 26b2f68..b5247a6 100644
--- a/src/SUMMARY.md
+++ b/src/SUMMARY.md
@@ -1,7 +1,10 @@
 # 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)
-- [Getting started with the hardware](./ch3_01_getting_started.md)
-- [Blinking a LED](./ch3_02_blinky.md)
-- [Serial port communication](./ch3_03_serial.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)
diff --git a/src/ch1_00_introduction.md b/src/ch1_00_introduction.md
index 3f8656e..a7f1541 100644
--- a/src/ch1_00_introduction.md
+++ b/src/ch1_00_introduction.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)
diff --git a/src/ch1_01_hardware.md b/src/ch1_01_hardware.md
new file mode 100644
index 0000000..167d7fc
--- /dev/null
+++ b/src/ch1_01_hardware.md
@@ -0,0 +1,67 @@
+# 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
+
+
diff --git a/src/ch1_02_software.md b/src/ch1_02_software.md
new file mode 100644
index 0000000..f3820ac
--- /dev/null
+++ b/src/ch1_02_software.md
@@ -0,0 +1,88 @@
+# 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)
diff --git a/src/ch3_00_exercises.md b/src/ch3_00_exercises.md
new file mode 100644
index 0000000..982d022
--- /dev/null
+++ b/src/ch3_00_exercises.md
@@ -0,0 +1 @@
+# Exercises - learning by doing
-- 
GitLab