This repository contains bare-metal (no Arduino compatibility) C code written from scratch based on the reference manuals. It's aimed to be heavily commented to allow a smooth start for C-developers diving into embedded coding with the Teensy.
The code is split into two parts:
- common contains general-purpose/framework code, Makefile, linker script etc. shared amongst the different examples.
- src has subdirectories with different examples.
To start experimenting yourself, simply create a new subfolder in src and create a symlink Makefile -> ../../common/Makefile.
- GNU make
- GCC arm-none-eabi
- libusb (for teensy_loader_cli)
On Debian/Ubuntu, the following should install the necessary requirements:
apt-get install build-essential gcc-arm-none-eabi libusb-dev
If you did not use --recursive
when cloning, don't forget to init submodules (for teensy_loader_cli):
git submodule init
git submodule update
You should now be able to run make build
in any of the examples in src. Use make load
to also load the resulting hex file with teensy_loader_cli.
- Kinetis Peripheral Module Quick Reference (KQRUG)
Highly recommended read as it explains a lot of the components of the Kinetis family MCUs with concrete examples. - K20 Sub-Family Reference Manual (K20P64M72SF1RM)
Reference manual of the MK20DX256VLH7 processor used in the Teensy 3.1/3.2 - K20 Sub-Family Datasheet (K20P64M72SF1)
Operating characteristics, package pinouts. - ARM Cortex‑M4 Processor Technical Reference Manual
Reference for the Cortex-M4. The interesting bits are however mostly in the ARMv7-M architecture reference. - ARMv7-M Architecture Reference Manual
This contains everything about the ARM-specific parts of the Kinetis MCU. This for example includes the NVIC or MPU. - Teensy Schematic