Giter VIP home page Giter VIP logo

teensy-template's Introduction

Teensy 3.X Project Template

Purpose

An easy starting point for a Teensy 3.X project which might not fit inside the arduino build environment.

Reasons to Use

  • You need to modify the teensy core
  • You don't love Java IDE's
  • You love Make
  • Because

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.

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

teensy-template's People

Contributors

apmorton avatar sebkuzminsky avatar wilhelmy avatar wilywampa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teensy-template's Issues

Teensy 3.1 update?

This template is a great way to get started without needing a GUI. I just tried to upload the app to a teensy 3.1. The uploader reports an error that the binary was built for the "Teensy 3.0 (MX20DX128)" and the hardware is "Teensy 3.1 (MK20DX256)". Can the template be updated for use with the Teensy 3.1?

Make not working after clone on OSX

I must be missing something but I get:

$ make
[CXX]   src/main.cpp
/bin/sh: /Users/olivier/Dropbox/Developer/arduino/teensy-template/tools/arm-none-eabi/bin/arm-none-eabi-g++: cannot execute binary file
make: *** [/Users/olivier/Dropbox/Developer/arduino/teensy-template/build/src/main.o] Error 126

After cloning the project.

Add support for OSX

Would be great to have support for OSX, I've added symlinks in my folder and it works well. Maybe you could add a make init to properly link/copy the libs from the OS-dependant location?

$ ls -l
teensy3 -> /Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/
tools -> /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/

Request: Teensy LC Support

This template has been great for Teensy 3.1 projects. Has there been any planning or work done to support the new Teensy LC board? (Core MKL26Z64)

Remove GCC toolchain

Do we really need the GCC toolchain inside of the repository? On Debian/Ubuntu the following command installs everything:

apt-get install gcc-arm-none-eabi

There might be similar packages for other distributions?

Problem with dependencies

It seems dependencies are not working.
Changing a header does not trigger a rebuild of source files depending on it.

Missing license

I can not use your template in our project because of missing license. Would you please consider adding it?

Teensy 4

This makefile template needs to be updated to support Teensy 4.0

Issues while porting arduino code

It looks like this template does not support multiple *.ino files (not sure exactly how they are handled by the official IDE, they seem to be concatenated).

Even if I manually concatenate files, I'm having a lot of 'sendJson' was not declared in this scope, is there a flag to set to relax declaration?

Thanks!

LDFlags

Great project, thanks!

When enabling arduino (ie setting ARDUINO = 10600), make sure the LDFlags have rtc_localtime set (see line 73 of https://github.com/PaulStoffregen/cores/blob/master/teensy3/Makefile
);

# linker options
LDFLAGS = -Os -Wl,--gc-sections,--defsym=__rtc_localtime=0 --specs=nano.specs -mthumb -mcpu=cortex-m4

This will let the main.cpp work using standard Arduino code, for example:

#include "WProgram.h"

void setup(void){
    pinMode(13, OUTPUT);
}

void loop(void){
    digitalWrite(13, HIGH);
    delay(50);
    digitalWrite(13, LOW);
    delay(50);
}

extern "C" int main(void){
    setup();
    while (1) {
        loop();
        yield();
    }
}

Standard C++ code (thank you so much for this part!) will also work:

#include "WProgram.h"

extern "C" int main(void)
{
    pinMode(13, OUTPUT);
    while (1) {
        digitalWriteFast(13, HIGH);
        delay(50);
        digitalWriteFast(13, LOW);
        delay(50);
    }
}

Also, here are my options (based on yours and PJRC's):

# configurable options
OPTIONS = -DF_CPU=$(TEENSY_CORE_SPEED) -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DUSING_MAKEFILE -ffunction-sections -fdata-sections

# options needed by many Arduino libraries to configure for Teensy 3.0
OPTIONS += -DARDUINO=$(ARDUINO) -DTEENSYDUINO=141

where disabling the bottom line will disable arduino. I like this better than the choice between DUSING_MAKEFILE or arduino, since both (arduino and no arduino) can be built with the makefile. Of course the best part about this is moving away from arduino but using the open source build engine. Thanks again for this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.