Forum Rule: Always post complete source code & details to reproduce any issue!
Page 7 of 7 FirstFirst ... 5 6 7
Results 151 to 168 of 168

Thread: Arduino CLI Alpha Release - Teensy Support?

  1. #151
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,350
    Quote Originally Posted by PaulStoffregen View Post
    Sad to see #769 got pushed back to rc5. If they still haven't done it by the time we release 1.57, maybe I'll try to communicate with them about it. But from the many other issues, seems they have their hands full.

    Do you see any reason to update the experimental package we have already? Without #769, kinda seems like best course is to just wait.
    Hard to say. As I know you must have lots of free time :lol:

    I would say when we are ready for a new beta build, it would be good thing at that point. For me as long as the stuff I am playing with has a USB type that includes Serial, than you can do most things... Although for major things I still much prefer to build within sublime text.... And I am setup for being able to do Serial with the USB types I have been working on.

    One area it might be a good thing to have a new release, is the examples. Two fold:
    a) The new IDE was not showing examples with files with extensions .pde... Which I know you recently made a pass through to change all of yours to .ino...

    b) The top level Teensy examples do not show up, as you don't have an easy place to hack up this list. As I mentioned in the issue: https://github.com/arduino/arduino-ide/issues/869

    I know that the majority of other board types do this, by installing a dummy library, with a name like "Teensy", where they have dummy source file, and then all of their platform specific examples. I hacked up on on my machine which works. Would maybe suggest some special name like start with 0 or the like as to get it to top of sorted list.

  2. #152
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,142
    Quote Originally Posted by KurtE View Post
    Hard to say. As I know you must have lots of free time :lol:

    I would say when we are ready for a new beta build, it would be good thing at that point. For me as long as the stuff I am playing with has a USB type that includes Serial, than you can do most things... Although for major things I still much prefer to build within sublime text.... And I am setup for being able to do Serial with the USB types I have been working on.

    One area it might be a good thing to have a new release, is the examples. Two fold:
    a) The new IDE was not showing examples with files with extensions .pde... Which I know you recently made a pass through to change all of yours to .ino...

    b) The top level Teensy examples do not show up, as you don't have an easy place to hack up this list. As I mentioned in the issue: https://github.com/arduino/arduino-ide/issues/869

    I know that the majority of other board types do this, by installing a dummy library, with a name like "Teensy", where they have dummy source file, and then all of their platform specific examples. I hacked up on on my machine which works. Would maybe suggest some special name like start with 0 or the like as to get it to top of sorted list.
    Had a feeling #769 was not going to get incorporated this go around as there is a related PR associated with the release of CLI 1.22.0 but that was just a gut feeling.

    Converting library files to .ino from .pde's solve only have the problem, the other issue is associated that it does not handle legacy (1.0) libraries (which we have alot of problem), https://github.com/arduino/arduino-ide/issues/40. Also alot of the other annoying issues that are still open really make it more annoying to use than anything else like
    1. having to use CTRL-ENter instead of just enter from the serial monitor.
    2. Splash screen issues
    3. And most of the issues that Kurt added to there list are still open.
    4. If you are creating a blank sketch and close it, the ide doesn't ask if you want to save it first - got me a couple of times.

    Again the IDE is usable but.... Hopefully with the release of RC5 alot of these will be fixed.

    As for a new experimental package - might be good just to check what was done with the libraries so far as Kurt said as time permits

  3. #153
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,883
    Installed IDE 2 Nightly 15 March ... now a week old.
    > As usual building under SublimeText: so, this may be a local install build issue
    Building for Locked T_4.1 upload failed as key.pem not found in the sketchbook where it is and has been: "C:\T_Drive\tCode\key.pem"

    > Put a copy into: "D:\Tim\documents\Arduino\key.pem"
    Rebuild presented properly encrypted eHex and upload worked

    It was a simple edit to a recent DMA example with no libraries needed from sketchbook - not sure if it was just PJRC finding pem.key, or IDE command line build confusion with provided paths?

    Did confirm IDE 2.0 knows where the sketchbook folder is.

  4. #154
    Member
    Join Date
    Jan 2020
    Location
    Finland
    Posts
    32
    I just discovered the latest progress on Teensy-support for arduino-cli. I must say this is great news. Finally an easy way to use my favourite IDE for editing without having to rely on the Arduino IDE for compiling. After fighting with makefiles for a week, it was amazing the get the blink.ino compiled and uploaded to a Teensy in 15 minutes, including installation and setup of arduino-cli. Btw, on the first page instructions, there is one step missing. The command 'arduino-cli core update-index' should be run before 'arduino-cli core install teensy:avr'. This will download the 'package_teensy_index.json'. Otherwise it will just complain about the file missing and not go forward.

    I have one question at this point. What is the correct compile flag for different usb-modes for Teensy? For example, what would be the command to run to compile for Teensy 4.1 and set USB to Audio + Midi + Serial? Is there existing documentation on this somewhere that I just could not find?

  5. #155
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,883
    Quote Originally Posted by Myreauks View Post
    I just discovered the latest progress on Teensy-support for arduino-cli. I must say this is great news. Finally an easy way to use my favourite IDE for editing without having to rely on the Arduino IDE for compiling. After fighting with makefiles for a week, it was amazing the get the blink.ino compiled and uploaded to a Teensy in 15 minutes, including installation and setup of arduino-cli. Btw, on the first page instructions, there is one step missing. The command 'arduino-cli core update-index' should be run before 'arduino-cli core install teensy:avr'. This will download the 'package_teensy_index.json'. Otherwise it will just complain about the file missing and not go forward.

    I have one question at this point. What is the correct compile flag for different usb-modes for Teensy? For example, what would be the command to run to compile for Teensy 4.1 and set USB to Audio + Midi + Serial? Is there existing documentation on this somewhere that I just could not find?
    Look in the installed boards.txt for the USB menu item listing for the needed #define.
    Looks something like this here:
    Code:
    teensy41.menu.usb.serial=Serial
    teensy41.menu.usb.serial.build.usbtype=USB_SERIAL
    teensy41.menu.usb.serial2=Dual Serial
    teensy41.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL
    teensy41.menu.usb.serial3=Triple Serial
    teensy41.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL
    teensy41.menu.usb.keyboard=Keyboard
    teensy41.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY
    teensy41.menu.usb.keyboard.fake_serial=teensy_gateway
    teensy41.menu.usb.touch=Keyboard + Touch Screen
    teensy41.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN
    teensy41.menu.usb.touch.fake_serial=teensy_gateway
    teensy41.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen
    teensy41.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN
    teensy41.menu.usb.hidtouch.fake_serial=teensy_gateway
    teensy41.menu.usb.hid=Keyboard + Mouse + Joystick
    teensy41.menu.usb.hid.build.usbtype=USB_HID
    teensy41.menu.usb.hid.fake_serial=teensy_gateway
    teensy41.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick
    teensy41.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID
    teensy41.menu.usb.midi=MIDI
    teensy41.menu.usb.midi.build.usbtype=USB_MIDI
    teensy41.menu.usb.midi.fake_serial=teensy_gateway
    teensy41.menu.usb.midi4=MIDIx4
    teensy41.menu.usb.midi4.build.usbtype=USB_MIDI4
    teensy41.menu.usb.midi4.fake_serial=teensy_gateway
    teensy41.menu.usb.midi16=MIDIx16
    teensy41.menu.usb.midi16.build.usbtype=USB_MIDI16
    teensy41.menu.usb.midi16.fake_serial=teensy_gateway
    teensy41.menu.usb.serialmidi=Serial + MIDI
    teensy41.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL
    teensy41.menu.usb.serialmidi4=Serial + MIDIx4
    teensy41.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL
    teensy41.menu.usb.serialmidi16=Serial + MIDIx16
    teensy41.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL
    teensy41.menu.usb.audio=Audio
    teensy41.menu.usb.audio.build.usbtype=USB_AUDIO
    teensy41.menu.usb.audio.fake_serial=teensy_gateway
    teensy41.menu.usb.serialmidiaudio=Serial + MIDI + Audio
    teensy41.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL
    teensy41.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio
    teensy41.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL
    teensy41.menu.usb.mtp=MTP Disk (Experimental)
    teensy41.menu.usb.mtp.build.usbtype=USB_MTPDISK
    teensy41.menu.usb.mtp.fake_serial=teensy_gateway
    teensy41.menu.usb.rawhid=Raw HID
    teensy41.menu.usb.rawhid.build.usbtype=USB_RAWHID
    teensy41.menu.usb.rawhid.fake_serial=teensy_gateway
    teensy41.menu.usb.flightsim=Flight Sim Controls
    teensy41.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM
    teensy41.menu.usb.flightsim.fake_serial=teensy_gateway
    teensy41.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick
    teensy41.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK
    teensy41.menu.usb.flightsimjoystick.fake_serial=teensy_gateway

  6. #156
    Just wondering about the plans for headless support. Not looking for definitive answers, just thinking about a couple of things. My project has a headless RPi Zero W hooked to a Teensy4.0. The main issue I have right now is that with teensy-loader-cli I need to press the reset button for it to upload. I'm getting close to the point where everything will be enclosed and inaccessible, and so I need a fully headless solution.

    • Is the plan that arduino-cli will need this button press or not?
    • I'm not sure that I really need arduino-cli anyway, because it's quicker to develop and compile on my PC, and then transfer the .hex file. (I may change my view on this when I move from development to a more stable product that only requires infrequent updates.)
    • If a reset is required, using either cli, what's the consensus on the best way to achieve this? I'm thinking an RPi GPIO connected to the Teensy RESET pin would be required, and then something to toggle it - probably a Python app. Any easier way? (I know the Teensy CLI Loader page mentions a second Teensy and the -r flag, so I'm hoping I can do something similar with the RPi.)
    • If I switch from RPi-OS Lite to the full desktop version I think I'm still going to have the same issue, even if I install the GUI Teensy Loader. Although I'll be booting the full desktop, I'll be SSH'ing in via a terminal, and so no Xserver. Does anyone know if this thinking is correct or not?

    Thanks in advance!

  7. #157
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,229
    You can run the teensy_reboot program. That's what Arduino does to automatically enter program mode.

    If you have previously loaded bad code, physically pressing the button or pulling the Program pin low is required. Unless you can be sure you will only load working code, connecting a GPIO pin to the Program pin is probably your most reliable way to design this system.

  8. #158
    Thanks Paul! I missed teensy_reboot in my research last night. I'll go try it out. Sounds like the GPIO will be a necessary addition for reliability after all, although as it stands my code has been reliable so far. But of course that can change! I'll look into any option other than Python to do a simple pin toggle, but expect Python will be the way to go.

  9. #159
    Member
    Join Date
    Jan 2020
    Location
    Finland
    Posts
    32
    Quote Originally Posted by defragster View Post
    Look in the installed boards.txt for the USB menu item listing for the needed #define.
    Looks something like this here:
    Code:
    teensy41.menu.usb.serial=Serial
    teensy41.menu.usb.serial.build.usbtype=USB_SERIAL
    teensy41.menu.usb.serial2=Dual Serial
    teensy41.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL
    teensy41.menu.usb.serial3=Triple Serial
    teensy41.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL
    teensy41.menu.usb.keyboard=Keyboard
    teensy41.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY
    teensy41.menu.usb.keyboard.fake_serial=teensy_gateway
    teensy41.menu.usb.touch=Keyboard + Touch Screen
    teensy41.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN
    teensy41.menu.usb.touch.fake_serial=teensy_gateway
    teensy41.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen
    teensy41.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN
    teensy41.menu.usb.hidtouch.fake_serial=teensy_gateway
    teensy41.menu.usb.hid=Keyboard + Mouse + Joystick
    teensy41.menu.usb.hid.build.usbtype=USB_HID
    teensy41.menu.usb.hid.fake_serial=teensy_gateway
    teensy41.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick
    teensy41.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID
    teensy41.menu.usb.midi=MIDI
    teensy41.menu.usb.midi.build.usbtype=USB_MIDI
    teensy41.menu.usb.midi.fake_serial=teensy_gateway
    teensy41.menu.usb.midi4=MIDIx4
    teensy41.menu.usb.midi4.build.usbtype=USB_MIDI4
    teensy41.menu.usb.midi4.fake_serial=teensy_gateway
    teensy41.menu.usb.midi16=MIDIx16
    teensy41.menu.usb.midi16.build.usbtype=USB_MIDI16
    teensy41.menu.usb.midi16.fake_serial=teensy_gateway
    teensy41.menu.usb.serialmidi=Serial + MIDI
    teensy41.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL
    teensy41.menu.usb.serialmidi4=Serial + MIDIx4
    teensy41.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL
    teensy41.menu.usb.serialmidi16=Serial + MIDIx16
    teensy41.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL
    teensy41.menu.usb.audio=Audio
    teensy41.menu.usb.audio.build.usbtype=USB_AUDIO
    teensy41.menu.usb.audio.fake_serial=teensy_gateway
    teensy41.menu.usb.serialmidiaudio=Serial + MIDI + Audio
    teensy41.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL
    teensy41.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio
    teensy41.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL
    teensy41.menu.usb.mtp=MTP Disk (Experimental)
    teensy41.menu.usb.mtp.build.usbtype=USB_MTPDISK
    teensy41.menu.usb.mtp.fake_serial=teensy_gateway
    teensy41.menu.usb.rawhid=Raw HID
    teensy41.menu.usb.rawhid.build.usbtype=USB_RAWHID
    teensy41.menu.usb.rawhid.fake_serial=teensy_gateway
    teensy41.menu.usb.flightsim=Flight Sim Controls
    teensy41.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM
    teensy41.menu.usb.flightsim.fake_serial=teensy_gateway
    teensy41.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick
    teensy41.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK
    teensy41.menu.usb.flightsimjoystick.fake_serial=teensy_gateway


    Thanks, got it working!

  10. #160
    Just as an update to my posts I now have a working setup where I can use Visual Studio Code to edit, compile, (using arduino-cli), and upload to a remote Teensy 4.0, (via rsync to a Raspberry Pi Zero W running a Python app that in turn runs teensy_loader_cli). Couldn't get the GPIO to PROGRAM pin to work successfully, so I'll need to revisit that at some point. This is all from my Ubuntu desktop. I can post some configuration stuff if anyone wants it.
    Last edited by DaveAK; 03-28-2022 at 03:19 AM.

  11. #161
    Junior Member
    Join Date
    Mar 2022
    Location
    Beijing
    Posts
    3
    I have managed to run and test a build in github-actions my using Xserver to launch a buffer display, necessary for the Teensyloader, even for compilation.
    Quick and dirty: https://github.com/dattasaurabh82/AR...flows/main.yml

  12. #162
    This might be better suited directed to other forums, but I'm logged on here right now, so:

    1. Is it possible to run arduino-cli without discovery? I only run it to compile my code and do not have a Teensy connected to my development machine. Because of this I always get "Error initializing instance: discovery not found: teensy:teensy-discovery". I've tried with discovery timeout set to zero and also using the quiet flag. Neither make a difference.

    2. Is it possible to ignore #pragma messages when compiling? I'm using a third party library that spits out a couple of useless messages that I'm tired of seeing. And these also show when using the --quiet flag.

  13. #163
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,229
    Quote Originally Posted by DaveAK View Post
    I only run it to compile my code and do not have a Teensy connected to my development machine. Because of this I always get "Error initializing instance: discovery not found: teensy:teensy-discovery".
    I'm pretty sure this error means something is messed up with the software installation.

    It could be a bug in the Teensyduino package, or a bug in arduino-cli, or something has gone wrong on your machine. Very difficult to know. But I can say I'm pretty sure it's not merely due to not have a Teensy connected to any USB port.

    Please try running arduino-cli with "-v" for verbose messages. Maybe it will show something more useful?

  14. #164
    Hmmm. Nothing useful, to me at least. The error happens immediately before any compiling starts:

    Code:
    arduino-cli compile -v -b teensy:avr:teensy40 --build-path /home/dave/Arduino/Blink/build/ /home/dave/Arduino/Blink
    Error initializing instance: discovery not found: teensy:teensy-discovery
    Using board 'teensy40' from platform in folder: /home/dave/.arduino15/packages/teensy/hardware/avr/1.56.1
    Using core 'teensy4' from platform in folder: /home/dave/.arduino15/packages/teensy/hardware/avr/1.56.1
    Detecting libraries used...
    /home/dave/.arduino15/packages/teensy/tools/teensy-compile/1.56.1/arm/bin/arm-none-eabi-g++ -E .......
    I edited platform.txt and commented out the last three lines of the discovery section:

    Code:
    ## Teensy Ports Discovery
    ##  Arduino 1.8.9 requires pathPrefs patch
    ##  discovery patters have only limited support for substitution macros,
    ##  so we can not use {teensytools.path} or {compiler.path} here
    
    # Teensyduino Installer
    #discovery.teensy.pattern="{runtime.hardware.path}/../tools/teensy_ports" -J2
    
    # Arduino Boards Manager
    #discovery.teensy.pattern="{runtime.tools.teensy-tools.path}/teensy_ports" -J2
    #pluggable_discovery.required=teensy:teensy-discovery
    #pluggable_monitor.required.teensy=teensy:teensy-monitor
    Now it compiles without the discovery error, which is fine for my immediate needs, but chances are I'll forget that I did this when I start a new project connected by USB!!

    Still get the stupid #pragma messages, but that's a library issue and I'll just have to live with it unless I can figure out how to suppress them via a compiler command.

    As a side note I got my Pi side Python script running as a service so now whenever my project is powered up I get wireless and headless updating of the Teensy without any need to open a terminal. Just a compile and an upload command from within VS Code.

  15. #165
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,229
    If you're willing to try some tests, I'd really like to understand why it wasn't working. It might be a bug, and if so, I want to fix it.

  16. #166
    Quote Originally Posted by PaulStoffregen View Post
    If you're willing to try some tests, I'd really like to understand why it wasn't working. It might be a bug, and if so, I want to fix it.
    Absolutely. I'll do what I can to help. I don't typically delve too deep into the weeds on stuff, but I'm happy to take your direction and try anything you'd like me to try. To me this error is just an annoyance and doesn't affect the compile process other than a distracting message. (I've edited the library I was having the #pragma issue with, so now I have a clean compile output with just the errors that I introduce to my own code.)

  17. #167
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,229
    Looks like the Arduino developers are working on pluggable monitor support...

    https://github.com/arduino/arduino-ide/pull/982

  18. #168
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,350
    Sounds good. Still draft PR (not sure what that means), but hopefully soon!

Posting Permissions

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