Teensyduino 1.57 Released

Thank you.

I can find no link to that page when starting from

https://www.pjrc.com/store/teensy41.html

which links to:

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

which also has no link to that page.

Not finding any mention of IDE 2.0 on PJRC.com either - except HOME shows the BLOG post info: www.pjrc.com/

Wow this is OLD - "How Does Teensy 2.0 Compare With Arduino?" - it is Left pane 'Main":
pjrc.com/teensy/teensyduino.html

This page is great for IDE 1.8.x and Teensy Duino 1.57: Left Edge pane 'Download+Install'"
pjrc.com/teensy/td_download.html

The Board info pages show this - link only to TeensyDuino Installer:
Code:
Software
Arduino IDE + Teensyduino
Arduino's IDE software with the Teensyduino add-on is the primary programming environment for Teensy. On Windows, Linux and old Macs, Arduino is installed first and then the Teensyduino installer adds Teensy support to the Arduino IDE.
 
I get the same error with the released MacOS Ventura. i.e. "Unable find Teensy Loader. (p) Is the Teensy Loader application running?"


Just to confirm, I was able to reproduce this problem on MacOS Ventura.

sc.jpg
 
I've spent several hours on the MacOS Ventura issue, and I'm sad to say I'm completely stuck.

Inside teensy_post_compile, when Teensy Loader needs to run, it uses /usr/bin/open with the full path to Teensy Loader inside Teensyduino.app/Contents/Java/hardware/tools folder. The full path is a long path with sandbox prefix. I don't understand why it wouldn't run the application in the same sandbox.

But I did find this article about recently published sandbox escape using /usr/bin/open.

https://perception-point.io/blog/research/technical-analysis-of-cve-2021-30864/

According to the article, Monterey 12.0.1 supposedly fixed this problem. But perhaps with Ventura 13.0.0 Apple decided to just not allow /usr/bin/open to work at all from within a sandbox?

Not sure how to make this work. But teensy_post_compile is able to open Teensy Loader when run by Arduino 2.0.2, so there must be some way. This stuff is really stretching my MacOS knowledge. If anyone knows more about how this is supposed to work on MacOS, please comment. For one, I'm really stumped on this issue....
 
Or maybe it can work on Ventura?! Just as I was giving up, seems I stumbled on the problem with /usr/bin/open somehow depending on stdin (without any input).

ventura.jpg

Here is a copy of teensy_post_compile. If anyone using MacOS Ventura is still watching, control-click Teensyduino and "Show Package Contents". Then navigate to Contents/Java/hardware/tools. Replace the teensy_post_compile utility in that folder with this copy.

Does it work on your machine? (also keep in mind this breaks the app's digital signature, so eventually MacOS may notice and tell you the app is damaged or might harm your computer) Main question is whether this works on other MacOS Ventura machines? I have only 1 Mac new enough to run Ventura.
 

Attachments

  • teensy_post_compile.zip
    8.9 KB · Views: 69
@PaulStoffregen
#56 worked for me (so far :) on MacBookAir M2, Ventura 13.0.1 (22A400) on T3.2

Wow this fixed a seemingly unrelated problem with a simple loop printing I was having. I'll post in a minute.
 
Last edited:
The simple program below before the zip (or with 2.0.2)would not delay for 9 seconds when no monitor and skips random lines
Output b4
Code:
2
4
7
9
10

Code:
#define MYVERSION_STUFF "blink&blank, 2022/11/27   "

int led = 13;
int gcount=0;

void setup() {
  pinMode(led, OUTPUT);
  Serial.begin(9600);
  while(!Serial && millis()<9000)
    ;
  Serial.println(MYVERSION_STUFF);
}

void loop() {
  digitalWrite(led, HIGH);   
  gcount+=1;
  Serial.println(gcount);
  delay(500);               
  digitalWrite(led, LOW);   
  delay(500);               
}

Output:
Code:
2
3
4
5
..

Now it delays, but still skips the MYVERSION_STUFF and the 1, when I press the button on the teensy to reload and run.

Arduino 2.0.2 occasionally gets it correct when rerun.
Code:
blink&blank, 2022/11/27   
1
2
3
4
5
6
 
Last edited:
I put back the old 'teensy_post_compile' and can't reproduce the issue I was having in message #58 above. So best to ignore all in #58.

The Teensy Loader not loading in 1.8.19 issue did return so it seems to address that.
 
Thanks for testing. MacOS can be a challenge sometimes, really helps to get test results like this. :)

@bicycleguy - if the missing input lines problem returns, please open Terminal and type "ps aux | grep teensy". Is more than 1 instance of teensy_serialmon or teensy-monitor running?
 
Thanks for testing. MacOS can be a challenge sometimes, really helps to get test results like this. :)

@bicycleguy - if the missing input lines problem returns, please open Terminal and type "ps aux | grep teensy". Is more than 1 instance of teensy_serialmon or teensy-monitor running?

The output from sketch in #58 pretty much always starts with 2 when using Teensy Ports.

ps aux | grep teensy output:
Code:
~     4964   0.3  1.1 35674492  90628   ??  S    10:13AM   0:01.06 /Applications/Teensyduino1-8-19t1-57.app/Contents/Java/hardware/teensy/../tools/teensy.app/Contents/MacOS/teensy
~     4993   0.0  0.0 408636096   1456 s000  S+   10:14AM   0:00.01 grep teensy
~     4991   0.0  0.0 34430552   4044   ??  S    10:14AM   0:00.02 /Applications/Teensyduino1-8-19t1-57.app/Contents/Java/hardware/tools/teensy_serialmon usb:100000
~     4605   0.0  0.1 34458052   4196   ??  S    10:12AM   0:00.04 /Applications/Teensyduino1-8-19t1-57.app/Contents/Java/hardware/teensy/../tools/teensy_ports -J2
note renamed app in finder to include versions: Teensyduino1-8-19t1-57

