Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 23 of 23

Thread: Arduino CLI Alpha Release - Teensy Support?

  1. #1
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,688

    Arduino CLI Alpha Release - Teensy Support?

    On the developers email list I have been watching the postings about the new Alpha command line release from Arduino.

    From Luca Cipriani of Arduino:
    We are happy to announce the first version of our Arduino CLI tool.
    Here is the code: https://github.com/arduino/arduino-cli

    It is a full command line to do the most common Arduino tasks and later on to be included in your CMake files and have a proper daemon API. Please consider is still alpha that's why every bug report is really useful for us.

    I wrote a small getting started guide in the readme available here:
    https://github.com/arduino/arduino-cli#getting-started

    Please report the bugs you find on github.

    We would love to listen your feedback!

    Thank you,
    So I was wondering if anyone has tried this with supporting the Teensy boards?

    Earlier I was able to use the Arduino IDE command line to build a simple app. I was able to build a program over an SSL link (Putty) to a linux board. It only failed when it tried to do an upload to the teensy. I was able to make this work by changing platform.txt to use the teensy cli program instead.

    Edit: should mention that there are some pre built binaries you can download:
    We are working on VSCode integration with Microsoft directly.
    The plan is to add an extra GPRC interface on top of all the public methods so will be easy to do other IDEs integration.

    I forgot to add here precompiled build for the lazy devs as we all are:

    http://downloads.arduino.cc/arduino-...inux32.tar.bz2
    http://downloads.arduino.cc/arduino-...inux64.tar.bz2
    http://downloads.arduino.cc/arduino-...nuxarm.tar.bz2
    http://downloads.arduino.cc/arduino-...review-osx.zip
    http://downloads.arduino.cc/arduino-...ew-windows.zip

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,651
    Can't say I'm excited about having to dive into Google Go language....

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,688
    Yep - I have never looked at it before....

    I downloaded it to my windows machine, and it looked like it was finding most of the boards installed on my machine,

    Either ones that are installed in the Arduino15 location by Board Manager and I think maybe those installed in the <sketch folder>/hardware/... Although I would have to double check that part.

    I thought I would try building for a Robotis OpenCM9.04 board, it listed it, but then failed with some other error, maybe windows specific. I might try installing on MAC or Linux to see if any of that works...

  4. #4
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    Id love to abandon the Arduino IDE and move to visual code which is a far superior editor, if work is required to help teensy get enabled Ill tentatively put my hand up.

    having just tried it out - it appears to require the new http://package.json support instead of the manual installation into the hardware folder.

    all my other boards that have that packaging layer are just working as - is but the teensy and other manual ones dont show.
    Last edited by rjp; 08-27-2018 at 07:25 AM.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,046
    @rjp: In the IDE 'file / Preferences' you can select 'Use external editor' that opens the file 'Read Only' to Build and upload using the provided toolchain - the IDE uses the externally saved disk copy to build - that is if using a preferred external editor.

    If using Visual Studio [for 'visual code' ?] there is a 'Visual Micro' plug in for that is used by some and generally seems to be kept working for Teensy. I just installed VS but haven't bothered trying VMicro yet as I'm doing okay with IDE and SublimeText for the editor.

  6. #6
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    thanks @defragster but alas ive tried all that.


    Visual Micro is for the big fat version of visual studio, not the new lean mean visual code.

    it was also quite clumsy from memory, i didnt want to persist with it or visual studio.


    the arduino ide is just terrible to me - i dislike the menu behaviour and the awkward hovering games, i dislike the startup time, the actual builtin editor is the least of the problems

    visual code is like vim, super fast to start, dumps you into a folder of your code to edit as you please, command shell to trigger tools and actions.

    Ill raise my voice as someone who would love a command line only version of teensy and ill do my best to help make it happen if required.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,046
    Went looking for 'visual code' - is that the subset of MSFT Visual Studio app?

    Will it work as external editor?

    I share the finding of terrible 'awkward hovering games' in the IDE - the Menu usage is very non-standard Windows behavior from keyboard and the twitchy mouse jumping on undesired menu items on a whim is painful.

    IDE startup was just now 9 seconds on closing and opening with it and reopening 11 sketches? I have all that running from a secondary SSD drive. It does take some time to scan any library and hardware chain it seems - but not as bad now as it has been, then I just leave it open - which is why I have 11 open sketches.

    I generally suffer with the IDE for editing but use TyCommander for the loader and SerMon portions which takes out some of the pain of the IDE. Using the external editor is not as handy for navigating recent and creating new projects with the directory name of the sketch name.

    I tried Visual Micro when I had VS2015 and it was a bit green then - not anxious to wade back in again as what I have it working.

  8. #8
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    https://code.visualstudio.com/

    its super fast on startup and it works off a completely agnostic "open folder" paradigm which defies project file madness.

    an open source effort from microsoft that runs seperately to visual studio, the linux version is identical to the windows one which makes my platform jumping realities much easier to deal with.

    ctrl ~ toggles a terminal shelll with history so you can fire off tools and builds, microsoft accidently created a winner.

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,046
    That is what I found VisualStudio Code - they have an Arduino Extension - but not Visual Micro so it may not fit the Teensy install/extend model the way VisualMicro has done.

    It requires the non-windows IDE - just like Teensy - but I don't know if it is ready to set up and run with the Teensy layout of tools and building, have you tried that?

  10. #10
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    ill give it a go.

    ideally, the command line tool would replace the need for the whole dance with that Java IDE and its unfortunate ui.

    im not ready to give up on the dream just yet!

  11. #11
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    Quote Originally Posted by defragster View Post
    That is what I found VisualStudio Code - they have an Arduino Extension - but not Visual Micro so it may not fit the Teensy install/extend model the way VisualMicro has done.

    It requires the non-windows IDE - just like Teensy - but I don't know if it is ready to set up and run with the Teensy layout of tools and building, have you tried that?
    nope this one also only detects the boards in the package manager system and ignores the ones manually installed in /hardware

    i wonder how much work it is to make a layer for teensyduino that obeys that package.json system.

    this would appear to fix both the arduino-cli and the visual code plugin.

  12. #12
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306
    I'm using VisualStudio without VisualMicro. I'm building and uploading using the makefile support of the IDE. This is surprisingly easy, sketches compile very fast and intellisense works nicely. I'm sure you can do the same in Visual Code.

    I also wrote a little tool (https://github.com/luni64/Board2Make) which extracts the info from boards.txt and converts it into a make-compatible format. So switching between different boards, or optimizer settings etc. is as easy as with the Arduino IDE. The most important thing for me is that this setup allows for self contained projects (I usually copy all used libraries and the Teensy core to the project directory). So, no dependency on the IDE, Arduino or Teensyduino version etc. You can open a project years later and be sure that it just compiles and you can continue working.

  13. #13
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    the rules for https://github.com/arduino/Arduino/w...-specification seem somewhat easy enough.

    the only trick would be fudging the teensyduino install package into that format

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,651
    Quote Originally Posted by rjp View Post
    the only trick would be fudging the teensyduino install package into that format
    Well that would be quite a trick indeed, since the json-based package does not provide any way to install Teensy's custom USB discovery tools.

    I will be talking with the Arduino devs later this week. Not much to report right now.

  15. #15
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    Quote Originally Posted by PaulStoffregen View Post
    Well that would be quite a trick indeed, since the json-based package does not provide any way to install Teensy's custom USB discovery tools.

    I will be talking with the Arduino devs later this week. Not much to report right now.

    thanks for the detail.

    does this mean nagging them into adding a new "post install hook" to the format ?

  16. #16
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,651
    Quote Originally Posted by rjp View Post
    does this mean nagging them into adding a new "post install hook" to the format ?
    It's much more complicated than that. Sorry, don't have time to write a lengthy explanation. But I can tell you we're going to soon talk about it.

  17. #17
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,651
    Talked with the Arduino developers today. Summary is online as this issue:

    https://github.com/arduino/Arduino/issues/7942

  18. #18
    Junior Member
    Join Date
    Dec 2015
    Posts
    19
    Quote Originally Posted by PaulStoffregen View Post
    Talked with the Arduino developers today. Summary is online as this issue:

    https://github.com/arduino/Arduino/issues/7942

    thankyou very much for providing the feedback.

    hopefully they will make this happen.

  19. #19
    Junior Member
    Join Date
    Nov 2018
    Location
    Colorado
    Posts
    3
    Hey Paul, from what I can tell your discussion with the arduino guys is to provide a one-stop solution to use the arduino-cli like the IDE and build/load the Teensy with the one cli.
    Is there a way to use the board support files needed for the Teensy with the arduino-cli to compile the hex file and then use the teensy-loader-cli to load the hex file onto the board? I was hoping to perform terminal-only build and board loading.

  20. #20
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,651
    Quote Originally Posted by crypticvapor View Post
    Is there a way to use the board support files needed for the Teensy with the arduino-cli
    No. We need Arduino to merge "Pluggable Discovery" before Teensy can be supported. Work was been done on this feature for the IDE, still waiting to be merged.

    https://github.com/arduino/Arduino/pull/8038

    Cristian said last week he will merge it soon, but plans to alter the JSON format later. Scroll to near the end of that page for details.


    Of course, after they merge this into the IDE, it's also needed on the CLI. Cristian & Luca said that's what they intend to do. But it's a slow process. I do not have any idea of the time frame for the CLI to gain the Pluggable Discovery feature. But I would be amazed if it happens within the next few months.


    I was hoping to perform terminal-only build and board loading.
    Did you know the IDE can be run from the command line? It's not fast due to the Java JRE startup, but it can be done.

  21. #21
    Junior Member
    Join Date
    Nov 2018
    Location
    Colorado
    Posts
    3
    Quote Originally Posted by PaulStoffregen View Post
    No. We need Arduino to merge "Pluggable Discovery" before Teensy can be supported. Work was been done on this feature for the IDE, still waiting to be merged.
    Thank you for explaining, I apologize for asking a question which you already answered. I was hoping there was a way to disconnect the two: board support and discovery methodology. I will await this functionality to be integrated in the future.

    Did you know the IDE can be run from the command line? It's not fast due to the Java JRE startup, but it can be done.
    Fantastic, I did not know that, thank you!

  22. #22
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,651
    Quote Originally Posted by crypticvapor View Post
    I was hoping there was a way to disconnect the two: board support and discovery methodology.
    Well, you can, more or less. Just run arduino-builder. In the IDE, turn on verbose output while compiling to see how the IDE runs it.

    That will let you do the build part, but not the rest which the IDE and CLI do.

  23. #23
    Junior Member
    Join Date
    Nov 2018
    Location
    Colorado
    Posts
    3
    Quote Originally Posted by PaulStoffregen View Post
    Just run arduino-builder. In the IDE, turn on verbose output while compiling to see how the IDE runs it.
    This makes sense, thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •