Skip to content

sharris416/esp32-kernel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ESP32 Minimal Kernel

Educational cooperative multitasking kernel for ESP32.

Quick Start

# On your computer
cd ~/workspace

# Remove old version if it exists
rm -rf esp32_kernel

# Download and extract the clean version to ~/workspace/esp32_kernel

# Build and flash
cd ~/workspace/esp32_kernel
. ~/esp/esp-idf/export.sh
idf.py build
idf.py -p /dev/ttyUSB0 flash monitor

Project Structure

esp32_kernel/
β”œβ”€β”€ CMakeLists.txt          # Top-level build config
β”œβ”€β”€ main/
β”‚   β”œβ”€β”€ CMakeLists.txt      # Component build config
β”‚   β”œβ”€β”€ main.c              # Three example tasks
β”‚   β”œβ”€β”€ kernel.c            # Simple kernel functions
β”‚   β”œβ”€β”€ kernel.h            # Kernel API
β”‚   β”œβ”€β”€ uart.c              # UART implementation
β”‚   └── uart.h              # UART interface
└── README.md               # This file

Expected Output

========================================
  ESP32 Minimal Bare-Metal Kernel
========================================

Kernel initialized
All tasks created!
=== Kernel running ===

[BLINK] LED OFF (tick=0)
[COUNT] Reached 10
[BLINK] LED ON (tick=500)
[MONITOR] === System Status ===
[MONITOR] Ticks: 1000
[MONITOR] Counter: 85

What's Inside

Three tasks demonstrating cooperative multitasking:

  • Blinker: Toggles LED state every 500ms
  • Counter: Increments counter, reports every 10
  • Monitor: Prints system status every second

Troubleshooting

Build errors: Make sure ESP-IDF is sourced

. ~/esp/esp-idf/export.sh

Port not found: Check your USB port

ls /dev/ttyUSB*
# Use the port you see (might be ttyUSB0, ttyUSB1, or ttyACM0)

Permission denied:

sudo chmod 666 /dev/ttyUSB0

Week 1 Goals

  • βœ… Get kernel building and running
  • βœ… Understand the three tasks
  • βœ… See cooperative multitasking in action
  • πŸ“ Document your observations

Good luck! πŸš€

About

Bare-metal cooperative kernel for ESP32 - TinyML swarm research infrastructure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published