Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 12 1 2 3 11 ... LastLast
Results 1 to 25 of 299

Thread: Arduino CLI And IDE 2 RC Release - Teensy Support?

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

    Arduino CLI And IDE 2 RC Release - Teensy Support?

    This message was updated from the old details about the first CLI Alpha release to more current versions of both the
    CLI as well as the "RC candidates for the Arduino IDE2.

    Most of this was taken from a few of Paul's posts.

    Arduino IDE 2

    You can download the: Future Version of the Arduino IDE from the Arduino Software Page
    I started with the RC7 page. I personally will continue to monitor the Github IDE changes and will use daily builds again once there are additional changes.

    Many of the earlier rough edges of the earlier builds have improved with RC7. Not saying it is perfect yet, but a lot better! I have started using it again to do some of the Arduino testing. Again this is the first build that supports SEREMU.


    Paul has built a "Real" setup to plug into the Arduino Board Manager, currently it is based on TD 1.56

    Once you have the IDE 2 up and running, you open open up the Preferences Page: On Windows File->Preferences
    You will see a dialog that looks like:
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	207 
Size:	28.5 KB 
ID:	27533

    As you can see in the Additional board manager URLS you enter:
    Code:
    https://www.pjrc.com/teensy/td_156/package_teensy_index.json
    Close the dialog.. I found I needed to exit the IDE and restart it and then you can now install the Teensy boards.
    You Open the Boards Manager and Scroll down until you see the Teensy Install and click the Install button.
    Click image for larger version. 

Name:	screenshot2.jpg 
Views:	108 
Size:	317.1 KB 
ID:	27535
    You then should have the Teensy boards installed. Note: this install stuff in a different location then the Teensyduino installs.
    On my Windows machine it is stored at: C:\Users\kurte\AppData\Local\Arduino15\packages\te ensy

    And if you find any issues with the Arduino IDE, you might want to search the list of issues that have already been open.
    You can find them up at: https://github.com/arduino/arduino-ide/issues

    Some notes: on issues and things you might run into.

    1) If you install the install IDE2 and the Teensy board. When you try to use Arduino builds like 1.8.19 and for example install TD 1.57B2, by default Arduino will see your install for teensy from the board manager (arduino15) and use it. Paul has posted a patch to the Arduino install for it to instead use the one installed within the Arduino install: more details and zip file up at: https://forum.pjrc.com/threads/53548...l=1#post307482

    2) On the first install of the IDE2, installs a set of default libraries into your <Sketches folder>/libraries/ Including an SD library. With our current install this one will take priority over the one installed by Teensyduino. I have potential fix for this, mentioned in the post #202. And that is to update the library.properties file in TD version of
    SD library to change the: architectures=*
    to: architectures=avr,*
    More information on Search order can be found at: https://arduino.github.io/arduino-cl...ncy-resolution

    Edit: Arduino is now looking at adding another directory to store the Arduino level libraries, like it has been done in Arduino 1.x:
    https://github.com/arduino/arduino-ide/issues/1055


    3) When I installed RC7 (actually the nightly before it), when it ran on my main machine, it wiped out my list of installed boards. The board manager showed there were
    no boards...
    This is issue: https://github.com/arduino/arduino-ide/issues/1036
    Had do do with with the install of certain releases of ESP8236. Also replicates if you type in a URL in the extras boards which does not exist.
    There is a pending Pull Request to hopefully fix this. I resolved it by deleting (rename) my arduino15 directory and started from scratch.

    4) If you edit boards.txt or local.boards.txt, the system may not see these changes. I ran into this, by copying over the 1.57B2 stuff, which had the new Serial + MTP
    But also could reproduce, by editing boards.txt and say I want to enable faster speed on T3.2.
    Issue: https://github.com/arduino/arduino-ide/issues/1030 also https://github.com/arduino/arduino-ide/issues/591
    As per @per1234 (github) PerT? work around:

    Code:
        Select File > Quit from the Arduino IDE menus if it is running.
        Delete the "User data" folder:
            Windows:  C:\Users\<user name>\AppData\Roaming\arduino-ide\
            Linux:  ~/.config/arduino-ide/
            macOS: ~/Library/Application Support/arduino-ide/
    
        Start the Arduino IDE.
    5) Suggestion by @PerT in post #204, that the Teensy Board URL at some point be a static URL that covers all of the releases of it and does not contain
    the actual release number: That is instead of: https://www.pjrc.com/teensy/td_156/p...nsy_index.json
    hopefully there will be something like: https://www.pjrc.com/teensy/package_teensy_index.json

    6) Stability issues with Language Server. This is the code that when you hover over something, it will show you something like:
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	75 
Size:	26.2 KB 
ID:	28664
    Makes me want to go in and edit some of our header files and add more details.
    Issues include: https://github.com/arduino/arduino-ide/issues/1042

    Edit (6/17): 7) There appears to be issue with at least the daily build, should check on RC7 as well. But Serial.available and the like does not appear to return data if Teeny port is selected, until something in your code does an output to Serial... i.e. Serial.print(...)
    https://github.com/arduino/arduino-ide/issues/1072

    Edit: (7/6): This appears to be a Windows only issue and the problem appears to be in teensy-monitor code as can replicate without any Arduino IDE/CLI code.

    Edit 7/9 (more in https://forum.pjrc.com/threads/53548...l=1#post309070)

    7) Teensy Examples - How to install them in IDE2

    8) Teensy 4 Security

    Probably others...

    Arduino CLI

    From post #110
    Here's a quick recap, where we're at today... for anyone else who wants to give this new software a try.

    Arduino CLI seems to be working pretty well, but with the caveat that uploading is done by running the GUI-based Teensy Loader. Packages are available for Windows, MacOS and Linux x86_64. If you *really* need another Linux arch, just ask. True headless mode is planned, but we're waiting on an IDE update, specifically issue 790, before we can reliably detect whether upload should be done headless or with the GUI.

    Arduino IDE 2.0-rc3 isn't really usable for Teensy at this point. The main thing to be done is reporting issues, which is an awesome way to contribute to the Arduino & Teensy community. Hopefully the new 2.0 IDE will become more usable with 2.0-rc4 as the Arduino developers fix the issues we've already reported.

    To use Arduino CLI, download the nightly build from this page. When you extract, it's just a single executable file. Put it somewhere like /usr/local/bin on Linux or MacOS, or edit your PATH environment variable so it runs when you type "arduino-cli" on the command line.

    The first step is to run "config init" like this:

    Code:
    ./arduino-cli config init
    or on Windows....

    Code:
    arduino-cli.exe config init
    It will create a arduino-cli.yaml config file and tell you the full pathname. Edit that file and add "https://www.pjrc.com/teensy/td_156/package_teensy_index.json". It should look like this:

    Code:
    board_manager:
      additional_urls: [
        https://www.pjrc.com/teensy/td_156/package_teensy_index.json
      ]
    After editing, run "arduino-cli config dump". You should see something similar to this:

    Click image for larger version. 

