Teensyduino 1.49 Beta #2

Status
Not open for further replies.

Paul

Administrator
Staff member
Here is a second beta test for Teensyduino 1.49.


EDIT: links removed, please use 1.49-beta3



Changes since Teensyduino 1.49-beta1

Add Teensy 4.0 USB MIDI, Keyboard, Mouse, Joystick
Support for MacOS Catalina
Port WS2812Serial to Teensy 4.0 (KurtE)
AVR register emulation on Teensy 4.0 (KurtE)
Fix serial DMA def on Teensy 4.0 (KurtE)
Improve ADC & XBAR defs on Teensy 4.0 (KurtE)
Improve quadrature encoder defs on Teensy 4.0 (mjs513)
Add Teensy 4.0 USB Touchscreen, not finished... work in progress
Remove serial monitor debug messages on Arduino 1.8.9
 
@Paul

Downloaded and installed Beta2 with no issues whatsoever. Did see all the new USB stuff in the IDE dropdowns.

Out of curiosity I tried to run the keyboard simple example but my PC is having issues with it. Never used the usb stuff before so maybe it is me. Anyway, first run I had SerMon open and I saw the hello wrld displayed in the sermon. My PC then said it created a new Keyboard but then it went all of a sudden it logged me off and the my logon screen displayed and then I was stuck so I just hit restart.

Next run I had notepad open and plugged the T4 in again and again it went even crazier. My web browser pop upped, then the xbox gaming app opened, and then it wanted to install tycommander so I just unplugged the T4 to get control back. Not sure this is the desired behavior.

For reference I am on a Windows 10 x64 machine.
 
I'll confess... I tested the new USB stuff mostly with Linux and a quick check on Mac, but not Windows. I use Linux as my primary system, and the Macbook Air was set up due to the recent work on MacOS Catalina support.

I did watch the communication with the Beagle 480 protocol analyzer.

Looks like I'll need to get my Windows 10 test machine out later today! Can you tell me exactly which example you ran? Was any other hardware connected to your Teensy 4.0 during the test?
 
I'll confess... I tested the new USB stuff mostly with Linux and a quick check on Mac, but not Windows. I use Linux as my primary system, and the Macbook Air was set up due to the recent work on MacOS Catalina support.

I did watch the communication with the Beagle 480 protocol analyzer.

Looks like I'll need to get my Windows 10 test machine out later today! Can you tell me exactly which example you ran? Was any other hardware connected to your Teensy 4.0 during the test?

Morning again.

Anyway, ran the Simple USB Keyboard Example, simple.ino, under keyboard examples. Nothing else was hooked up to the T4. Was using a the Ultimate T4 breakout board I got off Tindie. Reason - it was handy. It did have a SD card in the its SD Socket.

Also, just in case it might have been the breakout board I tested with one of my breakouts that I have been using with nothing additional on the board. All it does is bring the pins on the T4 out to the headers. It exhibited the exact same behavior.
 
Downloaded and installed TD 1.49b2 for some reason this time it gave this on first run - I did not pick "Run":
SmartScreen_1.49b2.png
Looked at properties and it offered 'UNBLOCK', I did not check that and re-ran the download and it completed without issue or prompt from Windows 10.

Re: Clock issue Failure of Micros() at some speeds - that does repro at 24 MHz. I edited compile to start at 150 MHz and that does work properly - updated in post. Edited code there as it was missing a 0 when asking for 150MHz - it was type 15 MHz.

Accidentally had "USB Serial=S/M/K/J" on other sketch and Windows gave this:Win10_SKMJ_install.png

Ran the 'Simple.ino' and got 3 things to close and nothing in notepad - T4 with nothing connected: Excel, OneDrive, Browser page to 'Linked In', also TyCommander display page changed.

