Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 45 of 45

Thread: Arduino CLI Alpha Release - Teensy Support?

  1. #26
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,265
    I'm still waiting on the Arduino developers to merge this, before I can support Teensy on arduino-cli

    https://github.com/arduino/arduino-cli/pull/109

  2. #27
    Senior Member
    Join Date
    Dec 2014
    Posts
    304
    I upvoted this pull request.

  3. #28
    Junior Member
    Join Date
    Nov 2012
    Posts
    2
    Paul, does this PR implement what you need?
    https://github.com/arduino/arduino-cli/pull/217

  4. #29
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,265
    Quote Originally Posted by firelizzard View Post
    does this PR implement what you need?
    https://github.com/arduino/arduino-cli/pull/217
    Looks promising. But I'm not going to do anything on this until after Teensy 4.0 is released. Priorities...

  5. #30
    Junior Member
    Join Date
    Oct 2016
    Posts
    5
    What is the final conclusion?
    Can we use teensy with arduino-cli?

    Thanks,
    K.

  6. #31
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,265
    Very little has happened on this. A very long list of features needed on Teensy 4.0 has taken precedence. If you look at the pretty incredible number of changes in 1.48 and 1.49, it's pretty clear to see progress is being made (on those features, not arduino-cli). But much more remains to be done, so 1.50 & 1.51 are going to focus on features for Teensy 4.0, like USB audio, Wire lib slave mode, and a few remaining libs not yet ported, like OctoWS2811.

    One tiny thing that did just recently happen is this commit, which will be released in 1.8.11.

    https://github.com/arduino/Arduino/c...6e089d4caa3c85

    Teensy's platform.txt uses "{runtime.platform.path}" in its recipes for pluggable discovery. Hopefully after 1.8.11 releases, the Arduino devs will also support this syntax in arduino-cli. We either need that support, or a different pluggable discovery recipe would be needed for arduino-cli. I'm not excited about maintaining 2 different platform.txt files, which is the reason why I went to the trouble to submit that pull request.

    So there is some tiny & incremental progress, but the honest reality is nearly all dev time is going into Teensy 4.0 software support at this time.

  7. #32
    Junior Member
    Join Date
    Feb 2019
    Location
    France
    Posts
    10
    Hi,

    I am using arduino_cli but I am a bit confused when I try to used it with my teensy 3.2. Arduino_cli reports that the platform is not installed but I couldn't find how I can add the teensy in the arduino_cli environment.

    Charles

  8. #33
    Junior Member
    Join Date
    Feb 2019
    Location
    France
    Posts
    10
    hmm I see it is currently not supported.

  9. #34
    Junior Member
    Join Date
    Apr 2020
    Posts
    4
    That's unfortunate. Arduino CLI is the only solution that allows using programmers editors like Sublime, EMeditor, Epsilon etc.

  10. #35
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,919
    Quote Originally Posted by athan View Post
    That's unfortunate. Arduino CLI is the only solution that allows using programmers editors like Sublime, EMeditor, Epsilon etc.
    You can switch the Arduino-IDE to use an external Editor.
    - Defragtster has a solution "TSET".
    - Luni has a solution, too.
    - Then, there is Platformio.
    ..etc

  11. #36
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    979
    Here https://github.com/TeensyUser/doc/wiki in the section 'Compiling and Uploading' you find FrankB's and other options with links

  12. #37
    Junior Member
    Join Date
    Aug 2018
    Posts
    16
    I have been looking for a better GUI / enviroment for coding my Teensy boards than using the Arduino GUI. Currently using Visual Code with PlatformIO, this loads to Windows 10 very quickly and compiling code is very fast and it auto loads the hex file via the Teensy Loader to a connected Teensy board. The management of scr files to be #included in the main .cpp file is straight forward. The only thing that caught me out was understanding what library files it is using, but clicking on the library tab shows installed libs and allows new libs to be added, so any lib conflicts can be easiily managed. It also supports a very long list of DEV boards and I plan to connect some of my older dev boards soon and see if they work as well as Teensy boards. The GUI layout is well thought out and the enviroment easy to work in, so reccommend it for any Teensy coder.

  13. #38
    Junior Member
    Join Date
    Apr 2020
    Posts
    4
    Sorry but imho these solutions even though they work to some extent cannot be considered a solid, trouble - free bridge between arduino build system and user's editing tools.
    Arduino CLI although still has minor problems due to its alpha stage, it is one of the best build-library-deploy tools I have come across in embedded development systems.

  14. #39
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,919
    They're more soild than that alpha that doesn't even work, or that so called Aduino-"IDE" that is worse than a early 80ies texteditor.
    Had no issues so far.

  15. #40
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,935
    FrankB found a WINDOWS way to trigger IDE build from command line. That is the base of the github.com/TeensyUser/doc/wiki/TSet mentioned above by @luni and @FrankB.

    It triggers a Full and Standard IDE build with a Windows batch file. All source and libraries build with that the same as they do from the IDE … bit for bit … with IDE installed and then TeensyDuino - with a couple of path indicators it runs from the sketch folder for any Teensy with all build options stored in the batch file created after answering a few questions in a DOS box for :: Teensy #, Speed, Compile Type ,USB Type.

    Code:
    "%arduino%\arduino-builder" -verbose=1 -warnings=more -compile -logger=human -hardware "%arduino%\hardware" -hardware "%LOCALAPPDATA%\Arduino15\packages" -tools "%arduino%\tools-builder" -tools "%arduino%\hardware\tools\avr" -tools "%LOCALAPPDATA%\Arduino15\packages" -built-in-libraries "%arduino%\libraries" -libraries "%libs%" -fqbn=%fqbn% -build-path %temp1% -build-cache "%temp2%"  %ino%
    Then using 'editor of choice' that can run a batch file - TSET documents the SublimeText in use here. It can run normally with IDE SerMon and Teensy Loader, or TyCommander with or without Integration ( without integrations when used as SerMon it takes a Button press or Ctrl+B in TyComm to trigger upload )

    Build command Options: BUILD, BUILD CLEAN, BUILD VERIFY, NEW Sketch, Build Board CMD file.

  16. #41
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,919
    @TIM: Its easy to port that to linux or MAC (like "defs.h")

  17. #42
    Junior Member
    Join Date
    Jun 2020
    Posts
    1
    Hi everybody,
    I launched question on arduino-cli github about teensy support, and it seems they are waiting for an action from Teensy's creaors: https://github.com/arduino/arduino-c...ment-650700885, even if it still miss Pluggable Discovery feature.

    Thanks for your work!

  18. #43
    Junior Member
    Join Date
    Aug 2019
    Posts
    9
    If anyone is following this for a workaround until arduino-cli adds support for the `{runtime.hardware.path}` pattern in Teensy's platform.txt, I managed to get arduino-cli to successfully work with Teensyduino with the following steps.

    Note that I did not have the Arduino IDE installed at all, so these steps assume a fresh install of both Arduino IDE 1.8.13 and Teensyduino 1.53. Also these steps were performed on Ubuntu Linux 20.04, but should work in principle anywhere:

    1. Install Arduino IDE 1.8.13 (I used /usr/local/lib/arduino1.8.13)
    2. Install Teensyduino 1.53. Select the Arduino IDE install path above when prompted.
    3. Install arduino-cli. I built from source, and it shouldn't matter where this is installed. What does matter is where the data directory is defined in your arduino-cli YAML configuration file. For example, I use this very simple configuration file, with data directory defined as /usr/local/lib/arduino:
      Code:
      board_manager:
        additional_urls: ['https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json', 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json']
      daemon:
        port: "50051"
      directories:
        data: /usr/local/lib/arduino                 <--- NOTE THIS DIRECTORY
        downloads: /usr/local/lib/arduino/staging
        user: /usr/local/src/arduino
      logging:
        file: ""
        format: text
        level: trace
    4. Copy Teensyduino to arduino-cli data directory. Note that you'll need to do a bit of rearranging. Assuming the above paths are used, the following commands will create the expected directory structure:
      Code:
      $ mkdir -p /usr/local/lib/arduino/packages/teensy
      $ cp -r /usr/local/lib/arduino1.8.13/hardware/teensy /usr/local/lib/arduino/packages/teensy/hardware
      $ cp -r /usr/local/lib/arduino1.8.13/hardware/tools /usr/local/lib/arduino/packages/teensy/tools
    5. Now with toolchain installed, you'll need to make one ugly patch to address the mentioned feature missing from arduino-cli. Open /usr/local/lib/arduino/packages/teensy/hardware/avr/platform.txt, scroll down to the Teensy Loader section, and replace the commented line with a line specifying the hardcoded path to your tools directory:
      Code:
      ## Teensy Loader
      #tools.teensyloader.cmd.path={runtime.hardware.path}/../tools
      tools.teensyloader.cmd.path=/usr/local/lib/arduino/packages/teensy/tools
    6. Now, you simply need to open Teensyloader and run arduino-cli to build and upload your sketch. Unfortunately, it seems Teensyloader requires a graphical environment to run, so if you are running this remotely, you'll need to make sure the remote machine has an Xserver running. The following commands include "DISPLAY=:0" to account for this, but isn't necessary if you are running this locally on a machine with a graphical desktop. For example:
      Code:
      $ DISPLAY=:0 /usr/local/lib/arduino/packages/teensy/tools/teensy &
      $ arduino-cli --config-file "/usr/local/lib/arduino/config.yaml" compile --verbose --log-level trace --fqbn teensy:avr:teensy40 --upload --port /dev/ttyACM1  --build-path /home/andrew/.tmp/arduino-build/Arduino_Teensy4_test_script --build-cache-path /home/andrew/.tmp/arduino-build.cache/Arduino_Teensy4_test_script   /home/andrew/Code/arduino/Arduino-Teensy4/Arduino_Teensy4_test_script

  19. #44
    Junior Member
    Join Date
    Aug 2020
    Posts
    3
    Quote Originally Posted by ardnew View Post
    If anyone is following this for a workaround until arduino-cli adds support for the `{runtime.hardware.path}` pattern in Teensy's platform.txt, I managed to get arduino-cli to successfully work with Teensyduino with the following steps.
    hey @ardnew thank you very much for the suggestion, it works. I could customize your command to compile for a Teensy3.2

    For a full CLI workflow you can remove the `--upload` parameter and upload the `.hex` generated manually using the Teensy CLI loader https://www.pjrc.com/teensy/loader_cli.html (need to be separately installed / compiled)

    Example, in your case you can run:

    Code:
    $ cd /path/to/your/teensy_cli_loader
    $ ./teensy_loader_cli -v --mcu=imxrt1062 -w /home/andrew/.tmp/arduino-build/Arduino_Teensy4_test_script/......hex
    Looking forward to having Teensy support straight into `arduino-cli`

    hope it helps

    EDIT: one can also add an automatic upload feature customizing the following properties in the "platform.txt" file mentioned above

    Code:
    tools.teensyloader.cmd.path=/usr/local/lib/arduino/packages/teensy/tools
    tools.teensyloader.upload.params.quiet=
    tools.teensyloader.upload.params.verbose=-verbose
    tools.teensyloader.upload.pattern="{cmd.path}/teensy_post_compile" "-file={build.project_name}" "-path={build.path}" "-tools={cmd.path}" "-board={build.board}" -reboot "-port={serial.port}" "-portlabel={serial.port.label}" "-portprotocol={serial.port.protocol}"
    Last edited by jman; 08-04-2020 at 11:09 AM.

  20. #45
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,935
    If this were on Windows machine check out :: github.com/Defragster/Tset
    After installing IDE and TeensyDuino the IDE never needs to be opened - using TyCommander for SerMon ( and optionally upload ).

    Not sure if those batch files can easily be scripted for linux to the same end?

    It runs with no edits to IDE .txt files and does a normal IDE build from the command line with Board menu items set as selected in TSET prompts. Pending update to TyCommander allows sending Teensy into Bootloader for TeensyLoader programming. Or with TyCommander integration that does edit boards.txt - SerMon and Upload controlled by TyCommander.

    Examples as programmed into Sublime text editor Build system here Use-Sublime-Text-as-an-Arduino-IDE-replacement

    Once Compile.CMD created by TSET.CMD it can be double clicked or run in an MS-Dos Box. With Sublime build output captured in a console window.

Posting Permissions

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