Name:	screenshot3.png 
Views:	38 
Size:	210.4 KB 
ID:	27536

    To install Teensy's files, run "arduino-cli core install teensy:avr". Today the package version is 1.56.1. Once it's installed, you can run commands like "arduino-cli board list" and it should probably detect Teensy, even when running in non-Serial modes. You can compile, upload, monitor (even in Teensy's non-Serial modes).

    Just remember, today upload always runs the GUI-based Teensy Loader, so if running on Linux you need a full desktop environment. But if you've been wanting to use Arduino CLI for scripts or other automation, hopefully now you can begin to move forward. An update to run fully headless will be coming, once Arduino updates fix those issues mentioned above.

    Update (June 12) for RC7 - Now support for plug able Serial Monitor, now talks to SEREMU. Also lots of improvements. Updates above...
    Last edited by KurtE; 07-19-2022 at 04:44 PM. Reason: Change title

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,546
    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
    10,750
    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
    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 06:25 AM.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,189
    @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
    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
    16,189
    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
    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
    16,189
    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
    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
    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
    1,849
    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
    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
    26,546
    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
    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
    26,546
    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
    26,546
    Talked with the Arduino developers today. Summary is online as this issue:

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

  18. #18
    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
    26,546
    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
    26,546
    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!

  24. #24
    Junior Member
    Join Date
    Nov 2015
    Posts
    9
    Hello Paul,

    I see that the Teensy 3.2 is detected by arduino-cli as

    Code:
            FQBN    Port            ID              Board Name
            /dev/ttyACM0    16c0:0483       unknown
    Is there a way to make arduino-cli download all supporting files by adding an url to the "cli-config.yml" file, as done for the esp8266com?

    Code:
    board_manager:
      additional_urls:
        - http://arduino.esp8266.com/stable/package_esp8266com_index.json
    or can the files / libraries be installed manually ?

    The primary goal is to compile for Teensy 3.2 with "arduino-cli", not using "arduino" (which is slow to use, as "command line")

    The secondary goal is to program the board via the arduino-cli.

    Any advice or direction-pointing is fine.

    Thank you.

  25. #25
    Junior Member
    Join Date
    Nov 2015
    Posts
    9
    Hello Paul,

    It seems platformio had it all figured out already, so I went with that.

    Thanks for the teensies.

Posting Permissions

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