---
# System prepended metadata

title: no_std training update

---

# no_std training update

## Approach

- One person working on the write up at one time
    - We decided doing this in parallel will create more work than it saves
- Guidelines for writing (things to have in your head whilst writing):
    - Emphasis on why where possible
        - This doesn't mean explain why we're doing every step, but if there is an important time thing we can explain why we're doing it, e.g initializing esp-rtos might not seem obvious that esp-radio needs it
    - Keep in mind the prerequisites of the user and content we already cover in the book
        - Don't dupicate work we've already done, and don't explain things we've listed as prerequisite knowledge
    - Consistent voice
        - We must appear as a unified voice in our writing
        - We should pick a style (1st person, 3rd etc) and be consistent accross all chapters.
            - SM: I suggest using the same style as the book 

## Chapter Outlines

### Introduction

- Pretty much what we have in the current version with some minor adjustments:
    - Remove std references

### Prerequisites

- [Rust Knowledge](https://docs.espressif.com/projects/rust/no_std-training/01_intro.html#rust-knowledge)
- [Required Hardware](https://docs.espressif.com/projects/rust/no_std-training/02_0_preparations.html#required-hardware)
- The [checking the hardware](https://docs.espressif.com/projects/rust/no_std-training/02_1_hardware.html) might be useful to keep it
- [Software](https://docs.espressif.com/projects/rust/no_std-training/02_2_software.html)
- [Workshop repository](https://docs.espressif.com/projects/rust/no_std-training/02_3_repository.html)
- [Hello World](https://docs.espressif.com/projects/rust/no_std-training/02_4_hello_world.html)

### Building a Data Logger Application

#### Project Overview

- What will the app do?
    - Briefly summarize the chapters

#### Project Setup

- Mention esp-generate again?
- Explain the differnt files:
    - rust-toolchain.toml
    - .cargo/config.toml
        - Explain linker flags?
        - Explain custom runner
        - Explain log level env
        - Explain target
    - Cargo.toml? Should we explain some of our deps and what they do?
- Explain that some parts consist of multiple modules
- Explain some boilerplate code: 
    - https://github.com/esp-rs/no_std-training/blob/feat/overhaul/project/part1/src/main.rs#L4-L11
    - App descriptor
    - `#[esp_rtos::main]`

#### (part1) Reading Sensor Data 

- Explain initialization
    - `esp_hal::init`
    - `esp_rtos::start`
    - Drivers
        - `with_<>`
        - `Into_async`
- How to read data from the sensor?
    - Link to the datasheet

#### (part2) Wi-Fi Connectivity

- Why do we need `esp-alloc`
- How to initalize network stack
    - Why static?
    - Embassy config
- Explain that we moved part of part1 code to the sensor module
    - Go through the modules
- Why do we use tasks?
- Environment variables to set SSID, password

#### (part3) Publishing Data to an MQTT Broker

- Explain that we reverted the Wifi-Provisioning part
    - Maybe this should be reworked so the project grows organically and the flow of explanation is weird but not sure how to do it
- MQTT initialization
- MQTT task

#### (part4) Wi-Fi Provisioning & Integrating Wi-Fi Provisioning

- Explain Wi-FI provisioning
    - Mention that usually is done via AP or BLE
- Explain STA/AP config
- Explain different task and why we need
- Note about the assets/templates

#### (part5) Over-the-Air Updates

- How to create the partition table
- How to create the app bin
- Providing the bin via HTTP

#### Wrapping Up

### Bonus Chapters

- Using SNTP to get network time and setting the RTC
- Configuring watchdog timers
- Connecting a SPI display (as suggested by @bjoernQ)
- NVS/Config handling.
