Arduino CLI And IDE now Released - Teensy Supported!

Will probably take less time if you run it without typing "wget" twice ;)

Code:
C:\Users\kurte\Downloads>wget [COLOR="#FF0000"]wget[/COLOR] https://www.pjrc.com/teensy/package_teensy_index.json

Total time should be under half a second for almost anywhere in the world. Most of that time is probably the connection setup and SSL encryption key exchange.
 
Occasionally I have wondered if PJRC should move to hosting using a content delivery network which replicates data onto many servers all around the world. Today everything is hosted on 2 dedicated servers, both located at the same data center in Tampa Florida. The 2nd server isn't about bandwidth, it's about CPU load when spammers and aggressive bots hit the forum too rapidly.
 
Will probably take less time if you run it without typing "wget" twice ;)

Code:
C:\Users\kurte\Downloads>wget [COLOR="#FF0000"]wget[/COLOR] https://www.pjrc.com/teensy/package_teensy_index.json

Total time should be under half a second for almost anywhere in the world. Most of that time is probably the connection setup and SSL encryption key exchange.

:eek:

Yes a lot faster.
Code:
C:\Users\kurte\Downloads>wget https://www.pjrc.com/teensy/package_teensy_index.json
--2022-12-30 15:06:40--  https://www.pjrc.com/teensy/package_teensy_index.json
Resolving www.pjrc.com (www.pjrc.com)... 96.31.77.63
Connecting to www.pjrc.com (www.pjrc.com)|96.31.77.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35703 (35K) [application/json]
Saving to: 'package_teensy_index.json.2'

package_teensy_index.json.2   100%[=================================================>]  34.87K  --.-KB/s    in 0.1s

2022-12-30 15:06:41 (345 KB/s) - 'package_teensy_index.json.2' saved [35703/35703]

So looks like the issue might be with Arduino.
 
same 0.1s ... Win11
Code:
...\downloads\wget https://www.pjrc.com/teensy/package_teensy_index.json
--2022-12-30 16:07:28--  https://www.pjrc.com/teensy/package_teensy_index.json
Resolving www.pjrc.com (www.pjrc.com)... 96.31.77.63
Connecting to www.pjrc.com (www.pjrc.com)|96.31.77.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35703 (35K) [application/json]
Saving to: 'package_teensy_index.json'

package_teensy_index.json     100%[=================================================>]  34.87K  --.-KB/s    in 0.1s

2022-12-30 16:07:29 (352 KB/s) - 'package_teensy_index.json' saved [35703/35703]
 
I am in Argentina and this was my result:
Code:
% wget https://www.pjrc.com/teensy/package_teensy_index.json
--2022-12-31 10:12:45--  https://www.pjrc.com/teensy/package_teensy_index.json
Resolving www.pjrc.com (www.pjrc.com)... 96.31.77.63
Connecting to www.pjrc.com (www.pjrc.com)|96.31.77.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35703 (35K) [application/json]
Saving to: ‘package_teensy_index.json’

package_teensy_index.json                           100%[=================================================================================================================>]  34.87K   195KB/s    in 0.2s    

2022-12-31 10:12:49 (195 KB/s) - ‘package_teensy_index.json’ saved [35703/35703]

Regards,
Ed
 
I'm in Washington state and fastest:
Code:
wwatson@wwatsond1:~$ wget https://www.pjrc.com/teensy/package_teensy_index.json
--2022-12-31 06:24:16--  https://www.pjrc.com/teensy/package_teensy_index.json
Resolving www.pjrc.com (www.pjrc.com)... 96.31.77.63
Connecting to www.pjrc.com (www.pjrc.com)|96.31.77.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35703 (35K) [application/json]
Saving to: ‘package_teensy_index.json.1’

package_teensy_index.json.1               100%[===================================================================================>]  34.87K  --.-KB/s    in 0.09s   

2022-12-31 06:24:16 (385 KB/s) - ‘package_teensy_index.json.1’ saved [35703/35703]

And slowest:
Code:
wwatson@wwatsond1:~$ wget https://www.pjrc.com/teensy/package_teensy_index.json
--2022-12-31 06:23:59--  https://www.pjrc.com/teensy/package_teensy_index.json
Resolving www.pjrc.com (www.pjrc.com)... 96.31.77.63
Connecting to www.pjrc.com (www.pjrc.com)|96.31.77.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35703 (35K) [application/json]
Saving to: ‘package_teensy_index.json’

package_teensy_index.json                 100%[===================================================================================>]  34.87K   213KB/s    in 0.2s    

2022-12-31 06:24:01 (213 KB/s) - ‘package_teensy_index.json’ saved [35703/35703]
 
Also in WA.

