linux development without teensyduino - howto

Status
Not open for further replies.

gregd72002

New member
command line linux development without teensyduino - howto

Hi,

I thought it will be a good idea to share my experience with setting up development environment for Teensy LC (v3, should also work for v2) on linux without X nor any Java crazy stuff.
In the normal scenario you would install Arduino IDE and then Teensyduino. Both of them have dependencies on graphical interface. So here it is how to set it up using terminal.

(The following has been tested on Raspbian (Jessie))


  • install standard ardunio libraries (sudo apt-get install arduino-core)
  • install arduino-makefile which allows you to compile project without the IDE (sudo apt-get install arduino-mk); ensure this is one of the latest version, it should include Teensy.mk file; otherwise it won't work


At this stage you should be able to develop to Arduino but not for Teensy yet.
To add Teensy support:
  • install compiler (sudo apt-get install binutils-arm-none-eabi gcc-arm-none-eabi)
  • navigate to /usr/share/arduino/hardware/tools where you should see a folder and create there the following symlinks "arm/lib" and "arm/bin" to "/usr/lib" and "/usr/bin" respectively
    Code:
    cd /usr/share/arduino/hardware/tools
    sudo mkdir arm
    cd arm
    sudo ln -s ../../../../../bin
    sudo ln -s ../../../../../lib
  • install teensy cores (https://github.com/PaulStoffregen/cores) into /usr/share/arduino/hardware/teensy/ directory
    Code:
    cd /usr/share/arduino/hardware/
    sudo mkdir teensy
    cd teensy
    sudo git clone https://github.com/PaulStoffregen/cores
  • create boards.txt file in /usr/share/arduino/hardware/teensy/ (teensyduino 1.29 boards.txt is attached: View attachment boards.txt)

All done. You should be now able to create a quick test:
  • create a new folder for your projectcd ~; mkdir project1; cd project1)
  • create project.ino file as you would normally would (i.e. containing blink led code)
  • create Makefile file with the following content (you might want to change the BOARD_TAG and remove F_CPU as this is only needed for teensyLC)
    Code:
    BOARD_TAG=teensyLC
    F_CPU=48000000
    USB_TYPE = USB_SERIAL
    include /usr/share/arduino/Teensy.mk
  • run 'make' what should compile everything

All done!
Gregory
 
Last edited:
Thanks for sharing.

May have to play with it sometime. Up till now, what I have done is to VNC into the linux board like RPI or odroid and now can run the Arduino IDE. But would be nice at times to simply use make.

Thanks again!
 
Having followed the above instructions I've had to also issue the following commands to get it working
Code:
sudo apt-get install gcc-arm-none-eabi
 
Hi,

I thought it will be a good idea to share my experience with setting up development environment for Teensy LC (v3, should also work for v2) on linux without X nor any Java crazy stuff.

so you need Python!
is fine with me. I can do it without JAVA or Python. After all it turns out to be a question of convenience.
 
I'm trying to use the info in the original post to configure Travis CI to do a linux compilation of Teensy code as part of Continuous Integration with my GitHub repo. Sadly, I have very little linux experience. It dies when trying to install the gcc-arm toolset ("sudio apt-get install binutils-arm-none-eabi gcc-arm-none-eabi").

Code:
language: c
before_install:
  - sudo apt-get install arduino-core
  - sudo apt-get install arduino-mk
  - sudo apt-get install binutils-arm-none-eabi gcc-arm-none-eabi     <------ DIES HERE!!!
  - sudo mkdir /usr/local/share/arduino/hardware/teensy/ 
  - pushd /usr/local/share/arduino/hardware/teensy/
  - sudo git clone https://github.com/PaulStoffregen/cores
  - popd
install:
  - ln -s $PWD /usr/local/share/arduino/libraries/OpenAudio_ArduinoLibrary
  - arduino --install-library "Audio"
script:
  - arduino --verify --board teensy:avr:teensy36:usb=serialmidiaudio $PWD/examples/Tympan_TLV320AIC3206.ino
notifications:
  email:
    on_success: change
    on_failure: change

The exact error message from the Travis CI console is:

Code:
$ sudo apt-get install binutils-arm-none-eabi gcc-arm-none-eabi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package binutils-arm-none-eabi
E: Unable to locate package gcc-arm-none-eabi
The command "sudo apt-get install binutils-arm-none-eabi gcc-arm-none-eabi" failed and exited with 100 during .
Your build has been stopped.

Any ideas how I need to modify that command to make the installation work?

Thanks,

Chip
 
It dies when trying to install the gcc-arm toolset ("sudio apt-get install binutils-arm-none-eabi gcc-arm-none-eabi").
Your package manager does not know where to get those two packages (binutils-arm-none-eabi and gcc-arm-none-eabi), that's all.

What Linux distribution are you using? You can normally tell by running
Code:
cat /etc/issue
or
Code:
cat /etc/os-release

Personally, I'm running Ubuntu 16.04.2 LTS on this particular laptop, and use the GNU ARM Embedded Toolchain personal package archive, and install the gcc-arm-embedded package instead of the two above. For now, I prefer this for Ubuntu up to version 16.10.

There are other options, of course, but the proper one for you depends on which Linux distribution you are using.
 
Status
Not open for further replies.
Back
Top