This "T:\arduino_1.8.10\examples\09.USB\Keyboard\KeyboardSerial\KeyboardSerial.ino" won't build 'keyboard' or 'Ser + Mouse + Key + Joy'
T:\arduino_1.8.10\arduino-builder -dump-prefs -logger=machine -hardware T:\arduino_1.8.10\hardware -hardware C:\Users\Tim\AppData\Local\Arduino15\packages -hardware T:\tCode\hardware -tools T:\arduino_1.8.10\tools-builder -tools T:\arduino_1.8.10\hardware\tools\avr -tools C:\Users\Tim\AppData\Local\Arduino15\packages -built-in-libraries T:\arduino_1.8.10\libraries -libraries T:\tCode\libraries -fqbn=teensy:avr:teensy40:usb=keyboard,speed=600,opt=o2std,keys=en-us -ide-version=10810 -build-path T:\TEMP\arduino_build_750081 -warnings=more -build-cache T:\TEMP\arduino_cache_493927 -verbose T:\arduino_1.8.10\examples\09.USB\Keyboard\KeyboardSerial\KeyboardSerial.ino
T:\arduino_1.8.10\arduino-builder -compile -logger=machine -hardware T:\arduino_1.8.10\hardware -hardware C:\Users\Tim\AppData\Local\Arduino15\packages -hardware T:\tCode\hardware -tools T:\arduino_1.8.10\tools-builder -tools T:\arduino_1.8.10\hardware\tools\avr -tools C:\Users\Tim\AppData\Local\Arduino15\packages -built-in-libraries T:\arduino_1.8.10\libraries -libraries T:\tCode\libraries -fqbn=teensy:avr:teensy40:usb=keyboard,speed=600,opt=o2std,keys=en-us -ide-version=10810 -build-path T:\TEMP\arduino_build_750081 -warnings=more -build-cache T:\TEMP\arduino_cache_493927 -verbose T:\arduino_1.8.10\examples\09.USB\Keyboard\KeyboardSerial\KeyboardSerial.ino
Using board 'teensy40' from platform in folder: T:\arduino_1.8.10\hardware\teensy\avr
Using core 'teensy4' from platform in folder: T:\arduino_1.8.10\hardware\teensy\avr
Detecting libraries used...
"T:\\arduino_1.8.10\\hardware\\teensy/../tools/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=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_KEYBOARDONLY -DLAYOUT_US_ENGLISH "-IT:\\arduino_1.8.10\\hardware\\teensy\\avr\\cores\\teensy4" "T:\\TEMP\\arduino_build_750081\\sketch\\KeyboardSerial.ino.cpp" -o nul
Alternatives for Keyboard.h: [Keyboard@1.0.2]
ResolveLibrary(Keyboard.h)
-> candidates: [Keyboard@1.0.2]
"T:\\arduino_1.8.10\\hardware\\teensy/../tools/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=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_KEYBOARDONLY -DLAYOUT_US_ENGLISH "-IT:\\arduino_1.8.10\\hardware\\teensy\\avr\\cores\\teensy4" "-IT:\\arduino_1.8.10\\libraries\\Keyboard\\src" "T:\\TEMP\\arduino_build_750081\\sketch\\KeyboardSerial.ino.cpp" -o nul
Alternatives for HID.h: []
In file included from T:\arduino_1.8.10\examples\09.USB\Keyboard\KeyboardSerial\KeyboardSerial.ino:22:0:

ResolveLibrary(HID.h)
T:\arduino_1.8.10\libraries\Keyboard\src/Keyboard.h:25:17: fatal error: HID.h: No such file or directory

-> candidates: []
compilation terminated.

Multiple libraries were found for "Keyboard.h"
Used: T:\arduino_1.8.10\libraries\Keyboard
Using library Keyboard at version 1.0.2 in folder: T:\arduino_1.8.10\libraries\Keyboard
Error compiling for board Teensy 4.0.
 
Installed on linux mint 19.2 Tina, XFCE desktop, Arduino 1.8.10

USB Midi example " InputRead " works as expected.

USB Keyboard example "Simple"... "all hell" breaks loose. Random applications launched, ' Start menu' opens, volume control activates.
 
Last edited:
attached T4 previously flashed with "Keyboard Simple" sketch to windows 10 notebook computer. It rebooted, and failed to acknowledge the built in keyboard. Another reboot corrected this.

A second attempt to connect it with setting opened to devices page... device found, but same results immediately afterward... reboot, locked out of default keyboard device.
 
Windows 10 Pro 1909 x64 build 18363.476

Trying to run example "Teensy USB_MIDI Buttons"

CPU Speed: "600MHz" (default)
Optimize: "Faster" (default)

USB Type: "MIDI"
Windows builtin MIDI driver: Device driver not started (code 10), "nonpresent device"
Korg USB MIDI driver 1.15.31.2 (recent): Driver loads and starts, exactly one "Note on" gets through, then no communication any more. T4 keeps on running.