Question. Been reading a thousand posts but there is a missing link for me to understand how the IDE 2 menu, pluggable discovery/teensy_ports, CLI board details, and boards.txt are not giving me a correct serial port label that displays in various reports and IDE menus.

Scenario:
I created a boards.local.txt containing my new custom USB type for 2 serial ports and 1 audio port and put it next to the 0.58.3 boards.txt. These are working fine.

boards.local.txt:
Code:
teensy41.menu.usb.serialserialaudio=Serial + Serial + Audio
teensy41.menu.usb.serialserialaudio.build.usbtype=USB_SERIAL_SERIAL_AUDIO
teensy41.menu.usb.serialserialaudio.upload_port.usbtype=USB_SERIAL_SERIAL_AUDIO
I have a matching description section in the usb-desc.h file. For now, I have PRODUCT_ID set to 0x0484 which is an unused number close to what the other types are. More on this value later.

Deleted leveldb folder to clear the boards cache and restarted the IDE. I get the proper USB type showing in the IDE USB Type menu (Serial + Serial + Audio).
I can compile and this is all physically working, I get my 2 serial ports and the audio port (at 48KHz even) and they work.

The issue is making the IDE menu and port discovery report work right using a unique PID like they do for the preexisting USB types and their PIDs.

Between builds I clean out old USB device entries in a multitude of locations in Device manager, or I have used USBDeview. If I change my PID to one of the existing used PIDs, the reported USB Type comes back as that type. For example, if I set PID=0x048A, it shows up as Serial+MIDI+Audio, yet I still get my 2 serial + 1 audio, and serialserialaudio is still pass along proper on the compile side.