The output is usually correct when when using Serial ports. The ps:
Code:
~     5024   0.9  0.0 408636096   1456 s000  S+   10:35AM   0:00.00 grep teensy
~     4964   0.1  1.2 35675580  97484   ??  S    10:13AM   0:06.11 /Applications/Teensyduino1-8-19t1-57.app/Contents/Java/hardware/teensy/../tools/teensy.app/Contents/MacOS/teensy
~     4605   0.0  0.1 34466244   4236   ??  S    10:12AM   0:00.07 /Applications/Teensyduino1-8-19t1-57.app/Contents/Java/hardware/teensy/../tools/teensy_ports -J2

Interestingly sometimes when using the Arduino Serial ports the 2 missing lines show and then the window clears and starts at 2 like with Teensy Ports.
 
I have IDE 1.8.19 and 2.02 installed at the same time. "Teensy 4 Security" appears on the tool tab for the 1.8.19 but not 2.02. It his and issue?

Thanks

Bruce
 
Thanks for the heads up.

I guess I will stick with 1.8.19 right now.

Personally, I prefer using IDE2.... For those rare cases where you need to setup some of the T4.x security stuff, you can always startup the 1.8.19... But for most other things I prefer IDE2.
(Other than Serial monitor) But for any serial stuff, I typically use TyCommander for that anyway in either case.
 
Just updated to 1.57 and get this error with a Teensy LC:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ADC\AnalogBufferDMA.cpp: In member function 'void AnalogBufferDMA::init(ADC*, int8_t)':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ADC\AnalogBufferDMA.cpp:175:26: error: call to 'ADC::enableDMA' declared with attribute error: Use adc->adcX->enableDMA instead
adc->enableDMA(adc_num);
^
Error compiling for board Teensy LC.
The program couldn't be simpler:
Code:
#include <ADC.h>
void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Changing the offending line to
Code:
  adc->adc[adc_num]->enableDMA();
compiles without errors.

Don't know if the DMA works and I'm not planning to use it.

Hope this helps,

Chris
 
Just updated to 1.57 and get this error with a Teensy LC:


The program couldn't be simpler:
Code:
#include <ADC.h>
void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Changing the offending line to
Code:
  adc->adc[adc_num]->enableDMA();
compiles without errors.

Don't know if the DMA works and I'm not planning to use it.

Hope this helps,

Chris
That was fixed in the ADC library after the release of 1.57:
https://github.com/pedvide/ADC/pull/81
The fix was merged in on November 11th
 
I'm having got some troubles to get a correct behaviour after building a program.

I'm using that release to build a program with a Z80 core emulation.

It worked fine the first times I installed a version which was only working with Arduino IDE 1.8.x (Windows 10) then I tried your 1.58 beta (for a more recent compiler) but I got very weird behaviours which led me to get back to a previous version, namely 1.57.

600 MHz, "faster".

Now if I build by commenting z80_run() (the Z80 core running in loop()), I have that output:

Code:
MZ-80 K virtual Z80 by Christophe Avoinne
Frequency: 600000000 Hz
[SETUP]
[BUS] Setup... done.
[Z80] Setup... done.
[KBD] Setup... done.
[SYS] Setup... done.
SD initialization

while the code setup() is:
Code:
#include <SdFat.h>

SdFs SD;
FsFile dir;
FsFile entry[10];
String lfn[10];

#include <stdint.h>
#include <stdio.h>

#include "MZ-80K-CPU.bus.h"
#include "MZ-80K-CPU.z80.original.h"
#include "MZ-80K-CPU.sys.h"
#include "MZ-80K-CPU.kbd.h"
#include "MZ-80K-CPU.ipl.h"

...

// Setup Teensy 4.1 IO's
void setup()
{
	Serial.begin(115200);

	Serial.println("MZ-80 K virtual Z80 by Christophe Avoinne");
	Serial.printf("Frequency: %d Hz\n", F_CPU_ACTUAL);
	Serial.println("[SETUP]");

	bus_setup();

	delay(1000);

	z80_setup();
	kbd_setup();
	sys_setup();

	Serial.print("SD initialization ");
	Serial.println((SD.begin(SdioConfig(FIFO_SDIO))) ? "done." : "failed!"); // BUILTIN_SDCARD doesn't work - error: 'BUILTIN_SDCARD' was not declared in this scope


	//Serial.println("SD contents:");
	//SD.ls(LS_R);

	Serial.println("---");
}

"initialization" should be followed with either "done." or "failed!" but I have nothing then.

If I uncomment z80_run() in:
Code:
// Main loop
void loop()
{
	Serial.println("[LOOP]");

	//z80_loop();

	while (1) yield();
}

I may have no output at all.

If I insert delay(1000), in the setup(), I have no Serial USB traces after the call.

It totally drives me crazy!
 
Last edited:
If I uncomment z80_run() in:
Code:
// Main loop
void loop()
{
	Serial.println("[LOOP]");

	//z80_loop();

	while (1) yield();
}

I may have no output at all.

If I insert delay(1000), in the setup(), I have no Serial USB traces after the call.

It totally drives me crazy!

Note: you will never exit the line: while (1) yield();
 
So whatever I installed as release version, I got the same "weird" behavior so it has nothing to do with that version. It looks like Serial.printf/print[ln] are not blocking functions (I thought they were) because if I replace a delay(1000) by delay(10000), I get more USB traces. So I suspect there are probably some conditions that might make the USB Serial unable to proceed (using "noInterrupt();"?) while getting past that delay. So let us say my post is off-topic.
 
Back
Top