Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teensy Compatibility #142

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dave-newson
Copy link

Following on from issue #67, this PR adds support for Teensy boards and the Teensy SDK for arduino-cmake.
The crux of this PR is adding additional compile options and detecting/using teensy_loader_cli (halfkay) over avrdude for uploading.

Teensy-specific board modes that are available (usually speed, usb and keys) can be listed using the following command:
print_teensy_modes(board_id) where board_id is the specific Teensy board identifier.
The options available for each mode can be viewed using:
print_teensy_modes(board_id MODE mode_id) where mode_id is the mode (eg. speed) you want to view options for.

Three specific options must be set for the Teensy board to compile correctly:
set(TEENSY_CPU_F_MODE 16)
set(TEENSY_USB_MODE serial)
set(TEENSY_KEYBOARD_MODE en-us)

If the Teensy board is detected (usually specified in the Teensy boards.txt config via the <board_id>.upload.protocol value as halfkay), the teensy_loader_cli will be used. All other options (or null) default to avrdude, as before.

Some additional support for teensy-specific build flags has been added, allowing <board_id>.build.optionX definitions to be imported from the the boards.txt file as compile flags.

Failing to define a F_CPU will now also raise a fatal error. This is a common hiccup when trying to set up arduino-cmake with a Teensy.

Requires (and integrates) PRs #141 and #140.

Please note I only have a Teensy, so I haven't been able to thoroughly test this against standard arduino boards.

Dave Newson added 8 commits February 15, 2015 23:08
…ility with windows drive references containing colons.
…uding regex symbols. Swapped second regex match for SUBSTRING.
…s using LOADER option

Added: print_teensy_modes(board_id) to list available modes
Added: print_teensy_modes(board_id MODE mode_id) to list specific modes options
Added: Detection of the Teensy SDK (loader specifically) on initialisation
Added: Ability for Teensy mode options (speed, keys, usb) to be set in configuration, as comparable with Arduino IDE options for Teensy.
Added: Support for missing build option flags (<board_id>.build.optionX) required for Teensy.
Added: Documentation to readme for teensy compatibility
@filosganga
Copy link

What about this PR? would really like see it merged.

@dave-newson
Copy link
Author

@filosganga iirc I ran into some problems with this and compiling out to Teensy 3.
Does work with Teensy 2++, mind you, so it's at least a step in the right direction.

@filosganga
Copy link

thanks

@dave-newson
Copy link
Author

For what it's worth to anyone else who happens across this PR, I've abandoned trying to make this work in favor of using PlatformIO for the same cross-OS compiling.
There were too many variables with the Teensy3 for me to understand, which they seem to have resolved.

Will leave this PR open, but I now feel it's incomplete. I'll leave it up to the project maintainer to decide its fate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants