- Processor: MK20DX256VLH7
- Core: Cortex-M4
- Rated Speed: 72MHz
- Overclockable: 96MHz
- Flash Memory: 256Mb
- Bandwidth: 192
- Cache: 256
- RAM: 64
- EEPROM: 2
- Direct Memory Access: 16
- Digital I/O: 34
- Voltage Input: 5V Tolerant
- Voltage Output: 3.3V
Quick Start with Teensy 3.1
This tutorial will walk through using the command line to setting up your own “Makefile”. A makefile turns a C file into a “.hex” file that can then be loaded onto the Teensy.
*Note: If you are looking for information on an IDE for ARM processors, this tutorial will not go into detail about how you write C for the ARM processor, instead we will focus on what to do with it after it has been written.
- Male header
- Teensy 3.1
- USB to USB-micro
- Arduino studio
- Teensy loader
*Note: If you do not have Arduino Studio or the Teensy Loader you will need to install them prior to starting this tutorial.
Solder male header pins onto the module.
- Download the “Teensy 31” folder. This folder contains all the files needed to compile a .hex program.
- Open the “Teensy 31” folder and navigate to the makefile. You will need to use a text editor like notepad++ to open the file.
- Once you open the makefile you will see that the first section of code is labeled “EDIT THIS SECTION”. You will need to edit the code that references file paths for the following: Arduino tools path and compiler path to match your computers file paths.
Example: “arm-none-eabi-gcc.exe” is one of the tools file paths in the makefile that needs to be edited.
- On your computer open up the file locator to the location of your Arduino install.
- Copy and paste the name of the file that you need to find the file path for into the search window. (arm-none-eabi-gcc.exe, arm-none-eabi-g++.exe, arm-none-eabi-objcopy.exe, arm-none-eabi-size.exe)
- After the search finished you can “right” click the file you are looking for to see the file path.
- Now compare that file path to the one in the makefile. If the file path on your computer is different than the one in the makefile, edit the makefile path to match your computers file path. Example:
- When you are finished editing all the file paths save and exit the makefile.
- Open the command prompt. Change your directory so that you are in the “Teensy31” folder. Then enter “make” into the command prompt. The make command will compile the makefile and create the .hex program.
- To load the example code main.hex or the .hex you created onto the teensy using the Teensy bootloader. Open the bootloader and clicking “file”. Then navigating into the “Teensy31 folder and select the .hex program. Finally load the program onto the teensy by pushing the button as shown and load your file and clicking the load button.
*Note: The example main.cpp file is a simple “blinky” program.
Congratulations! You have now successfully compiled a .hex file for your C code on your Teensy 3.1 and loaded it onto the Teensy.