PDA

View Full Version : Teensyduino 1.53 Released



Paul
07-01-2020, 12:36 PM
Teensyduino 1.53 has been released.

https://www.pjrc.com/teensy/td_download.html

1.53 brings support for Arduino 1.8.13, which greatly improves stability on MacOS Catalina. NativeEthernet library was added for Teensy 4.1 ethernet. Support for C++ STL is improved. A digitalToggle(pin) function can now be used alongside digitalWrite(pin, state). Old libraries were removed. The installer now checks udev rules are up to date on Linux systems. Many minor issues were fixed.


Changes since Teensyduino 1.53-beta3:

Fix audio library on Teensy LC
Fix ST7735_t3 spitftbitmap example (KurtE)


The full list of changes since Teensyduino 1.52:

Support for Arduino 1.8.13
Reduce EventResponder and yield() overhead (KurtE)
Audio design tool checks I/O compatibility (thanks to Frank's JavaScript work)
Update audio design tool documentation
Speed up ILI9341_t3 and add setClock (Larry Bank)
USBHost_t36 add Keyboard attachRawPress & attachRawRelease (David "plugz")
Fix DmxSimple on Teensy 4.0 (Adam Demuri)
add pgmspace.h (not avr folder) compatability for Teensy 4.0
minor updates to SD and Wire examples
Improve C++ STL support
Fix compiler warnings in several library examples
Update libraries: FastLED, MIDI, RA8875, Adafruit_NeoPixel, FlexCAN, FlexCAN_T4, ILI9488_t3
Entropy library support for Teensy 4.x random number hardware
ILI9341_t3 proportional font rendering speedup (Larry Bank)
Audio: add rectifier effect and vocoder example by Bradley Sanders
Fix serialEventUSB1 & serialEventUSB2 on Teensy 4.x (KurtE)
Add MIDIUSB.h compatibility on Teensy 4.x
Check hardware serial FIFO in avalable and peek (KurtE)
Remove libraries: Adafruit_GFX, Adafruit_CC3000, Adafruit_RA8875, openGLCD, ST7565
Add SPI.end() on Teensy 4.x (KurtE)
Fix PT8211 output on Teensy 4.x
Fix USB BDT clear at startup on Teensy 3.x (Memotech-Bill)
Add digitalToggle(pin)
Fix numerical overflow in Audio CPU usage on Teensy 4.x
Remane addStorage to addMemory
Add Teensy 3.5/3.6 hardware random to Entropy (Manitou)
Fix ILI9341_r4 readcommand() & add readScanLine() on Teensy 4.x
Installer will delete old/stale libraries
Linux installer checks udev rules
Libraries updated: ADC, ILI9488_t3, RA8875
Fix audio library on Teensy LC
Fix ST7735_t3 spitftbitmap example (KurtE)

analog&RFmodels
07-01-2020, 08:30 PM
tested teensyduino with arduino 1.8.13 this am - all ok w compile/run/serial monitor using codes
containing adc functions for tlc, t36, t4. install 153 on top of 153b3, win7pro64

do not know whether it is new arduino or teensyduino 1.53 (i noticed this with 153b3 also) but
having the serial monitor connect successfully w any given teensy on the first try seems to be
much more reliable than with 1.52 and 1.48 and 1.41

defragster
07-01-2020, 09:06 PM
Win 10 install over 1.53b3 on IDE 1.8.13 went well

mstiller
07-02-2020, 07:20 PM
Platformio update went seamless.

To me it looks like the code is now running faster as 1.52.

Silverlock
07-02-2020, 07:42 PM
No issues so far with ARM 32 on Raspbian Stretch, installed over 1.53b3.

KurtE
07-10-2020, 06:58 PM
I thought I would mention, I have done a diversion today, and
With a new RPI4 with 8GB memory,

I downloaded the released Raspberry PI OS (32 bits) and installed, then updated the firmware to allow to boot from SSD, then cloned the SDCard to SSD and now booting off of it.
I then instelled Arduino 1.8.13 plus this released Teensyduino.

I had already had installed the udev rules, but was nice that it checked this for me. I then built the spitftbitmap for st7735_t3/89 and build and ran on LC. Verified that it ran and had the color problems mentioned. I then cloned down my github fork and switched to my branch with PR in it and slected the right display card and it shows with the right colors.

Note: the currently one will not compile on a blank system like this as it includes the Adafruit_GFX.h file. My updated version does not require it as we don't use it in this sketch.

But so far everything is working fine :D

But now back to my normal diversions.

xxxajk
07-26-2020, 09:00 PM
@Paul Request for small change.

Any chance to make _reboot_Teensyduino_() a weak definition so that code can do graceful shutdown of external devices before jumping to the bootloader?

Currently I just add
__attribute__((weak)) manually so I can override it with shutdown code such as the following...


void _reboot_Teensyduino_(void) {
turn_off_motors();
turn_off_heaters();
turn_off_air();
engage_safety_interlock();
__asm__ volatile("bkpt");
__builtin_unreachable();
}


This would be just convenient, and others may find it useful, for use in CNC/3D printers, etc.
Hope you will consider it. Than ks fo all your awesome work.

defragster
07-27-2020, 12:01 AM
@Paul Request for small change.

Any chance to make _reboot_Teensyduino_() a weak definition so that code can do graceful shutdown of external devices before jumping to the bootloader?
...

Something like that seems a good idea.

Perhaps add a call to a shutdown_hook() similar to :

void startup_late_hook(void) __attribute__ ((weak, alias("startup_default_late_hook")));

xxxajk
07-27-2020, 12:49 AM
No, the idea is to catch the firmware upload, and shutdown external devices when we _know_ we are going to reboot, which is different than not knowing.
The startup hook isn't going to work, that's too late, and would be no different than using setup.
The extrenal devices are on SPI, serial, and all sorts of different interfaces that don't get regular communications, thus making a watchdog unusable as well.
The only time everything "knows" nothing else is running is when the power switch is off.

KurtE
07-27-2020, 01:30 AM
I think @defragster was suggesting maybe add a new hook like the startup_late_hook,
something like maybe reboot_teensy_hook that would also be weak and probably called by _reboot_teensyduino_

defragster
07-27-2020, 01:49 AM
I think @defragster was suggesting maybe add a new hook like the startup_late_hook,
something like maybe reboot_teensy_hook that would also be weak and probably called by _reboot_teensyduino_

Yes - understood as KurtE notes - exactly that - except early/late didn't seem helpful as it would be a single weak call like :: shutdown_hook()

shutdown_default_hook() would be called - by default to no effect in _reboot_Teensyduino() before the reboot would happen.

When a user had overriding code for shutdown_hook() - it would have a chance to perform a 'clean shutdown'

Note sure if it might apply to both :


void _reboot_Teensyduino_(void) __attribute__((noreturn));
void _restart_Teensyduino_(void) __attribute__((noreturn));

Actually the reboot seems delayed by usb_reboot_timer - so maybe an _early hook there and a _late hook in the _reboot_Teensyduino - but that would be more involved - unless it was to be allowed to IGNORE the reboot request in _early by not setting the timer.

xxxajk
07-27-2020, 03:08 AM
Just adding weak attribute adds zero code though, if unused, and it is a one-liner.
Not worried on the reboot case, that's OK. It's the case of where new firmware upload could be faulty...
I'm also thinking another use case as well, like UHS-3, where if you have open files on a USB storage device, and writing is going on, that you could close the file gracefully... e.g. logfile. Would be useful as well with SDcard too.
I can think of dozens of reasons to do this.

Etienne
08-19-2020, 05:12 PM
Hi,
I already found that in Teensyduino 1.52, but it's still here :
In teensy4 core, file usb_rawhid.c, line 139, SEREMU_TX_SIZE should rather be RAWHID_TX_SIZE ...

KurtE
08-19-2020, 06:16 PM
Hi,
I already found that in Teensyduino 1.52, but it's still here :
In teensy4 core, file usb_rawhid.c, line 139, SEREMU_TX_SIZE should rather be RAWHID_TX_SIZE ...

I put in the change and issued PR: https://github.com/PaulStoffregen/cores/pull/486
Of course there may be already one pending... but

Etienne
08-19-2020, 06:26 PM
Thanks, next time i'll do a PR. I don't think there's already one pending.

PaulStoffregen
08-19-2020, 06:40 PM
Thanks for the pull request. I saw this and had made a bookmark to look at it later....

vjmuzik
08-31-2020, 08:43 AM
Not sure if this should be noted yet, but this does currently work in MacOS 11.0 Big Sur.

daj59
10-01-2020, 12:33 PM
has anyone got this working and running on mac os big sur?

PaulStoffregen
10-01-2020, 12:50 PM
I'm not planning to do any testing on MacOS 11 (Big Sur) until Apple officially releases it.

daj59
10-01-2020, 01:14 PM
I'm not planning to do any testing on MacOS 11 (Big Sur) until Apple officially releases it.

excellent, good reason not to upgrade to the tests yet!
Thanks

vjmuzik
10-01-2020, 03:25 PM
has anyone got this working and running on mac os big sur?

Not sure if this should be noted yet, but this does currently work in MacOS 11.0 Big Sur.

Iíve already been using it on Big Sur so I can confirm it does already work.

AndyCap
10-02-2020, 04:49 PM
Hi Guys,

Is there a fix somewhere for the Aduino Gui running really slow on OSX?

For instance 10 seconds of spinning beach ball when I click on a menu.

Cheers

Andy

vjmuzik
10-02-2020, 09:31 PM
There’s not really a fix for it from what I can tell it’s based on your disk performance, now that I’m running from an NVME instead of a SATA SSD the freezing seems to be less noticeable or that could just be because I’m running a better laptop now overall.

AndyCap
10-02-2020, 10:08 PM
Thanks for the reply, I have a 12 core, 32gb Ram, NVME drive. It’s a pretty fast machine.

Arduino without the teensy software installed runs fine, with the teensy software installed I get very slow menu handling, the more windows open the slower it gets.

Everything else on this machine runs super fast.

defragster
10-02-2020, 10:43 PM
@AndyCap - sounds like the latest integrated TeensyDuino w/IDE installer code not in use? Single mac download has IDE 1.8.13 and TD 1.53 bundled together.

Not sure if that might fix the IDE itself - or allow the computer to better trust the Teensy software with secure install?

AndyCap
10-03-2020, 07:49 AM
Hi @defragster,

Thanks for the reply.

I had actually started using the all in one to update from a previous beta of 1.53 that was installed in arduino and also had the problem.

So I thought I would delete the original arduino app and re-install so I could make some timings of the issue compared to the default.

So with 6 file editors:

Starting Arduino is still pretty slow and takes around 10 seconds, starting teensyduino takes around 19 seconds.

File menu popping down in arduino is 0.5 seconds, file menu in teensyduino takes 8.5 seconds.

Sketch menu popping down in arduino is instant, teensyduino around 0.5 seconds.

Other menus are fine in both.

In both arduino and teensyduino once the file menu has had this slow behaviour as long as you stay on the same editor window it then works quickly, change to another editor window and it is slow the next time.

So I'm guessing it is something to do with the number of examples rather than the teensy stuff, I bet if I had another board with the same number of examples I would see a similar thing.


Edit:

So I ran the Instruments profiler on it to see what is going on, maybe doesn't look like a disk issue.

7.66 s 100.0% 1.00 ms Java_sun_lwawt_macosx_LWCToolkit_doAWTRunLoopImpl

So some Java toolkits run loop, with majority of time here:

5.07 s 66.2% 129.00 ms CFSetContainsValue

So it looks like it is some dodgy code looking stuff up in a set.

I also ran a filesystem profile and there is no disk access at all in this period.

So looking like an Arduino problem based on number of examples and some dodgy code!

xxxajk
10-03-2020, 08:16 AM
Sounds to me like you need to tell the jvm to use more memory so that it gc's less often?
The
-verbose:gc option should be helpful.
On my system, 16GB RAM, 16 cpu's, Linux 64bit:

IBM's java:

/usr/lib/jvm/java-ibm-x86_64-80/jre/bin/java -XshowSettings:vm -version 2>&1 | head --lines=6
Here's the output:

VM settings:
Max. Heap Size (Estimated): 512.00M
Ergonomics Machine Class: client
Using VM: IBM J9 VM

java version "1.8.0_241"


and for openjdk/jre:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java -XshowSettings:vm -version 2>&1 | head --lines=6
Here's the output:

VM settings:
Max. Heap Size (Estimated): 3.90G
Using VM: OpenJDK 64-Bit Server VM

openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)


So it *might* even matter which jvm you are using.

AndyCap
10-03-2020, 08:30 AM
Thanks for all the info, from the command line:



$ java -XshowSettings:vm -version 2>&1
VM settings:
Max. Heap Size (Estimated): 7.11G
Ergonomics Machine Class: server
Using VM: Java HotSpot(TM) 64-Bit Server VM


Does Arduino use its own version of Java or the one on the OS path?

xxxajk
10-03-2020, 08:34 AM
Probably the one in the OS path, even so, you can increase the initial allocation at startup.
type

java -X
to see the memory options.
it's usually -Xms

-Xms<size> set initial Java heap size

AndyCap
10-03-2020, 09:02 AM
Thanks for the info.

I looked into it a bit and the JRE that arduino uses is included with it.

So I looked at the files opened when running teensyarduino and noticed that it was also using the internet java plugin on my machine, a bit of both!

So I deleted the internet java plugin and now it works perfectly!

Thanks very much for pointing me at Java being the villain in some way.

xxxajk
10-03-2020, 09:03 AM
No problem :-)

PaulStoffregen
10-03-2020, 09:27 AM
So I deleted the internet java plugin and now it works perfectly!

This is the first time I've heard of this problem, though I'll admit it may have come up before and been unresolved as just mysterious Mac or Java issues.

Can you give me any more specific info about this extra java plugin your machine had? Any info we might be able to share with others who see this same issue in the future would really help.

AndyCap
10-03-2020, 09:35 AM
The plugin was JavaAppletPlugin.plugin and located in /Library/Internet Plug-ins/

When I looked at the files arduino was using it was using this as well as the embedded JRE.

The tools needed to check the files used are standard so users can check by running "Activity Monitor" and double clicking "Arduino".

Then in the next window choose "Open files and ports", command f to search and then type in JavaAppletPlugin.plugin

mjs513
10-13-2020, 01:22 PM
Good Morning all
Running into a something while trying to get a sketch to load to a brand new toy I got recently and something out of my normal wheel house. So here goes.

I picked up a PI4 with 8GB of mem, and installed Ubuntu 18.04 64bit as the OS. I finally managed to get linuxarm64 installed for the Arduino 1.8.13. Then i installed Teensyduino 1.53 Linux Installer (AARCH64 / Jetson TX2) which may be the problem.

What happens is the simple Blink sketch compiles with no issues and when the sketch goes to upload I get the error:

Opening Teensy Loader...
Teensy Loader could not find the directory /tmp/arduino_build_489937
quitexit status 1 and the TD screen is blank = all white.

If i look in /tmp I do see the build directory:

