docs

a slatepencil documentail site

View on GitHub

Internet of things

Von Neumann Basic Structure

CPU (Centrol Processing Unit)

Basic CPU structure

ARM - Cortex M Core registers

Register data constantly changes, data is loaded in from memroy, results are stored back to memory

Application Binary Interface(ABI) provides architecture details to Compiler/Software Programmer

CPU Registers

Register Definition Files

Platform File that provides interface to peripheral memory by specifying

Peripheral Access Methods used to read/write data

Flash, SRAM, Peripherals, GPIO are platform dependent, details on platform specific registers can be put in C-Programming source files(Register Definition Files)

Compilation tracks and maps memory needs program code and data into segments, which are specified in the Linker file

Use Pointers(address) !!!

System Memories

Memory-mapped I/O is a technique where peripheral registers are mapped to specific memory addresses in the microcontroller’s address space. By reading from and writing to these memory addresses, developers can access and control peripheral functionality directly. memory-mapped peripheral registers in embedded systems are special registers that map physical addresses to control peripheral devices

In embedded systems programming, the memory address of a peripheral register is typically calculated by adding the register’s offset (specified in the device datasheet or reference manual) to the base address of the peripheral. This allows direct access to the register’s memory location

Memory Map provides a memory address to physical device mapping within an address space for use in programming

Linker file maps physical memory regions to compiled memory sections, the compiled memory sections of a compiled executable will be relocated by referencing a symbol name. linker file provides physical address to symbol mapping

Memory Map

Memory Hierarchy

*       Registers
**      Cache(L1/L2/L3)
***     RAM(SRAM/DRAM)
****    Flash/EEPROM
*****   HDD(Hard Drives)
******  Tape

Top 4 layer are used in Embedded systems,
layers towards top are expensive, fast(low latency), small capacity,
towards bottom  are cheap, slow(high latency), large capacity
Typically FLASH stores program's code instruction
RAM stores program's data

Memory Segments

Memory Segments

Data Segments

Data Allocation

int A_BSS:
int B_BSS = 0;
int C_DATA = 1;
const int D_RODATA = 1;

void foo(int E_STACK_REG) {
    int F_STACK_REG;
    int G_STACK_REG = 1;
    static int H_BSS;
    static int I_BSS = 0;
    static int J_DATA = 1;
    char * ptr_STACK_REG;
    ptr_STACK_REG = (char *) malloc(8);
    /* more code */
    free((void *)ptr_STACK_REG);
    return;
}

Memory organization

Microcontroller Memory

Volatile Memories Non-Volatile Memories
SRAM ROM/PROM/EPROM/EEPROM
DRAM FLASH
SDRAM DISK
Register(most) Tape

Interface methods for hardware

Embedded Hardware Interface

Embedded system architecture

Embedded system board

Technical Reference Material

Sensors Introduction

Platforms