USB Type: "Serial + MIDI"
Does not compile. Arduino errors:
Code:
Arduino: 1.8.10 (Windows 10), TD: 1.49-beta2, Board: "Teensy 4.0, Serial + MIDI, 600 MHz, Faster, US International"

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:683:13: error: 'CDC_RX_SIZE_480' undeclared here (not in a function)

         LSB(CDC_RX_SIZE_480),MSB(CDC_RX_SIZE_480),// wMaxPacketSize

             ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:64:18: note: in definition of macro 'LSB'

 #define LSB(n) ((n) & 255)

                  ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:690:13: error: 'CDC_TX_SIZE_480' undeclared here (not in a function)

         LSB(CDC_TX_SIZE_480),MSB(CDC_TX_SIZE_480),// wMaxPacketSize

             ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:64:18: note: in definition of macro 'LSB'

 #define LSB(n) ((n) & 255)

                  ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:1517:13: error: 'CDC_RX_SIZE_12' undeclared here (not in a function)

         LSB(CDC_RX_SIZE_12),MSB(CDC_RX_SIZE_12),// wMaxPacketSize

             ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:64:18: note: in definition of macro 'LSB'

 #define LSB(n) ((n) & 255)

                  ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:1524:13: error: 'CDC_TX_SIZE_12' undeclared here (not in a function)

         LSB(CDC_TX_SIZE_12),MSB(CDC_TX_SIZE_12),// wMaxPacketSize

             ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.c:64:18: note: in definition of macro 'LSB'

 #define LSB(n) ((n) & 255)

                  ^

Multiple libraries were found for "Bounce.h"
 Used: C:\Program
Error compiling for board Teensy 4.0.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 
The Catalina one is still using Teensyduino 1.49 beta 1.

Well the Arduino window says beta 1, but launches beta 2.
Don't see anything but serial for T4 USB Type.

Image 12-10-19 at 12.12 PM.jpg

Installed no other problems on Catalina. I had previously deleted beta1 and cleared all the Arduino related 'Security and Privacy' preferences to give it a good test.
 
Last edited:
Teensy Loader does say beta 2, but nothing has been changed in the cores folder like it should be.
 
MacOS 10.13.6

USB Type: "MIDI"
Works in both directions, IN/OUT.

USB Type: "Serial + MIDI"
Does not compile.
Code:
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:683:13: error: 'CDC_RX_SIZE_480' undeclared here (not in a function)
         LSB(CDC_RX_SIZE_480),MSB(CDC_RX_SIZE_480),// wMaxPacketSize
             ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:64:18: note: in definition of macro 'LSB'
 #define LSB(n) ((n) & 255)
                  ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:690:13: error: 'CDC_TX_SIZE_480' undeclared here (not in a function)
         LSB(CDC_TX_SIZE_480),MSB(CDC_TX_SIZE_480),// wMaxPacketSize
             ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:64:18: note: in definition of macro 'LSB'
 #define LSB(n) ((n) & 255)
                  ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:1517:13: error: 'CDC_RX_SIZE_12' undeclared here (not in a function)
         LSB(CDC_RX_SIZE_12),MSB(CDC_RX_SIZE_12),// wMaxPacketSize
             ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:64:18: note: in definition of macro 'LSB'
 #define LSB(n) ((n) & 255)
                  ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:1524:13: error: 'CDC_TX_SIZE_12' undeclared here (not in a function)
         LSB(CDC_TX_SIZE_12),MSB(CDC_TX_SIZE_12),// wMaxPacketSize
             ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/usb_desc.c:64:18: note: in definition of macro 'LSB'
 #define LSB(n) ((n) & 255)
                  ^
 
After installing MacOS-X 10.8 to 10.14 over the MacOS Catalina 10.15 app I can confirm the same bug with "Serial + MIDI", but after compiling with normal "MIDI" it seems to work as expected while doing a simple loopback test with seemingly no issues so far. MacOS detects it as it should along with name.c as well and after determining that all of the various midi messages go through and come back as expected I think MIDI is sorted out as long as there are no differences between the T3.6 and T4.0 send and receive functions that would make it work different since I didn't test all of them.

Here's the loopback code if anyone else wants to test it real easy.
Code:
void setup() {
}