arduino_build_489937
arduino_cache_274431
and files

-rw-rw-r-- 1 ubuntu ubuntu 34 Oct 13 08:08 Blink.pde.eep
-rwxrwxr-x 1 ubuntu ubuntu 388532 Oct 13 08:08 Blink.pde.elf
-rw-rw-r-- 1 ubuntu ubuntu 40257 Oct 13 08:08 Blink.pde.hex
-rw-rw-r-- 1 ubuntu ubuntu 385490 Oct 13 08:08 Blink.pde.lst
-rw-rw-r-- 1 ubuntu ubuntu 11056 Oct 13 08:08 Blink.pde.sym
-rw-r--r-- 1 ubuntu ubuntu 566 Oct 13 08:07 build.options.json
drwxr-xr-x 2 ubuntu ubuntu 4096 Oct 13 08:08 core
-rw-r--r-- 1 ubuntu ubuntu 249 Oct 13 08:07 includes.cache
drwxr-xr-x 2 ubuntu ubuntu 4096 Oct 13 08:07 libraries
drwxrwxr-x 2 ubuntu ubuntu 4096 Oct 13 08:07 pch
drwxr-xr-x 2 ubuntu ubuntu 4096 Oct 13 08:07 preproc
drwxr-xr-x 2 ubuntu ubuntu 4096 Oct 13 08:07 sketch


