Zephyr RTOS: Under 1KB of RAM
summary
Zephyr compiles and runs with under 1 KB of RAM by combining linker/device-tree tweaks, compiler -Oz, and targeted code removal; the kernel itself drops to about 128 B and the final firmware measures ~892 B RAM. Analysis uses west RAM/ROM reports, pcov/poke tools, stack canaries and fake device-tree RAM to find a 112 B dummy-thread cost and stack consumers (sleep ~216 B, mutex ~248 B). A custom system-timer replaces missing SysTick and I2C target + ADC work, with measured sleep current under 2 µA.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 1:04Current RAM usage
- 3:35Porting to MSPM0 CX
- 5:23Initial optimizations
- 7:10Low-hanging fruit
- 7:55Execute-in-place RAM
- 8:36Memory analysis tools
- 10:21RAM report limits
- 11:02RAM layout with report
- 13:07Data section variables
- 15:34Boot and thread init
- 17:22Dummy thread impact
- 18:49Remove dummy thread
- 21:59Final optimizations
- 22:41Debug hello world
- 23:46SysTick-less timer
- 25:29I2C under 1KB RAM
- 27:15Stack overflow analysis
- 29:00Stack canary method
- 31:12I2C scan optimizations
- 31:55Kernel optimizations
- 33:25Q&A
related talks
41mZephyr RTOS: Under 1KB of RAM
51mDemystifying Memory: A Practical Tutorial on Managing & Optimizing Memory in Zephyr
34mZephyr Footprint – Where Are We and Where Are We Going
43mFrom Code To Current: Reducing Energy Consumption in Zephyr
49mEmbedded Linux Size Reduction Techniques
40mInspecting and Optimizing Memory Usage in Linux
43mEmbedded Elixir in Action
30mZephyr Accelerates Tools for Testing External Display Support