There appears to be a mapping table that I cannot find so far. If it was scanning the usb_desc.h file it would know, but only 1 of those USB Type sections is compiled (due to #define), there has to be an external mapping somewhere. Boards.txt could do it if it had PIDs, but it does not the way it is set up compared to several Arduino board examples.

Also, when I run the command 'arduino-cli board details -b teensy:avr:teensy41' I get the expected usb=serialserialaudio. I note that info dump in that report shows all of the options possible, and highlights/check marks only the defaults, not what I have set. I get the same reports as many other posts in this thread and on the arduino github issues threads. I cannot tell if this is a known problem or by design, but it appears to not matter to my problem because if I change my PID I can force the port label to say anything I want as long as it is a preexisting type.

Example output (small section of it):
Code:
D:\Documents\GitHub\SDRProjects\KEITHSDR\SDR_RA8875>"\ArduinoIDE\Arduino IDE\resources\app\node_modules\arduino-ide-extension\build\arduino-cli" board details -b teensy:avr:teensy41
Board name:                Teensy 4.1
FQBN:                      teensy:avr:teensy41
Board version:             0.58.3

Identification properties: modelID=0x25

Package name:              teensy
Package maintainer:        Paul Stoffregen
Package URL:               https://www.pjrc.com/teensy/package_teensy_index.json
Package website:           https://www.pjrc.com/teensy/td_download.html
Package online help:       https://forum.pjrc.com/forum.php

Platform name:             Teensy
Platform category:         Contributed
Platform architecture:     avr
Platform URL:              https://www.pjrc.com/teensy/td_158-beta3/teensy-package.tar.bz2
Platform file name:        teensy-package.tar.bz2
Platform size (bytes):     33761456
Platform checksum:         SHA-256:593b43c860ac16208fc0e506ed2cf1581a52e9cfcb44fca8a0f94a252b9f8095

Required tool:             teensy:teensy-tools                                 0.58.3

Required tool:             teensy:teensy-compile                               11.3.1-beta2

Option:                    USB Type                                                         usb
                           Serial                                              ✔            usb=serial
                           Dual Serial                                                      usb=serial2
                           Triple Serial                                                    usb=serial3
                           Keyboard                                                         usb=keyboard
                           Keyboard + Touch Screen                                          usb=touch
                           Keyboard + Mouse + Touch Screen                                  usb=hidtouch
                           Keyboard + Mouse + Joystick                                      usb=hid
                           Serial + Keyboard + Mouse + Joystick                             usb=serialhid
                           MIDI                                                             usb=midi
                           MIDIx4                                                           usb=midi4
                           MIDIx16                                                          usb=midi16
                           Serial + MIDI                                                    usb=serialmidi
                           Serial + MIDIx4                                                  usb=serialmidi4
                           Serial + MIDIx16                                                 usb=serialmidi16
                           Audio                                                            usb=audio
                           Serial + MIDI + Audio                                            usb=serialmidiaudio
                           Serial + MIDIx16 + Audio                                         usb=serialmidi16audio
                           MTP Disk (Experimental)                                          usb=mtp
                           Serial + MTP Disk (Experimental)                                 usb=serialmtp
                           Raw HID                                                          usb=rawhid
                           Flight Sim Controls                                              usb=flightsim
                           Flight Sim Controls + Joystick                                   usb=flightsimjoystick
                           Serial + Serial + Audio                                          usb=serialserialaudio
Option:                    CPU Speed                                                        speed
                           600 MHz                                             ✔            speed=600
                           528 MHz                                                          speed=528
                           450 MHz                                                          speed=450
                           396 MHz                                                          speed=396
                           150 MHz                                                          speed=150
                           24 MHz                                                           speed=24
                           720 MHz (overclock)                                              speed=720
                           816 MHz (overclock)                                              speed=816
                           912 MHz (overclock, cooling req'd)                               speed=912
                           960 MHz (overclock, cooling req'd)                               speed=960
                           1.008 GHz (overclock, cooling req'd)                             speed=1008
Option:                    Optimize                                                         opt
                           Faster                                              ✔            opt=o2std
                           Fast                                                             opt=o1std
                           Fastest                                                          opt=o3std
                           Debug                                                            opt=ogstd
                           Smallest Code                                                    opt=osstd
Option:                    Keyboard Layout                                                  keys
                           US English                                          ✔            keys=en-us
                           Canadian French                                                  keys=fr-ca
                           Canadian Multilingual                                            keys=xx-ca
                           Czech                                                            keys=cz-cz
                           Danish                                                           keys=da-da
                           Finnish                                                          keys=fi-fi
                           French                                                           keys=fr-fr
                           French Belgian                                                   keys=fr-be
                           French Swiss                                                     keys=fr-ch
                           German                                                           keys=de-de
                           German (Mac)                                                     keys=de-dm
                           German Swiss                                                     keys=de-ch
                           Icelandic                                                        keys=is-is
                           Irish                                                            keys=en-ie
                           Italian                                                          keys=it-it
                           Norwegian                                                        keys=no-no
                           Portuguese                                                       keys=pt-pt
                           Portuguese Brazilian                                             keys=pt-br
                           Serbian (Latin Only)                                             keys=rs-rs
                           Spanish                                                          keys=es-es
                           Spanish Latin America                                            keys=es-mx
                           Swedish                                                          keys=sv-se
                           Turkish (partial)                                                keys=tr-tr
                           United Kingdom                                                   keys=en-gb
                           US International                                                 keys=usint
Programmers:               Id                                                  Name
In the above cli report you can see my usb=serialserialaudio exists. Below that you can see the speed is 600MHz, mine is set to 816MHz. The default is marked like all other Options including usb=serial. I might guess it has no idea of what is currently active and the green marks are for future use?

So back to the main problem:

The IDE, in the boards drop down and in the Tools: ports menu, and teensy_ports utility both fail to show my custom USB Type. The com port is reported as
COM6 unknown (Teensy 4.1) in the arduino-cli board list "board name FQBN" column and in the UI ports list and drop down list.
Code:
D:\Documents\GitHub\SDRProjects\KEITHSDR\SDR_RA8875>"\ArduinoIDE\Arduino IDE\resources\app\node_modules\arduino-ide-extension\build\arduino-cli" board list
Port               Protocol Type              Board Name FQBN                Core
COM1               serial   Serial Port       Unknown
COM2               serial   Serial Port       Unknown
COM3               serial   Serial Port       Unknown
COM6               serial   Serial Port (USB) Unknown
COM7               serial   Serial Port (USB) Unknown
usb:0/1D0000/0/1/4 teensy   Teensy Ports      Teensy 4.1 teensy:avr:teensy41 teensy:avr

The output of teensy_ports.exe
Code:
{
  "address": "usb:0/1D0000/0/1/4",
  "online": true,
  "label": "COM6 (Teensy 4.1) Unknown",
  "vid": "16C0",
  "pid": "0484",
  "iserial": "877382",
  "boardName": "Teensy 4.1",
  "protocol": "Teensy"
}

teensy_ports again, now after changing the PID to 0x048A which is what the Serial+Midi+Audio is using in usb_desc.h file. As mentioned, I still get my dual_serial+Audio, it is just reported wrong.
Code:
{
  "address": "usb:0/1D0000/0/1/4",
  "online": true,
  "label": "COM5 (Teensy 4.1) Serial+MIDI+Audio",
  "vid": "16C0",
  "pid": "048A",
  "iserial": "877382",
  "boardName": "Teensy 4.1",
  "protocol": "Teensy"
}

Perhaps this label list is hardcoded?

- Mike K7MDL
 
FYI.

Another item I just discovered, the boards.local.txt, which is working for the IDE, is not being read by VS Code's board manager UI. I have to move the boards.local.txt content into boards.txt to get the VS Code board manager UI to display my Serial+Serial+Audio USB Type.

If I remove my custom USB Type entries, restarting VS Code, it pops up this message:

'Invalid board configuration detected in configuration file: Invalid configuration value. Falling back to defaults.'

Sure enough, my Serial+Serial+Audio is missing in the board manager again.

That seems to be a VS Code Arduino Extension bug so I just filed issue #1563 for that.
https://github.com/microsoft/vscode-arduino/issues/1563
 
Between builds I clean out old USB device entries in a multitude of locations in Device manager, or I have used USBDeview. If I change my PID to one of the existing used PIDs, the reported USB Type comes back as that type. For example, if I set PID=0x048A, it shows up as Serial+MIDI+Audio, yet I still get my 2 serial + 1 audio, and serialserialaudio is still pass along proper on the compile side.

Maybe Windows is retaining info about the USB devices in the Windows Registry?

Relying on old info from the Registry seems quite silly when USB enumeration requires reading the device and config descriptors which gives all the info. But Microsoft really loves their Windows Registry and that is unfortunately the way they designed Windows. It's very frustrating when you're developing USB devices....

The easy solution is to change the BCD device number, so Windows sees it as a new version of the device which may not be the same as stored in the Windows Registry.
 
Last edited:
Good Morning all,

Paul, @PerT,

If I am reading the last few messages correctly, I think there may be at least two parts to it.

The last part talking about how Windows caches information.

But I believe he is also asking about what assumptions and/or are some pieces of the pluggable stuff in the IDEs maybe are had coded into the different pieces? as related to Vendor ID and Product ID?

That is if he uses his on VID:pID, is there anything that maps that back to being a Teensy?
As part of this would generate a FQBN (Fully Qualified Board Name)?

I am guessing that there may not be, as you (Paul) mentioned in the thread: https://forum.pjrc.com/threads/71707-Flight-Sim-Controls-Serial?p=317627&viewfull=1#post317627
Yes, utilities like teensy_reboot.exe and teensy_monitor.exe "know" which interfaces each VID/PID would normally have. So if you make changes, you may have to manually press the pushbutton to initiate uploading new code. If you've removed the HID seremu interface and put in real serial, the Arduino Serial Monitor with a "Teensy port" selected in Tools > Port won't work, because it will expect to use the seremu HID interface. But you can use "Serial port" and Arduino's utilities will access it as a serial device, or you can use a 3rd party program like Coolterm.
 
Hard coded was my guess. Short of modifying the sources for the tools, using one of the known PIDs is probably best, the reported USB type may be wrong but seems harmless in this case. At least we can explain that now with confidence.

I do clear out the unused devices and can confirm this is working because I can reuse the names/ports and see the changed details such as PID and names and see when I have 2 serial and 1 audio versus some other combo. I had over 20 hidden MIDI devices I had missed clearing out from when I was using Serial+MIDI+Audio until now.

The 2nd part was how the cli board details report comes back with a correct list of options but only the option defaults are marked, not the actual settings. That feels hard coded also.

I will look in the source code for the tools involved next and see what those does for grins.

I have returned to modifying the boards.txt for now since VS Code is ignoring the boards.local.txt until that bug is addressed. I have builds working that way I need in both the IDE 2 and VSD Code again with 0.58.3. So far so good, I have my custom combos working which is most important for me.

Thanks for looking at this!
 
The 2nd part was how the cli board details report comes back with a correct list of options but only the option defaults are marked, not the actual settings. That feels hard coded also.

Before 1.57.1, teensy_discovery was telling Arduino CLI which USB Type it saw, based on the VID/PID. I was planning to add USB descriptors so we could detect all the settings. But IDE2 wasn't just unable to use this info, it caused serious errors. It's Arduino issue 1588. My hope is Arduino will eventually fix this. But because the error makes Teensy unusable, we can't resume giving the CLI & IDE any additional info until enough of the Arduino community has upgraded past versions with issue 1588.

Maybe in some distant future I'll make all the Teensy tools highly configurable, maybe even a GUI to pick and choose features (perhaps Arduino adds a feature for issue 58). But with a couple years of software backlog, and the IDE currently not able to even receive any detected info about the settings, that glorious possible future seems a very long way off.
 
@PerT and @PaulStoffregen

Quick follow on to the: It feels like it takes a long time to read in the Teensy JSON file, sometimes like 15-20 seconds or more:
https://forum.pjrc.com/threads/5354...nsy-Supported!?p=317969&viewfull=1#post317969

And I believe is not Teensy specific, just that is where I normally see it.

This morning I started up the IDE from command prompt:
And guessing this is maybe where the JSON files are read in:
Code:
2023-01-06T14:03:47.784Z daemon INFO INFO[0010] Updating index                                url="https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCM9.04/master/arduino/opencm_release/package_opencm9.04_index.json"

2023-01-06T14:03:47.785Z root INFO core-client-provider [platform-index]
2023-01-06T14:03:47.990Z daemon INFO INFO[0010] Updating index                                url="https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json"

2023-01-06T14:03:47.991Z root INFO core-client-provider [platform-index]
2023-01-06T14:03:48.200Z daemon INFO INFO[0010] Updating index                                url="https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json"

2023-01-06T14:03:48.201Z root INFO core-client-provider [platform-index]
2023-01-06T14:03:48.677Z daemon INFO INFO[0011] Updating index                                url="https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/main/package_sparkfun_apollo3_index.json"

2023-01-06T14:03:48.678Z root INFO core-client-provider [platform-index]
2023-01-06T14:03:48.911Z daemon INFO INFO[0011] Updating index                                url="https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json"

[COLOR="#FF0000"]2023-01-06T14:03:48.913Z root INFO core-client-provider [platform-index]
2023-01-06T14:03:49.133Z daemon INFO INFO[0011] Updating index                                url="https://www.pjrc.com/teensy/package_teensy_index.json"
[/COLOR]
2023-01-06T14:03:49.134Z root INFO core-client-provider [platform-index]
2023-01-06T14:03:49.924Z daemon INFO INFO[0012] Loading hardware from: c:\Users\kurte\AppData\Local\Arduino15\packages

2023-01-06T14:03:49.924Z daemon INFO INFO[0012] Loading package OpenCM904 from: C:\Users\kurte\AppData\Local\Arduino15\packages\OpenCM904\hardware

2023-01-06T14:03:49.926Z daemon INFO INFO[0012] Checking signature                            error="opening signature file: open C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\OpenCM904\\hardware\\OpenCM904\\1.5.1\\installed.json.sig: The system cannot find the file specified." index="C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\OpenCM904\\hardware\\OpenCM904\\1.5.1\\installed.json" signatureFile="C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\OpenCM904\\hardware\\OpenCM904\\1.5.1\\installed.json.sig"

<Something like 250 line later>

2023-01-06T14:03:50.373Z daemon INFO INFO[0012] Adding libraries dir                          dir="c:\\Users\\kurte\\Documents\\Arduino\\libraries" location=user

2023-01-06T14:03:54.308Z root ERROR ---- !!!SLOW!!! DURATION: search took 437.609 ms. Args: [{"query":"","type":"Updatable","topic":"All"}] ----
2023-01-06T14:03:55.248Z daemon INFO INFO[0017] Resolving include USBHost_t36.h for arch avr
INFO[0017]   found better lib                            lib=USBHost_t36 prio=643
INFO[0017]   discarded                                   lib=USBHost_t36 prio=642

2023-01-06T14:03:55.435Z daemon INFO INFO[0017] Resolving include SdFat.h for arch avr

2023-01-06T14:03:55.435Z daemon INFO INFO[0017]   found better lib                            lib="SdFat - Adafruit Fork" prio=517
INFO[0017]   found better lib                            lib=SdFat prio=643
INFO[0017]   discarded                                   lib=SdFat prio=642

2023-01-06T14:03:55.663Z daemon INFO INFO[0018] Resolving include SPI.h for arch avr
INFO[0018]   found better lib                            lib=SPI prio=642

2023-01-06T14:03:56.349Z root ERROR ---- !!!SLOW!!! DURATION: search took 370.641 ms. Args: [{"query":"","type":"Updatable","topic":"All"}] ----
2023-01-06T14:03:57.824Z daemon INFO INFO[0020] Resolving include EEPROM.h for arch avr
INFO[0020]   found better lib                            lib=EEPROM prio=642

2023-01-06T14:04:08.748Z daemon INFO INFO[0031] Searching tools required for board teensy:avr:teensy41
INFO[0031] Required tool                                 tool="teensy:teensy-compile@11.3.1-beta2"
INFO[0031] Required tool                                 tool="teensy:teensy-tools@0.58.3"

[63996:0106/060536.525:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is
probably somewhere down here is when it finally removes the downloading index for teensy...

Also on fresh install (this case on RPI), I first startup the IDE, go to preferences add the teensy URL, and OK it...
It shows that same message, while the output window is showing it doing other things like installing avr stuff.

Maybe the message should go away after it completes downloading it, and/or change the message to something like updating index, or library list or...
 
In case anyone has not noticed:

Arduino released version 2.0.4. A few days ago.
I have not had any new issues with it, but have seen some reports up on Arduino forum, where some people have run into issues, like with blank window...

Note: This release does not fix their Terminal monitor window properly scrolling to the bottom of the screen. Like it decides where the bottom is, then goes there
and then adds on the new line or lines...

However today a fix (hopefully) was merged in. Not sure yet if it is in todays daily builds or not, or if will be in tomorrows.
 
Code:
Wow, I see there's been a ton of work done. I took several months off and I'm attempting to get back up to speed
using arduino-cli. I'm trying to utilize project profiles using Teensy 4.1 as one of the platforms.

Code:
profiles:
  teensy:
    notes: basic teensy 4.1 profile
    fqbn: teensy:avr:teensy41
    platforms:
      - platform: teensy:avr (1.58.0)
        platform_index_url: https://www.pjrc.com/teensy/package_teensy_index.json
A basic blink sketch seems to compile, and uploads successfully, however there is an error message

Code:
 arduino-cli compile --profile teensy
Error initializing instance: Error loading hardware platform: discovery teensy:teensy-discovery not installed
Memory Usage on Teensy 4.1:
  FLASH: code:10700, data:4044, headers:8804   free for files:8102916
   RAM1: variables:4832, code:8064, padding:24704   free for local variables:486688
   RAM2: variables:12416  free for malloc/new:511872
When I ask arduino-cli for the board details, there's nothing regarding teensy:teensy-discovery being a dependency,
though it does mention others.

Code:
arduino-cli board details -b teensy:avr:teensy41
Required tool: teensy:teensy-compile                 11.3.1
Required tool: teensy:teensy-tools                   1.58.0
As I said previously, the program does compile and upload so that's good. I just wanted to know if I'm doing something incorrectly, or
if arduino-cli profiles isn't working as intended just yet. I appreciate everyone posting updates on progress
regarding the arduino ide 2.0. It's saved me from an unnecessary amount of headache.
 
When I ask arduino-cli for the board details, there's nothing regarding teensy:teensy-discovery being a dependency,
though it does mention others.

Confirm, I tried Arduino CLI nightly-20230409 just now. Indeed it lacks any mention of teensy-discovery or teensy-monitor with the command "arduino-cli board details -b teensy:avr:teensy41".

I tried uninstalling with IDE 2.0.4 Boards Manager, and then I deleted the ~/.arduino15/packages/teensy folder. When I run "arduino-cli core install teensy:avr", it does indeed install teensy-discovery and teensy-monitor.

Code:
paul@preston:~/bin > ./arduino-cli core install teensy:avr
Downloading packages...
teensy:teensy-tools@1.58.0 downloaded
teensy:teensy-compile@11.3.1 teensy:teensy-compile@11.3.1 already downloaded
[COLOR="#008000"]teensy:teensy-discovery@1.58.0 downloaded[/COLOR]
[COLOR="#008000"]teensy:teensy-monitor@1.58.0 downloaded[/COLOR]              
teensy:avr@1.58.0 downloaded
Installing teensy:teensy-tools@1.58.0...
Configuring tool....
teensy:teensy-tools@1.58.0 installed
Installing teensy:teensy-compile@11.3.1...
Configuring tool....
teensy:teensy-compile@11.3.1 installed
Installing teensy:teensy-discovery@1.58.0...[COLOR="#008000"]
Configuring tool....
teensy:teensy-discovery@1.58.0 installed
Installing teensy:teensy-monitor@1.58.0...
Configuring tool....
teensy:teensy-monitor@1.58.0 installed
Installing platform teensy:avr@1.58.0...[/COLOR]
Configuring platform....
Platform teensy:avr@1.58.0 installed

So at least we can rest easy knowing it really is installing all the required tools. Looks like a simple bug where "board details" just isn't showing all the info. My guess is "board details" is parsing the JSON and boards.txt and platform.txt, but probably only looks for "toolsDependencies" and doesn't parse for "discoveryDependencies" and "monitorDependencies" as required by their platform specification.

I created a new issue to report the problem.

https://github.com/arduino/arduino-cli/issues/2141
 
Notes about Playing with the IDE 2 debugger,

For the fun of it, I thought I would try out one of the new features of the Arduino IDE that comes with IDE2, which is the debugger. I had not done so up until now as the Teensy boards do not support hardware debugging.

First issue: Finding boards to try this with. I looked at the Arduino documentation for this: https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-debugger which I found very incomplete as it showed
only three categories of boards or ways to support boards (Direct USB, Segger J-Link, Atmel-ICE), none of which I have.

M0/M4 boards:
Direct USB, they showed only Arduino Zero - which I don't have, thought about ordering one, but at $50, sorry ...
Segger J-Link/Atmel Ice - Don't have, and if you don't qualify for Segger EDU version, their base unit is something like $500,
The EDU unit: https://www.adafruit.com/product/3571 is about $60

But when I posted up on Arduino forum (https://forum.arduino.cc/t/adding-debug-support-to-a-non-arm-eabi-board-type/1138076)
@PerT mentioned that he is using one of these: https://www.tindie.com/products/ataradov/cmsis-dap-compliant-swd-debugger/
which at $12 is a little more reasonable ;) So I ordered one, which is now waiting for me in town in my mailbox, but while waiting, the
Tindie page mentioned, using an RPI Pico for this, and use the code or image up at: https://github.com/ataradov/free-dap
Since I had 3 PICO boards sitting in a box, decided to try this. It works.

First up I tried the Arduino MKRZero - I needed to solder some wires onto the SWD pins on the bottom, and then jumpered it to the appropriate pins on the PICO.
it Worked :D was able to start playing. Curiosity got me, as the same little box that I had the MKRZero in I had a couple of Adafruit M0 and M4 boards in, so tried those
and found that they did not enable the debug button, we were able to get the M0 working by adding the debug section to the platform.txt and update a few things in
their files to match the Arduino and the button was enabled and it worked on M0... We posted and created issue up on Adafruit and one of their contributors took it from there.
Yesterday he fixed it and Last night they integrated in a fix. ;) Part of it was they needed to switch from OpenOCD version 0.9. to 0.11.

Note: The Adafruit developer recommend another CMIS-DAP that Adafruit sells for $12: https://www.adafruit.com/product/5699
The firmware for it is up at: https://github.com/raspberrypi/picoprobe and I believe it can be used on the PICO board. I may try it soon.

ESP32 boards:

I noticed when playing with ESP32 boards that the debug button was enabled, so I have tried with a few different boards. Had some luck with a few of them, but...

Like the ESP32-S2 board, failed to launch it.
Screenshot.png

Likewise I tried a Micromod ESP32 and it failed the same way.

ESP32-C3 - was curious about these as they are a risc-v (not arm) board. The debugger actually comes up:
Screenshot2.jpg
Not sure how well it works yet. Things like stepping on this board appears to fail. But I have an oddball clone of the ESP32-c3, I have a couple standard ones
waiting for me in my mailbox... Will hopefully try it out on those and see how it works.

RPI2040
I believe this is supposed to work. I tried hooking up with the Micromod RPI2040, but it has been awhile since I played with this and forgot how to program it
using the Arduino IDE... Will play some more.

That is all I have tried so far. May play around with a few others or go on to the next diversions. But this has been interesting.
 
@KurtE

RP2040: The micromod version of the RP2040 boots into the UF2 bootloader and all you have to do is to copy free_dap_rp2040.uf2 to the drive that appears and it reboots into free_dap. GPIO11(DAT1) => SWCLK, GPIO12(CIPO1) =>SWDIO and GPIO15(COPI1) => RST, tested it on the Adafruit Feather M0

The CMSIS-DAP Compliant SWD Debugger that @PerT mentioned I just hooked up to the Adafruit Metro Express M0 that I have and it worked out of the box. Thats all I tested with so far.

The Jlink EDU Mini I hooked up to the Express M0 but having issues = probably because I don't know how to use it. When I did try Arduino IDE gave an error that it could not find a compliant CMSIS-Dap device. So may be a config issue as well.
 
@mjs513 - Sounds good will maybe play a bit more with the RP2040,
But just picked up the other two C3 boards, so want to try them, plus the CMIS-DAP arrived as well. Don't have any boards that have that SWD connector on them. Unless one of the MicroMod boards have it populated.

Back to playing and enjoying a nice sunny day :D
 
@mjs513 - Sounds good will maybe play a bit more with the RP2040,
But just picked up the other two C3 boards, so want to try them, plus the CMIS-DAP arrived as well. Don't have any boards that have that SWD connector on them. Unless one of the MicroMod boards have it populated.

Back to playing and enjoying a nice sunny day :D

@KurtE - enjoy the day - its rainy, damp and chilly for the next week or so. Did manage to get the JLink EDU Mini working with the Express Metro M0 board (has the header) but had to follow these instructions:
https://docs.arduino.cc/tutorials/mkr-wifi-1010/mkr-jlink-setup
 
New machine here installed IDE 2.1 and 1.58.1 with the JSON - stuff working!

Seeing this in output console: Can't find location of default key .pem file

Prefs / Sketchbook: t:\T_Drive\tCode

File there from other machine copy - but restarted IDE and this file exists: "T:\T_Drive\tCode\key.pem"

For fun put a copy here too: "C:\Users\Tim\Documents\Arduino\key.pem"

Drive "T:" is a second SSD drive - a real drive so no conflict with 'virtual ramdrive' or anything.

Was a report/fix of this missed? Maybe the "%appdata%\..\local" IDE caching is doing the wrong thing

Changed pref / sketchbook back to: c:\Users\Tim\Documents\Arduino
> still get: Can't find location of default key .pem file
Closed and opened IDE 2.1: Still Can't find
Removed all TEMP build arduino\sketches: Still Can't find

Sketchook and IDE 1.8.19 copied from prior PC. Adjusted sketchbook folder and build with no complaint:
Code:
...
"T:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "T:\\TEMP\\arduino_build_83961/PPSfromRTC.ino.elf" "T:\\TEMP\\arduino_build_83961/PPSfromRTC.ino.eep"
"T:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "T:\\TEMP\\arduino_build_83961/PPSfromRTC.ino.elf" "T:\\TEMP\\arduino_build_83961/PPSfromRTC.ino.hex"
[B]"T:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/teensy_secure" encrypthex TEENSY40 "T:\\TEMP\\arduino_build_83961/PPSfromRTC.ino.hex"
encrypting 65536 bytes to T:\TEMP\arduino_build_83961/PPSfromRTC.ino.ehex
[/B]"T:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/teensy_post_compile" -file=PPSfromRTC.ino "-path=T:\\TEMP\\arduino_build_83961" "-tools=T:\\T_Drive\\arduino-1.8.19\\hardware\\teensy/../tools/" -board=TEENSY40
...

Here is full build output - teensy_secure does not show where it was told to look:
Code:
FQBN: teensy:avr:teensy40
Using board 'teensy40' from platform in folder: C:\Users\Tim\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1
Using core 'teensy4' from platform in folder: C:\Users\Tim\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1

Detecting libraries used...
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=158 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.58.1\\cores\\teensy4" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3\\sketch\\PPSfromRTC.ino.cpp" -o nul
Generating function prototypes...
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=158 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.58.1\\cores\\teensy4" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3\\sketch\\PPSfromRTC.ino.cpp" -o "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.58.0/precompile_helper" "C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.58.1/cores/teensy4" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3" "C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=158 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.58.1/cores/teensy4" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/pch/Arduino.h" -o "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/pch/Arduino.h.gch"
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=158 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/pch" "-IC:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.58.1\\cores\\teensy4" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3\\sketch\\PPSfromRTC.ino.cpp" -o "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3\\sketch\\PPSfromRTC.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: T:\TEMP\arduino\cores\teensy_avr_teensy40_usb_serial,speed_600,opt_o2std,keys_en-us_1a66042b19b72ce3cf3c3a39cf22308d\core.a
Linking everything together...
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax "-TC:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.58.1\\cores\\teensy4/imxrt1062.ld" -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.elf" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3\\sketch\\PPSfromRTC.ino.cpp.o" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/..\\..\\cores\\teensy_avr_teensy40_usb_serial,speed_600,opt_o2std,keys_en-us_1a66042b19b72ce3cf3c3a39cf22308d\\core.a" "-LT:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3" -larm_cortexM7lfsp_math -lm -lstdc++
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.elf" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.eep"
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.elf" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.hex"
[B]"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.58.0/teensy_secure" encrypthex TEENSY40 "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.hex"
Can't find location of default key .pem file[/B]
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.58.0/teensy_post_compile" -file=PPSfromRTC.ino "-path=T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3" "-tools=C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.58.0/" -board=TEENSY40
Memory Usage on Teensy 4.0:
  FLASH: code:31892, data:32716, headers:9116   free for files:1957892
   RAM1: variables:33600, code:30168, padding:2600   free for local variables:457920
   RAM2: variables:12416  free for malloc/new:511872
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.58.0/stdout_redirect" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.sym" "C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objdump" -t -C "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.elf"
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.58.0/teensy_size" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.elf"
"C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.58.0/stdout_redirect" "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.lst" "C:\\Users\\Tim\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objdump" -d -S -C "T:\\TEMP\\arduino\\sketches\\437F3581B15EC97DA85D6EB817CFB0A3/PPSfromRTC.ino.elf"

"C:\Users\Tim\AppData\Local\Arduino15\packages\teensy\tools\teensy-tools\1.58.0/teensy_post_compile" "-file=PPSfromRTC.ino" "-path=T:\TEMP\arduino\sketches\437F3581B15EC97DA85D6EB817CFB0A3" "-tools=C:\Users\Tim\AppData\Local\Arduino15\packages\teensy\tools\teensy-tools\1.58.0" "-board=TEENSY40" -reboot "-port=usb:0/140000/0/8" "-portlabel={serial.port.label}" "-portprotocol={serial.port.protocol}"
 
New machine here installed IDE 2.1 and 1.58.1 with the JSON - stuff working!

Seeing this in output console: Can't find location of default key .pem file

...

Machine powered down and moved to its home.

Builds today do NOT show the failure to find the key.pem file ???

Something in the IDE must have not cleared until fresh restart? Not sure it was repowered with respect to pulling the sketchbook folder with that file to the new machine and pointing the IDE to that folder.
 
Back
Top