Or is this just a matter that the TD version I used is only for the jetson?

xxxajk
10-14-2020, 11:08 PM
/tmp directory have proper permissions?

mjs513
10-15-2020, 12:07 AM
/tmp directory have proper permissions?

Just checked and /tmp has

drwxrwxrwt 15 root root 4096 Oct 14 19:05 tmp

If I compile Blink for the Uno I don;t get the error?

KurtE
10-15-2020, 12:46 AM
I just installed 1.8.12 on RPI4-8GB on SSD with current Teensyduino... Did not find the 1.8.13 64 bit linux. Running Ubuntu 20.04.

I get the error

Opening Teensy Loader...
Teensy Loader could not find the directory /tmp/arduino_build_445002
quitexit status 1
Error compiling for board Teensy 3.2 / 3.1.

Next up turn on verbose.

mjs513
10-15-2020, 12:53 AM
@KurtE - I am using 1.8.13 aarch64 version - arduino-1.8.13-linuxaarch64

If i turn on verbose mode I didn't notice anything strange, looks like it compiled without error. Also as I mentioned when TeensyLoader opened it was a blank window.

KurtE
10-15-2020, 01:02 AM
The Arduino site kept failing to find that file, I even tried on my windows machine and it failed, so went to 1.8.12.

I also found a blank window like you mentioned.

BUT if I kill off the window

And run the Teensy program manual from a terminal window, I see:

buntu@ubuntu:~/Desktop/arduino-1.8.12/hardware/tools$ ./teensy
Gtk-Message: 23:59:00.682: Failed to load module "canberra-gtk-module"


It hange waiting ... If I then press the program button on T3.2, it will take a bit of time, but it will program the teensy.

So I think the error message is bogus. It is having issues internal to Teensy app.

Probably Paul needs to look

mjs513
10-15-2020, 01:12 AM
I didn't try running it manualy but I did try and just press the button on the T4,1 just in case but didn't load - probably got impatient and didn't wait long enough.

Agree - Paul probably needs to take a look unless there is a way maybe to recompile the just the loader for the PI4 64bit OS?

billybone
10-19-2020, 10:40 PM
Thanks for info

piderka
10-29-2020, 07:01 AM
I am completely new to Teensy. For my current project, I had to graduate from Arduino and get something more powerful. I noticed that the library Adafruit_GFX was removed in the newest update. I need some library to use my 5110 now. Any suggestions for a library for a 5110 LCD, a NEO 6M GPS unit and a HC-05/HC-06 Bluetooth module?

defragster
10-29-2020, 07:15 AM
Typically libraries removed are done when they are equivalent and more current from the source - and perhaps had Teensy compatibility added. In this case using the published Adafruit library should work with Teensy AFAIK.

Those other things may have related forum post a search might turn up ...

PaulStoffregen
10-29-2020, 09:04 AM
You can use Adafruit_GFX.

In Arduino, click Tools > Manage Libraries and type "GFX" in the search. Most libraries are found and installed that way.

