siro20 / teensy-template

Teensy 3.X Project Template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Teensy 3.X Project Template with USB EHCI debug support

Thanks

Many thanks to Austin Morton for the great Teensy 3.X project template.

Purpose

An easy starting point for a Teensy 3.X project for dbgp devices. The Teensy shows up as debug device and the kernel module usb_debug allows to use it as serial bridge.

Note: You need a USB high speed capable Teensy to use it on an EHCI debug port. It doesn't work with Teensy LC.

Setup

Install the Teensy udev rule: sudo cp tools/49-teensy.rules /etc/udev/rules.d/

Then unplug your Teensy and plug it back in.

Connect a TTL UART to Serial2 running at 115200.

Using

  1. Put your code in src/main.cpp
  2. Put any libraries you need in libraries
  3. Set the TEENSY variable in Makefile according to your teensy version
  4. Build your code make
  5. Upload your code make upload

Make Targets

  • make alias for make hex
  • make build compiles everything and produces a .elf
  • make hex converts the elf to an intel hex file
  • make post_compile opens the launcher with the correct file
  • make upload uploads the hex file to a teensy board
  • make reboot reboots the teensy

Where everything came from

  • The teensy3 sub-folder is taken from The Teensy 3 Cores
  • The tools sub-folder is taken from Teensyduino
  • The src/main.cpp file is moved, unmodified from teensy3/main.cpp
  • The Makefile file is moved, modified from teensy3/Makefile
  • The 49-teensy.rules file is taken from PJRC's udev rules

Modifications to Makefile include

  • Add support for arduino libraries
  • Change tools directory
  • Calculate target name from current directory
  • Prettify rule output
  • Do not upload by default, only build
  • Changed default target to Teensy LC
  • Set default USB stack to EHCI_DEBUG

About

Teensy 3.X Project Template


Languages

Language:C 63.6%Language:C++ 35.6%Language:Assembly 0.5%Language:Makefile 0.3%