uint32_t message;

void loop() {
  message = usb_midi_read_message();
  if(message) {
    Serial.print("   Message: ");
    Serial.println(message, HEX);
    usb_midi_write_packed(message);
  }
}
 
Follow up:
USB Type: "MIDI" seems to act like "Serial + MIDI" since Serial.print() still shows up in serial monitor.

That is by design, but it’s not Serial being that it won’t work with normal serial monitors since it’s a special HID serial emulation designed for the Teensy monitor. All previous Teensy devices have had the same emulation in the past.
 
That is by design, but it’s not Serial being that it won’t work with normal serial monitors since it’s a special HID serial emulation designed for the Teensy monitor. All previous Teensy devices have had the same emulation in the past.

I was slightly confused when the teensy didn't show up as a usb serial device and the Serial.print() still worked.
It all makes sense now. Thanks for the clarification.
 
Well the Arduino window says beta 1, but launches beta 2.
Don't see anything but serial for T4 USB Type.

Opps, I messed up the MacOS Catalina build. Fixed it just now and uploaded a fresh file.

The new Teensyduino_MacOS_Catalina.zip has shasum e72ba892097e5f849f71706d8b14d2abaea14926.

The original Teensyduino_MacOS_Catalina.zip is still on the server with file renamed. It has shasum bf8e3b3b16891131b700cf82b695fd4c8425fe06.

My build process for this Catalina download still involves many manual steps. I skipped automating it, so I could get back to work on the missing USB types. Just now I started the beginning of a script which should help, though it's still need more work to be reasonably well automated like the other builds.
 
I've seen two issues with the Catalina install (running on Mojave):
  1. When I open the search box with cmd-F the first time after a fresh open, and I start typing, the first few characters in my search always go into the editor instead of the search box. This doesn't happen with the regular Arduino 1.8.10 IDE, nor does it happen if I wait a few seconds before typing into the search box. I've seen this with both Beta #1 and Beta #2.
  2. When I try to close a window that has edited content, and I select "Don't Save", I've seen that window never close and I have to quit the app to get it to close. I haven't seen this lately, though. I've only seen this a few times with Beta #1 and not yet with Beta #2.

These issues may very well have nothing to do with Paul's build and instead have to do with OSX or the Arduino code itself. Just thought I'd report anyway. I'm running the very latest 10.14.6 with all the latest updates.
 
Catalina is so full of bugs, it should be disregarded until the issues are fixed by the costermongers.
 
I've seen two issues with the Catalina install (running on Mojave):
  1. When I open the search box with cmd-F the first time after a fresh open, and I start typing, the first few characters in my search always go into the editor instead of the search box. This doesn't happen with the regular Arduino 1.8.10 IDE, nor does it happen if I wait a few seconds before typing into the search box. I've seen this with both Beta #1 and Beta #2.
  2. When I try to close a window that has edited content, and I select "Don't Save", I've seen that window never close and I have to quit the app to get it to close. I haven't seen this lately, though. I've only seen this a few times with Beta #1 and not yet with Beta #2.

These issues may very well have nothing to do with Paul's build and instead have to do with OSX or the Arduino code itself. Just thought I'd report anyway. I'm running the very latest 10.14.6 with all the latest updates.

After running some quick tests I haven't been able to reproduce either of your issues using the latest MacOS Catalina 10.15.2 to any degree of certainty, on the first launch of the IDE when doing cmd-f the search window is a little slow to open by a couple of seconds but after the first open it does launch nearly instantly and doesn't misplace any keystrokes in the wrong window. As far as the second issue I haven't had that happen to me yet, not while using beta 1 or beta 2 so it may just be an issue of running the Catalina app on the older MacOS versions.
 
I committed a fix for this problem.

https://github.com/PaulStoffregen/cores/commit/9026659eaa8ad8df92134f93cb2b8a7af652cf49

Can't say I'm proud of having to add a 30 ns delay. I still don't understand *why* the status word is saying the transfer status is ready before it's actually ready.

Just downloaded and copied the changed files and gave the "simple.ino" keyboard sketch a try on my Windows10x64 desktop. Looks like the solved the issue with all "hell" breaks loose. Did confirm that it actually prints to what ever window you have active - so be careful :).
 
Status
Not open for further replies.
Back
Top