Many years ago, in the early days of 32 bit Teensy, all of Adafruit's display libraries ran very slowly. Back then Adafruit only sold 8 bit boards. As we found ways to make those displays and their libraries run much faster on Teensy, lots of modified copies were made and the code diverged from Adafruit's original code. That's all ancient history now. Adafruit's libraries are now much better, and of course they sell plenty of 32 bit products, and their libraries now work well on pretty much all 32 bit boards including Teensy.

As Adafruit improved their libraries, the copies we had for Teensy would become out of date. Sometimes those differences would cause minor but really annoying compatibility issues (and who want's to dig through a mountain of library code?) Keeping separate modified copies of Adafruit's libraries just didn't make sense anymore, since Adafruit's modern libraries work on Teensy with pretty good performance.

We do still have several libraries like ILI9341_t3 which are highly optimized for Teensy, but they don't require Adafruit_GFX to run.

So starting with version 1.53, we're no longer packaging a copy of Adafruit_GFX and some of Adafruit's other libraries. The ones you can install from Arduino's library manager work well, and that way you can avoid compatibility issues and always get the latest version as Adafruit updates them.

billybone
10-30-2020, 12:22 PM
Thanks for update

r3stl355
11-14-2020, 04:20 PM
What is the shasum of current Teensyduino_MacOS_Catalina.zip (version 1.53)? Is it listed anywhere? Thanks

PaulStoffregen
11-14-2020, 05:05 PM
What is the shasum of current Teensyduino_MacOS_Catalina.zip (version 1.53)? Is it listed anywhere?

No, hashes aren't listed anywhere, but here are the numbers.

shasum Teensyduino_MacOS_Catalina.zip
34a0fe608bf96084618b4c8553c9703377a13a6e Teensyduino_MacOS_Catalina.zip

sha256sum Teensyduino_MacOS_Catalina.zip
401ef42c6e83e621cdda20191a4ef9b7db8a214bede5a94a9e 26b45f79c64fe2 Teensyduino_MacOS_Catalina.zip

The software is digitally signed with a valid developer certificate. You can verify the signature on a Mac using this command.

codesign -vvvv --deep --strict Teensyduino.app/

The signed software is also properly notarized from Apple. You can check the notarization with this command:

spctl --assess -vvv Teensyduino.app/

At least those are the commands which work on Mojave. I haven't tested those on Catalina or Big Sur.


Anyone who could alter the zip file between PJRC and you could probably also alter the SHA hash numbers you download the same way you download the ZIP file. But altering the software and managing to fake the digital signature and Apple notarization would require a feat of breaking strong encryption!

r3stl355
11-14-2020, 05:21 PM
Perfect, exactly what I wanted and more, thanks Paul

neroroxxx
11-15-2020, 05:44 AM
I just installed macOS Big Sur on my MacBook and Teensyduino 1.53 works fine, just wanted to report it

xoxu
11-15-2020, 10:16 PM
Hi,
I am trying to compile the NativeEthernet / UDPSendReceiveString example from teensyduino for a teensy 4.1 and I get a strange error:

Error while detecting libraries included by C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FNET\s rc\service\serial\fnet_serial.c

The code that I am developing have the same problem
Doesn't do it on the example through normal ethernet library.
any idea

tonton81
11-16-2020, 12:48 AM
Just adding weak attribute adds zero code though, if unused, and it is a one-liner.
Not worried on the reboot case, that's OK. It's the case of where new firmware upload could be faulty...
I'm also thinking another use case as well, like UHS-3, where if you have open files on a USB storage device, and writing is going on, that you could close the file gracefully... e.g. logfile. Would be useful as well with SDcard too.
I can think of dozens of reasons to do this.

instead of overriding the function (and without looking at the core to duplicate the other code you will use in your new one), i think its better to have a separate blank weak function that is added to it at the top of the current function, so when the core runs thru it it runs your code before the core ones, then you wouldnt need to keep track of the core code in your function when you have a blank one to play with