PDA

View Full Version : Teensyduino 1.52 Beta #2



Paul
04-06-2020, 03:16 PM
Here is a second beta test for Teensyduino 1.52.


Edit: links removed, please use 1.52-beta5 (https://forum.pjrc.com/threads/60864-Teensyduino-1-52-Beta-5).


Changes since Teensyduino 1.52-beta1 (https://forum.pjrc.com/threads/59996-Teensyduino-1-52-Beta-1):

Fix USB RawHID on Teensy 4.0 (KurtE)
Fix USB audio+midi+serial descriptor on Teensy 4.0 (widdly)
Add ADK to USBHost_t36 (Matt Bergman)
Fix USB Host MIDI transmit race condition (essej)
Optimize USB interrupt on Teensy 4.0 (Frank B)
Arduino compatibility of digitalWrite control pullups (FrankB)
Add missing MPU traps on Teensy 4.0 (FrankB)
Fix SGTL5000 clock ratio setting (FrankB)
Fix I2S slave on Teensy 4.0 (widdly)
Add DMAMEM & fix warnings in I2S on Teensy 4.0 (FrankB)
Improve SPI use by SD on Teensy LC (rutmarti)
Support alternate SPI pins on Teensy 4.1 (KurtE)
Support alternate Teensy 4.1 CS pins on ILI9341_t3 (KurtE)
Fix Teensy Loader on MacOS 10.13 with Catalina version
Fix teensy_serialmon 100% CPU on Linux if Arduino process killed
Workaround for rare Windows Defender flase positive when installing Java classes

Frank B
04-06-2020, 09:48 PM
Please remove the output_pwm for T4 - this needs some work and leads to a compilation error.

Stendall
04-07-2020, 06:43 PM
Hi Paul.
I'm sorry to bother you but I think the mic input have lost it's functionality in 1.52 Beta #2.
hardware Teensy 4 + Teensy Audio adapter Rev D

I have it tested with a simple script using a clean Arduino 1.8.12 + Teensyduino 1.52 Beta #1 install vs Arduino 1.8.12 + Teensyduino 1.52 Beta #2.
With Beta #2 there is no input signal from mic and some times there is clock & data lines noise mixed with the audio.



#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

AudioInputI2S mic1; //xy=454,353
AudioOutputUSB usboutput1; //xy=727,411
AudioOutputI2S spk1; //xy=738,357
AudioConnection patchCord1(mic1, 0, spk1, 0);
AudioConnection patchCord2(mic1, 0, spk1, 1);
AudioConnection patchCord3(mic1, 0, usboutput1, 0);
AudioConnection patchCord4(mic1, 0, usboutput1, 1);
AudioControlSGTL5000 audioShield; //xy=669,235

void setup() {
AudioMemory(16);
audioShield.enable();
audioShield.volume(0.6f);
audioShield.inputSelect(AUDIO_INPUT_MIC);
audioShield.micGain(33);
}

void loop() {
}


I have connected a ILI9341 on alternate SPI pins and the full setup (sort of usb audio card image below) was working flawlessly since the first commit with usb audio suport you make to the cores git till this Beta #2
19603

Thanks for all your magnificent work.

Frank B
04-07-2020, 06:59 PM
Yes, please overwrite input_i2s.cpp from the audio library with this version: https://raw.githubusercontent.com/PaulStoffregen/Audio/master/input_i2s.cpp

Stendall
04-07-2020, 07:09 PM
Yes, please overwrite input_i2s.cpp from the audio library with this version: https://raw.githubusercontent.com/PaulStoffregen/Audio/master/input_i2s.cpp
Working.
Huge thanks Frank. Extendable to each and every contributor that makes Teensy great.

Thank you all.

defragster
04-08-2020, 08:05 AM
TeensyDuino 1.52b2 installed fine here on Windows on 4/6. A couple of uploads to T_4's went well.

tobzoska
04-08-2020, 08:45 AM
Hi!

I'm still getting clicks and discontinuities with the USB Audio In/Out after around 20 seconds or so. Same results on both macOS 10.12 and iOS 12.

I wonder if anybody has similar problems and/or suggestions on how to fix it? Looks like it's sending a bunch of zeros:

19617

I'd post the source code, but it's more or less copied straight from the Audio Design Tool. InputI2S -> OutputUSB and vice versa. Audio passthrough via I2S works without any issues.

Frank B
04-08-2020, 09:15 AM
I'm still getting clicks and discontinuities with the USB Audio In/Out after around 20 seconds or so.

Teensy 3 or Teensy 4?

defragster
04-08-2020, 09:15 AM
Hi!

I'm still getting clicks and discontinuities with the USB Audio In/Out after around 20 seconds or so. Same results on both macOS 10.12 and iOS 12.
...
I'd post the source code, but it's more or less copied straight from the Audio Design Tool. InputI2S -> OutputUSB and vice versa. Audio passthrough via I2S works without any issues.

Prior post in Beta 1 - had a detail or two : Teensyduino-1-52-Beta-1 (https://forum.pjrc.com/threads/59996-Teensyduino-1-52-Beta-1?p=234470&viewfull=1#post234470)

Note: "more or less copied" - is not a sketch for repro Paul could open - connect - run - and see the problem. Feel free to post exact code - with needed hardware connects parts ( Teensy x.x? and Audio board rev 'letter' ) and connects - that would Copy&Paste to the IDE and demo the issue.

tobzoska
04-08-2020, 10:45 AM
Teensy 3 or Teensy 4?

Oh, sorry! It's a Teensy 4.0 I'm using.


Prior post in Beta 1 - had a detail or two : Teensyduino-1-52-Beta-1 (https://forum.pjrc.com/threads/59996-Teensyduino-1-52-Beta-1?p=234470&viewfull=1#post234470)

Note: "more or less copied" - is not a sketch for repro Paul could open - connect - run - and see the problem. Feel free to post exact code - with needed hardware connects parts ( Teensy x.x? and Audio board rev 'letter' ) and connects - that would Copy&Paste to the IDE and demo the issue.

Unfortunately I don't have an Audio Board here. I'm using a custom board with a CS4272 and edited AudioControlCS4272.h to configure the codec as Slave. However, I didn't think that this could cause the problem, since the I2S In/Out itself works without any issues. Sorry for the confusion!

Anyway, the problem also appears when routing AudioSynthWaveformSine to the USB output and monitoring through the built-in speakers of my mac, like this for example:



#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthWaveformSine sine1; //xy=151,269
AudioOutputUSB usb2; //xy=382,258
AudioOutputI2S i2s1; //xy=410,142
AudioConnection patchCord1(sine1, 0, usb2, 0);
AudioConnection patchCord2(sine1, 0, usb2, 1);
// GUItool: end automatically generated code

void setup() {
AudioMemory(20);
sine1.frequency(440);
sine1.amplitude(0.8);
}

void loop() {
while(1);
}

Frank B
04-08-2020, 11:09 AM
It's a Teensy 4.0 I'm using.
Hm, the Teensy 4 uses exactly 44100Hz Samplerate, so the problem is different from the Teensy 3.x USB-Audio problems.
Seems to be related to USB-internals.. I can't help with that :(

Deleted User
04-10-2020, 06:18 PM
Ciao. Now I've tried Teensyduino 1.52beta2 with the followng test code:

#define MUTEPIN 6
#define PDNPIN 22

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

#include "chords.h"

// Special thanks to Matthew Rahtz - http://amid.fish/karplus-strong/



// GUItool: begin automatically generated code
AudioSynthKarplusStrong string1; //xy=55,267
AudioSynthKarplusStrong string6; //xy=153,213
AudioMixer4 mixer1; //xy=166,387
AudioInputI2S i2s1; //xy=245,101
AudioSynthKarplusStrong string5; //xy=312,190
AudioSynthKarplusStrong string2; //xy=435,153
AudioMixer4 mixer2; //xy=474,444
AudioSynthKarplusStrong string3; //xy=541,252
AudioSynthKarplusStrong string4; //xy=570,134
AudioOutputI2S i2s2; //xy=667,491
AudioOutputSPDIF2 spdif2; //xy=704,401
AudioConnection patchCord1(string1, 0, mixer1, 0);
AudioConnection patchCord2(string6, 0, mixer2, 2);
AudioConnection patchCord3(mixer1, 0, mixer2, 0);
AudioConnection patchCord4(i2s1, 0, mixer2, 3);
AudioConnection patchCord5(i2s1, 1, i2s2, 1);
AudioConnection patchCord6(string5, 0, mixer2, 1);
AudioConnection patchCord7(string2, 0, mixer1, 1);
AudioConnection patchCord8(mixer2, 0, spdif2, 0);
AudioConnection patchCord9(mixer2, 0, spdif2, 1);
AudioConnection patchCord10(mixer2, 0, i2s2, 0);
AudioConnection patchCord11(string3, 0, mixer1, 2);
AudioConnection patchCord12(string4, 0, mixer1, 3);
// GUItool: end automatically generated code



const int finger_delay = 5;
const int hand_delay = 220;

int chordnum = 0;

void setup() {
pinMode(MUTEPIN, OUTPUT);
digitalWrite (MUTEPIN, 0);
pinMode(PDNPIN, OUTPUT);
digitalWrite (PDNPIN, 0);
AudioMemory(30);
float gain = 0.15;
//float gain = 0;
mixer1.gain(0, gain);
mixer1.gain(1, gain);
mixer1.gain(2, gain);
mixer1.gain(3, gain);
mixer2.gain(1, gain);
mixer2.gain(2, gain);
delay(700);
digitalWrite (PDNPIN, 1);

}

void strum_up(const float *chord, float velocity);
void strum_dn(const float *chord, float velocity);

void loop() {
const float *chord;

// each time through the loop, play a different chord
if (chordnum == 0) {
chord = Cmajor;
Serial.println("C major");
chordnum = 1;
} else if (chordnum == 1) {
chord = Gmajor;
Serial.println("G major");
chordnum = 2;
} else if (chordnum == 2) {
chord = Aminor;
Serial.println("A minor");
chordnum = 3;
} else {
chord = Eminor;
Serial.println("E minor");
chordnum = 0;
}

// then strum the 6 string several times
strum_up(chord, 1.0);
delay(hand_delay);
delay(hand_delay);
strum_up(chord, 1.0);
delay(hand_delay);
strum_dn(chord, 0.8);
delay(hand_delay);
delay(hand_delay);
strum_dn(chord, 0.8);
delay(hand_delay);
strum_up(chord, 1.0);
delay(hand_delay);
strum_dn(chord, 0.8);
delay(hand_delay);
strum_up(chord, 1.0);
delay(hand_delay);
delay(hand_delay);
strum_up(chord, 1.0);
delay(hand_delay);
strum_dn(chord, 0.7);
delay(hand_delay);
delay(hand_delay);
strum_dn(chord, 0.7);
delay(hand_delay);
strum_up(chord, 1.0);
delay(hand_delay);
strum_dn(chord, 0.7);
delay(hand_delay);

Serial.print("Max CPU Usage = ");
Serial.print(AudioProcessorUsageMax(), 1);
Serial.println("%");
}

void strum_up(const float *chord, float velocity)
{
if (chord[0] > 20.0) string1.noteOn(chord[0], velocity);
delay(finger_delay);
if (chord[1] > 20.0) string2.noteOn(chord[1], velocity);
delay(finger_delay);
if (chord[2] > 20.0) string3.noteOn(chord[2], velocity);
delay(finger_delay);
if (chord[3] > 20.0) string4.noteOn(chord[3], velocity);
delay(finger_delay);
if (chord[4] > 20.0) string5.noteOn(chord[4], velocity);
delay(finger_delay);
if (chord[5] > 20.0) string6.noteOn(chord[5], velocity);
delay(finger_delay);
}

void strum_dn(const float *chord, float velocity)
{
if (chord[5] > 20.0) string1.noteOn(chord[5], velocity);
delay(finger_delay);
if (chord[4] > 20.0) string2.noteOn(chord[4], velocity);
delay(finger_delay);
if (chord[3] > 20.0) string3.noteOn(chord[3], velocity);
delay(finger_delay);
if (chord[2] > 20.0) string4.noteOn(chord[2], velocity);
delay(finger_delay);
if (chord[1] > 20.0) string5.noteOn(chord[1], velocity);
delay(finger_delay);
if (chord[0] > 20.0) string6.noteOn(chord[0], velocity);
delay(finger_delay);
}
Teensy 4.0
The I2S codec is AK4556VT on I2S1.
The S/PDIF output is just a LED on pin2.
With the original input_i2s.cpp, the input of sound soes not work.
then I replaced that with the one from post #5
(https://forum.pjrc.com/threads/60354-Teensyduino-1-52-Beta-2?p=235165&viewfull=1#post235165). The I2S input test works partially, but during compile throws this output:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ input_i2s.cpp: In static member function 'static void AudioInputI2S::isr()':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\ input_i2s.cpp:125:52: warning: invalid conversion from 'const void*' to 'void*' [-fpermissive]

arm_dcache_delete(src, sizeof(i2s_rx_buffer) / 2);

^

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/core_pins.h:32:0,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/wiring.h:39,

from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/WProgram.h:45,

from C:\Users\Angelina\AppData\Local\Temp\arduino_build _881006\pch\Arduino.h:6:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/imxrt.h:9124:20: note: initializing argument 1 of 'void arm_dcache_delete(void*, uint32_t)'

static inline void arm_dcache_delete(void *addr, uint32_t size)

^

Opening Teensy Loader...

Sketch uses 32960 bytes (1%) of program storage space. Maximum is 2031616 bytes.
Global variables use 53940 bytes (10%) of dynamic memory, leaving 470348 bytes for local variables. Maximum is 524288 bytes.
As said, I2S input works partially. It shows high distortion, as if not every sample is read.
Also, the I2S output has now or then a very short dropout, or short episodes of slight distortion, while the S/PDIF plays clear signal.
I've checked the signals to the chip. They are very clear and rectangular, using in-line resistors, but have quite sime timing jitter.
pin23 MCLK seems to have the same jitter. It looks like there is something not stable with the frequencies/PLLs. The phases do not show constant lengths.

The settings of the AKM are classic I2S. normal speed, proven many times on other I2S devices:
Mode 5, CKS3=L, CKS2=H, CKS1=L, CKS0=H, I2S slave
De-emphasis off, DEM1=L, DEM0=H

So this should be pretty standard.

Frank B
04-10-2020, 06:40 PM
That"s interesting as it works for me.
You can ignore the warning shown.

Deleted User
04-10-2020, 06:49 PM
Other issue: Sometimes, without making sense why, the Teensy 4 crashes during upload. It can then only be recovered by pressing the buttin for 15 seconds until the redt blips, then after a while, there is the orange blink. Closing Teensyduino/Arduino and the loader. disconnecting from USB, reconnecting and repating compile and program works.
There seems to be no other way to recover the Teensy, because once it crashes during an upload, it remains so even if disconnected and reconneced or the Teensyduino and loader closed or reboot PC.
Looks like the Teensy is then pretty much messed, so the long button press is the only way back to work.
This happens on PC amd also on laptop, Windows 10 x64, also different USB cables, all tried.

forgot: When Teensy crashes, the loader shows something like "Erase Error" in red after a while

defragster
04-10-2020, 07:34 PM
@Deleted User - have not seen that before? "Erase Error" or other upload fails as described. That seems to suggest a failure of the storage EEPROM - or other damage preventing full function.

The TeensyLoader program offers 'Verbose info' under the Help menu item.

With the sketch ready to upload { a Verify build in the IDE } open the verbose info and clear the Log perhaps.

Then try the upload { a button press after Verify } and if it fails then save that log info and upload the file for Paul's review.

If it works to upload repeat the log clear and retry so any events or feedback going along with the 'Erase Error' are captured in whatever detail is exposed.

Deleted User
04-10-2020, 07:58 PM
The error happens not always. Today it was 2 times on the one Teensy 4 that is left here.
This one has maybe 50 uploads on the flash, never used something like eeprom library, so the memory should be ok.
Also it has never been exposed to radiation, temperature, moisture or magnetic fields other than natural home ambient.
Never used any power supply other than USB, never connected anything other than the AKM, the LED, and a perfectly working SPI ST7789 1.3'' display, all on 3.3V, so there should be everything ok with that aspect.
The supply and the 3.3V looks clean, but further more I did not scope into the Teensy 4, like crystals or so, because it is too tiny to probe by hand and the test rig is in our lab, not here.

defragster
04-10-2020, 09:06 PM
Interesting - that sounds uncalled for :( Leaving the Verbose open and hitting Clear before each Upload will capture the transfer messages. If it fails then SAVE the log file and post it to get whatever is recorded so Paul can see it.

Frank B
04-10-2020, 10:41 PM
I've never had this too, even with a hundrets of uploads.
Damaged USB cable? A weird ground-loop? Something is very strange with your setup, because I2S works perfect for me, too. Even with 256k Samplerate (PCM1808 + 5104)

Deleted User
04-10-2020, 10:45 PM
@defragster
Yesterday I had the issue several times. Today twice. Since I've read your post I did several uploads to provoke the error, but no problem. The next time I'll post the log here.

Deleted User
04-10-2020, 10:55 PM
I've never had this too, even with a hundrets of uploads.
Damaged USB cable? A weird ground-loop? Something is very strange with your setup, because I2S works perfect for me, too. Even with 256k Samplerate (PCM1808 + 5104)

No ground loop, just the USB cable, nothing else connected to AKM, the first time the error came. So I changed the USB cable. The next time I changed the computer. Once connected amp to AKM, once nothing, because working on display. Usually I disconnect the audio line before flashing, anyway, so how could be the gound loop? During run no problem shows, also no ground loop noise if connected to amp.
You can be harsh to me, but I keep calm.
Maybe this one Teensy 4 has broken/faulty crystal. That would also explain issues with I2S signals.

Frank B
04-10-2020, 11:12 PM
Sorry, it was not my intention to be harsh. English is not my native language.

defragster
04-11-2020, 09:37 AM
Paul - Time setting to T_4.0 SRTC is not done in TD 1.52b2 :: See post or two above this one :: TimeTeensy3-example-gt-Time-chosen-is-not-permanent (https://forum.pjrc.com/threads/45377-TimeTeensy3-example-gt-Time-chosen-is-not-permanent?p=235461&viewfull=1#post235461)

Also noted in that post - whenever TeensyLoader runs from THIS PC the time showing on the Teensy is 'BACK' one hour!

Using the code in that linked thread the time can manually be advanced one hour to make it match PC time, Then on new UPLOAD the time is Always set back one hour again.

Here is the code in use calling suggested code to set SRTC time on T_4.0 from sketch with renamed function:: Rrtc_set()


// https://forum.pjrc.com/threads/45377-TimeTeensy3-example-gt-Time-chosen-is-not-permanent?p=235414&viewfull=1#post235414
#include <TimeLib.h> // https://github.com/PaulStoffregen/Time

time_t clock;
int i = 0;

void setup()
{
Serial.begin(115200);
while (!Serial && millis() < 4000 );
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);

// set the Time library to use Teensy 4.0's RTC to keep time
setSyncProvider(getTeensy3Time);
setSyncInterval(60);
getTeensy3Time();
if (timeStatus() != timeSet) Serial.println("Init: RTC -> Unable to sync with the RTC");
else Serial.println("Init: RTC has set the system time");
}

void loop()
{
i = check_btn(); // read which button has been pressed

if (i == 1) RTC_Time_set(60); // + 1 minute
if (i == 2) RTC_Time_set(-60); // - 1 minute
if (i == 10) RTC_Time_set(+3600); // + 1 hour
if (i == 20) RTC_Time_set(-3600); // - 1 hourB

display_time(); // show time on screen
}

time_t getTeensy3Time()
{
return Teensy3Clock.get();
}

void RTC_Time_set(int x) // add x seconds
{
clock = now();
setTime(clock + x);
delay(100);
//Teensy3Clock.set(now());
Rrtc_set(now());
}

int check_btn()
{
if (Serial.available() > 0)
{
String data = "";
char x;
while (Serial.available())
{
x = Serial.read();

if (isDigit(x))
data += x - '0';
}
return data.toInt();
}
return 0;
}

void display_time()
{
char s[10];
sprintf(s, "%02d:%02d:%02d", hour(), minute(), second());
Serial.println(s);
delay(1000);
}

void Rrtc_set(unsigned long t)
{
// stop the RTC
SNVS_HPCR &= ~(SNVS_HPCR_RTC_EN | SNVS_HPCR_HP_TS);
while (SNVS_HPCR & SNVS_HPCR_RTC_EN); // wait
// stop the SRTC
SNVS_LPCR &= ~SNVS_LPCR_SRTC_ENV;
while (SNVS_LPCR & SNVS_LPCR_SRTC_ENV); // wait
// set the SRTC
SNVS_LPSRTCLR = t << 15;
SNVS_LPSRTCMR = t >> 17;
// start the SRTC
SNVS_LPCR |= SNVS_LPCR_SRTC_ENV;
while (!(SNVS_LPCR & SNVS_LPCR_SRTC_ENV)); // wait
// start the RTC and sync it to the SRTC
SNVS_HPCR |= SNVS_HPCR_RTC_EN | SNVS_HPCR_HP_TS;
}

jim lee
04-11-2020, 06:07 PM
Guys, can someone give me a quick. What is teesnyduino explanation?

Is it a replacement for the IDE? Do I still need the original Arduino IDE? From my ignorant user's point of view, everything has changed and I haven't been able to find an explanation as to what I have here.

Thanks!

-jim lee

MichaelMeissner
04-11-2020, 07:48 PM
Guys, can someone give me a quick. What is teesnyduino explanation?

Is it a replacement for the IDE? Do I still need the original Arduino IDE? From my ignorant user's point of view, everything has changed and I haven't been able to find an explanation as to what I have here.

Thanks!

-jim lee
Teensydunio is an addition to the original Ardunio IDE. You first install the Arduino IDE (1.8.12 being the current release), and then run the Teensydunio program, and it modifies your Arduino IDE to have Teensy support.

defragster
04-11-2020, 08:37 PM
Teensydunio is an addition to the original Ardunio IDE. You first install the Arduino IDE (1.8.12 being the current release), and then run the Teensydunio program, and it modifies your Arduino IDE to have Teensy support.

With the exception for the Newer Mac installer - IIRC - where secure install has them bundled:

TeensyduinoInstall.dmg 79M

TeensyduinoInstall.exe 67M

TeensyduinoInstall.linux32 66M

TeensyduinoInstall.linux64 67M

TeensyduinoInstall.linuxaarch64 85M

TeensyduinoInstall.linuxarm 84M

Teensyduino_MacOS_Catalina.zip 283M

jim lee
04-11-2020, 10:07 PM
Thanks for answering guys.

I've a Mac 10.13.6 I did the Catalina install. As for as I could tell it just put a new IDE on my drive called Teensyduino. I'm kinda' asssuming this is all I need and can toss out my old IDE? I ask because this is so different than what I"m used to where the installer just updates your original IDE.

-jim lee

defragster
04-11-2020, 10:11 PM
Thanks for answering guys.

I've a Mac 10.13.6 I did the Catalina install. As for as I could tell it just put a new IDE on my drive called Teensyduino. I'm kinda' asssuming this is all I need and can toss out my old IDE?

-jim lee

AFAIK that is correct. Not a mac user - but the notes IIRC said to work with the new secure install stuff tied the TD into IDE all in one to get what is needed.

jim lee
04-11-2020, 10:15 PM
Cool thanks! Back in the saddle!


-jim lee

jim lee
04-11-2020, 10:26 PM
Back out of the saddle..


#include <Adafruit_GFX.h>
#include <ILI9341_t3.h>


void setup() {

}

void loop() {

}

#include <ILI9341_t3.h> <- No such file.

I just looked into the package contents (Mac thing) and found this file under hardware/teensy/libraries. Somehow this IDE can't find it.

Hints?

-jim lee

defragster
04-11-2020, 10:41 PM
No idea how the IDE tracks file locations on MAC - even on Windows ( to avoid the IDE using 'known' system settings of its choosing ) I started doing unzip installs for multiple 'local reference' IDE copies where it runs 'all relative' based on the folder it was started from - but uses a common 'sketchbook' folder where all my stuff and 'personal libraries' are stored.

If TD+IDE was installed uniquely after an IDE install - and the IDE install was removed the linkage to the any 'IDE' may have been cut?

Not sure if that is in the right direction of the issue? Perhaps uninstall ALL IDE and TD+IDE copies - then just do a TD+IDE install?

jim lee
04-11-2020, 10:59 PM
AH! Got it. Teensyduino has the teensy stuff in it. Then new IDE from Arduino does not. I'd forgot to check to make sure I was compiling for a teensy. So I guess it wasn't looking for teensy library files.

There is still the issue where ILI9341_t3.h conflicts with Adafruit_GFX.h though.

-jim lee

defragster
04-12-2020, 12:36 AM
Looks like an adafruit_gfx is included with Teensyduino? Need to see the build console output to know if it is using a local version?

jim lee
04-12-2020, 03:19 AM
Well, here it is. Looks like teensyduino has a private copy of Adafruit_GFX.h


Multiple libraries were found for "Adafruit_GFX.h"/var/folders/wt/mcbdk5yn5wz6z1zcpf20xvzw0000gn/T/arduino_build_619311/libraries/ILI9341_t3/ILI9341_t3.cpp.o: In function `Adafruit_GFX_Button::drawButton(bool)':

Used: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Adafruit_GFX
Not used: /Users/jimlee/Documents/Arduino/libraries/Adafruit_GFX_Library
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/ILI9341_t3/ILI9341_t3.cpp:1851: multiple definition of `Adafruit_GFX_Button::drawButton(bool)'
/var/folders/wt/mcbdk5yn5wz6z1zcpf20xvzw0000gn/T/arduino_build_619311/libraries/Adafruit_GFX/Adafruit_GFX.cpp.o:/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Adafruit_GFX/Adafruit_GFX.cpp:1587: first defined here
/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
/var/folders/wt/mcbdk5yn5wz6z1zcpf20xvzw0000gn/T/arduino_build_619311/libraries/ILI9341_t3/ILI9341_t3.cpp.o: In function `Print::flush()':
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/ILI9341_t3/ILI9341_t3.cpp:1377: multiple definition of `Adafruit_GFX_Button::contains(short, short)'
/var/folders/wt/mcbdk5yn5wz6z1zcpf20xvzw0000gn/T/arduino_build_619311/libraries/Adafruit_GFX/Adafruit_GFX.cpp.o:/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Print.h:61: first defined here
collect2: error: ld returned 1 exit status
Error compiling for board Teensy 3.2 / 3.1.

What I read in the ILI9341_t3.h file


// To avoid conflict when also using Adafruit_GFX or any Adafruit library
// which depends on Adafruit_GFX, #include the Adafruit library *BEFORE*
// you #include ILI9341_t3.h.

Doesn't seem to be working for some odd reason.

P.S. I know I'm guilty of cross posting this. But I can't delete my other post. Sorry about that.

-jim lee

jim lee
04-12-2020, 05:25 AM
Ok, I pulled ILI9341_t3 stuff out for now. Went back to the original one from Adafruit. Got everything to compile again. But now there's no teensy loader? Is this not included with this new teensyduino IDE?



Opening Teensy Loader...
Unable find Teensy Loader. (p) Is the Teensy Loader application running?

-jim lee

defragster
04-12-2020, 07:51 AM
Yes, there should be a TeensyLoader installed - if not then something isn't installed right.

On this Windows machine the first run to load TeensyLoader takes like 15 seconds for some reason. Though not if started soon after booting - but when run some time later there is a long delay for startup.

Again - never did the Mac thing - but IDE and TeensyLoader should all be there with all Teensy files and updated boards.txt allowing Teensy selection. and upload.

jim lee
04-12-2020, 08:29 PM
Well, your guesses are at least putting me on the right paths. Thank you! The loader didn't come with the installer. So, I thought it was no longer needed with this new fancy stuff. I went back and found the teensy loader app, d-loaded & installed it, clicked it and presto! I'm up and running.

Thanks again!

-jim lee

defragster
04-12-2020, 08:46 PM
Glad you are up and running! Assumed the FAT catalina installer was all in one solution that would result in IDE 1.8.12 and TD ready to run?

Deleted User
04-12-2020, 10:28 PM
Even though the upload error on the Teensy Loader did not show up again, perfectly following Murphy's Law, I could not get the sound to work. So I followed the idea of a malfunction in hardware and baked the Teensy over night at 50℃, dip fluxed and reflowed newly, then cleaned. Luckily enough, none of the tiny dust on the underside fell off. Et voilą, everything works as it should be, except for the button, which clogged and charred, but use external anyway. Nice and clean audio, stable signals. So nice!

Thanks @Frank B for i2s library.

You could add AKM AK4556VT to the list of compatible chips. It works very well, easy to set up, makes nice quality audio, stereo input and output, and is cheap, 1.38$

jim lee
04-13-2020, 06:31 AM
After a day of hacking on my teensy stuff I quit the teensyduino and it took the entire mac down. Power off, everything.

I don't know if it'll help, but here's the stuff apple wanted as a report.


Anonymous UUID: 5171288A-F5CB-2F3F-51AF-8F0E584824DE

Sun Apr 12 22:25:38 2020

*** Panic Report ***
panic(cpu 0 caller 0xffffff800198776f): Kernel trap at 0xffffff8001d4fb33, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0x0000000000000018, CR3: 0x0000000149caa0e1, CR4: 0x00000000003627e0
RAX: 0x0000000000000000, RBX: 0xffffff80521ce950, RCX: 0x0000000000000000, RDX: 0xffffff80424b2e00
RSP: 0xffffff9219d4bc40, RBP: 0xffffff9219d4bc60, RSI: 0xffffff8038ad4290, RDI: 0xffffff80424b2e00
R8: 0x0000000000000000, R9: 0x000000000000270d, R10: 0x0000000000000000, R11: 0x00071519bf8f52ef
R12: 0xffffff8039ee0cc0, R13: 0x0000000000000009, R14: 0xffffff80424b2e00, R15: 0xffffff80424b2ee0
RFL: 0x0000000000010203, RIP: 0xffffff8001d4fb33, CS: 0x0000000000000008, SS: 0x0000000000000010
Fault CR2: 0x0000000000000018, Error code: 0x0000000000000000, Fault CPU: 0x0, PL: 0, VF: 0

Backtrace (CPU 0), Frame : Return Address
0xffffff9219d4b710 : 0xffffff800186c1c6
0xffffff9219d4b760 : 0xffffff8001995274
0xffffff9219d4b7a0 : 0xffffff8001987544
0xffffff9219d4b810 : 0xffffff800181e1e0
0xffffff9219d4b830 : 0xffffff800186bc3c
0xffffff9219d4b960 : 0xffffff800186b9fc
0xffffff9219d4b9c0 : 0xffffff800198776f
0xffffff9219d4bb30 : 0xffffff800181e1e0
0xffffff9219d4bb50 : 0xffffff8001d4fb33
0xffffff9219d4bc60 : 0xffffff8001cfd50d
0xffffff9219d4bcb0 : 0xffffff8001cfcf8c
0xffffff9219d4bd20 : 0xffffff8001cfa20f
0xffffff9219d4bd60 : 0xffffff8001d167c9
0xffffff9219d4be20 : 0xffffff800189f09f
0xffffff9219d4beb0 : 0xffffff80018a3105
0xffffff9219d4bee0 : 0xffffff80018645f6
0xffffff9219d4bf30 : 0xffffff800181e1ac

BSD process name corresponding to current thread: teensy_serialmon

Mac OS version:
17G65

Kernel version:
Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64
Kernel UUID: 1AE5ACFD-3B6F-3D74-AD52-31F1430DBC6F
Kernel slide: 0x0000000001600000
Kernel text base: 0xffffff8001800000
__HIB text base: 0xffffff8001700000
System model name: iMac18,2 (Mac-77F17D7DA9285301)

System uptime in nanoseconds: 1993524228744486
last loaded kext at 1993427686880212: com.apple.driver.usb.cdc.ecm 5.0.0 (addr 0xffffff7f85e92000, size 49152)
last unloaded kext at 1993487943390344: com.apple.driver.usb.cdc.ecm 5.0.0 (addr 0xffffff7f85e92000, size 49152)
loaded kexts:
com.apple.driver.AppleTopCaseHIDEventDriver 133
com.apple.driver.AudioAUUC 1.70
com.apple.driver.AGPM 110.23.37
com.apple.driver.ApplePlatformEnabler 2.7.0d0
com.apple.driver.X86PlatformShim 1.0.0
com.apple.filesystems.autofs 3.0
com.apple.driver.AppleUpstreamUserClient 3.6.5
com.apple.kext.AMDFramebuffer 1.6.8
com.apple.kext.AMDRadeonX4000 1.6.8
com.apple.driver.AppleHDA 281.52
com.apple.driver.AppleGraphicsDevicePolicy 3.20.13
com.apple.AGDCPluginDisplayMetrics 3.20.13
com.apple.driver.pmtelemetry 1
com.apple.iokit.IOUserEthernet 1.0.1
com.apple.iokit.IOBluetoothSerialManager 6.0.7f10
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.driver.AppleHV 1
com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0
com.apple.driver.AppleIntelKBLGraphics 10.3.6
com.apple.iokit.BroadcomBluetooth20703USBTransport 6.0.7f10
com.apple.driver.AppleIntelPCHPMC 2.0.1
com.apple.kext.AMD9500Controller 1.6.8
com.apple.driver.AppleThunderboltIP 3.1.1
com.apple.driver.AppleOSXWatchdog 1
com.apple.driver.eficheck 1
com.apple.driver.AppleGFXHDA 100.1.17
com.apple.driver.AppleSMCLMU 211
com.apple.driver.AppleMCCSControl 1.5.5
com.apple.driver.AppleIntelKBLGraphicsFramebuffer 10.3.6
com.apple.AppleFSCompression.AppleFSCompressionTyp eDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTyp eZlib 1.0.0
com.apple.AppleSystemPolicy 1.0
com.apple.BootCache 40
com.apple.filesystems.hfs.kext 407.50.6
com.apple.driver.AppleSDXC 1.7.6
com.apple.iokit.AppleBCM5701Ethernet 10.3.1
com.apple.driver.AirPort.BrcmNIC 1241.31.1a9
com.apple.driver.AppleAHCIPort 329.50.2
com.apple.driver.AppleACPIButtons 6.1
com.apple.driver.AppleRTC 2.0
com.apple.driver.AppleSMBIOS 2.1
com.apple.driver.AppleACPIEC 6.1
com.apple.driver.AppleAPIC 1.7
com.apple.nke.applicationfirewall 183
com.apple.security.quarantine 3
com.apple.security.TMSafetyNet 8
com.apple.driver.usb.cdc.acm 5.0.0
com.apple.driver.usb.cdc 5.0.0
com.apple.driver.usb.IOUSBHostHIDDevice 1.2
com.apple.driver.AppleUSBHostMergeProperties 1.2
com.apple.driver.AppleHIDKeyboard 205
com.apple.driver.AppleMultitouchDriver 1404.4
com.apple.driver.AppleInputDeviceSupport 1404.3
com.apple.driver.AppleHSBluetoothDriver 133
com.apple.driver.IOBluetoothHIDDriver 6.0.7f10
com.apple.kext.triggers 1.0
com.apple.kext.AMDRadeonX4200HWLibs 1.0
com.apple.driver.DspFuncLib 281.52
com.apple.kext.OSvKernDSPLib 526
com.apple.kext.AMDRadeonX4000HWServices 1.6.8
com.apple.driver.AppleGraphicsControl 3.20.13
com.apple.iokit.IOSerialFamily 11
com.apple.iokit.IOAVBFamily 680.2
com.apple.plugin.IOgPTPPlugin 680.15
com.apple.driver.AppleSSE 1.0
com.apple.AppleGPUWrangler 3.20.13
com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0
com.apple.iokit.BroadcomBluetoothHostControllerUSB Transport 6.0.7f10
com.apple.iokit.IOBluetoothHostControllerUSBTransp ort 6.0.7f10
com.apple.iokit.IOBluetoothHostControllerTransport 6.0.7f10
com.apple.iokit.IOBluetoothFamily 6.0.7f10
com.apple.kext.AMDSupport 1.6.8
com.apple.driver.AppleHDAController 281.52
com.apple.iokit.IOHDAFamily 281.52
com.apple.driver.AppleSMBusPCI 1.0.14d1
com.apple.iokit.IOAudioFamily 206.5
com.apple.vecLib.kext 1.2.0
com.apple.iokit.IONDRVSupport 519.20
com.apple.driver.X86PlatformPlugin 1.0.0
com.apple.driver.IOPlatformPluginFamily 6.0.0d8
com.apple.driver.AppleSMBusController 1.0.18d1
com.apple.AppleGraphicsDeviceControl 3.20.13
com.apple.iokit.IOAcceleratorFamily2 378.26
com.apple.iokit.IOGraphicsFamily 519.20
com.apple.iokit.IOSurface 211.15
com.apple.driver.usb.networking 5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice 1.2
com.apple.driver.CoreStorage 546.50.1
com.apple.filesystems.hfs.encodings.kext 1
com.apple.iokit.IOAHCIBlockStorage 301.40.2
com.apple.driver.AppleThunderboltDPInAdapter 5.5.5
com.apple.driver.AppleThunderboltDPAdapterFamily 5.5.5
com.apple.driver.AppleThunderboltPCIDownAdapter 2.1.3
com.apple.driver.AppleHPM 3.1.3
com.apple.driver.AppleIntelLpssI2CController 3.0.60
com.apple.driver.AppleIntelLpssDmac 3.0.60
com.apple.driver.AppleIntelLpssI2C 3.0.60
com.apple.driver.AppleThunderboltNHI 4.7.2
com.apple.iokit.IOThunderboltFamily 6.7.8
com.apple.iokit.IOEthernetAVBController 1.1.0
com.apple.iokit.IO80211Family 1200.12.2
com.apple.driver.mDNSOffloadUserClient 1.0.1b8
com.apple.driver.corecapture 1.0.4
com.apple.iokit.IOAHCIFamily 288
com.apple.driver.usb.AppleUSBHostPacketFilter 1.0
com.apple.iokit.IOUSBFamily 900.4.1
com.apple.driver.usb.AppleUSBXHCIPCI 1.2
com.apple.driver.usb.AppleUSBXHCI 1.2
com.apple.driver.AppleEFINVRAM 2.1
com.apple.driver.AppleEFIRuntime 2.1
com.apple.iokit.IOSMBusFamily 1.1
com.apple.iokit.IOHIDFamily 2.0.0
com.apple.security.sandbox 300.0
com.apple.kext.AppleMatch 1.0.0d1
com.apple.driver.AppleFDEKeyStore 28.30
com.apple.driver.AppleEffaceableStorage 1.0
com.apple.driver.AppleKeyStore 2
com.apple.driver.AppleUSBTDM 439.70.3
com.apple.driver.AppleMobileFileIntegrity 1.0.5
com.apple.iokit.IOUSBMassStorageDriver 140.70.2
com.apple.iokit.IOSCSIBlockCommandsDevice 404.30.2
com.apple.iokit.IOSCSIArchitectureModelFamily 404.30.2
com.apple.driver.AppleCredentialManager 1.0
com.apple.driver.KernelRelayHost 1
com.apple.iokit.IOUSBHostFamily 1.2
com.apple.driver.usb.AppleUSBCommon 1.0
com.apple.driver.AppleBusPowerController 1.0
com.apple.driver.AppleSEPManager 1.0.1
com.apple.driver.IOSlaveProcessor 1
com.apple.driver.DiskImages 480.60.1
com.apple.iokit.IOStorageFamily 2.1
com.apple.iokit.IOReportFamily 31
com.apple.iokit.IOTimeSyncFamily 680.15
com.apple.iokit.IONetworkingFamily 3.4
com.apple.driver.AppleACPIPlatform 6.1
com.apple.driver.AppleSMC 3.1.9
com.apple.iokit.IOPCIFamily 2.9
com.apple.iokit.IOACPIFamily 1.4
com.apple.kec.Libm 1
com.apple.kec.pthread 1
com.apple.kec.corecrypto 1.0

EOF
Model: iMac18,2, BootROM IM183.0161.B00, 4 processors, Intel Core i5, 3 GHz, 16 GB, SMC 2.40f0
Graphics: Radeon Pro 555, Radeon Pro 555, PCIe
Memory Module: BANK 0/DIMM0, 8 GB, DDR4, 2400 MHz, 0x802C, 0x3841544631473634485A2D324733453220202020
Memory Module: BANK 1/DIMM0, 8 GB, DDR4, 2400 MHz, 0x802C, 0x3841544631473634485A2D324733453220202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x16E), Broadcom BCM43xx 1.0 (7.77.37.31.1a9)
Bluetooth: Version 6.0.7f10, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: APPLE HDD HTS541010A9E632, 1 TB
USB Device: USB 3.0 Bus
USB Device: Bluetooth USB Host Controller
USB Device: FaceTime HD Camera (Built-in)
Thunderbolt Bus: iMac, Apple Inc., 33.1


-jim lee

bicycleguy
04-14-2020, 01:18 AM
After a day of hacking on my teensy stuff I quit the teensyduino and it took the entire mac down. Power off, everything.

I don't know if it'll help, but here's the stuff apple wanted as a report.
...
-jim lee
-jim,
Can't comment on the crash other than to say I have found it to be as good or better than previous versions, although I too experienced a crash like yours back when I first switched many months ago, but none since.

The MacOS Catalina versions are named a little weird if your used to the pre-catalina. https://forum.pjrc.com/threads/59054-Teensyduino-1-49-Released?p=227003&viewfull=1#post227003. Should add that there is no Teensy Installer req'd and everything you might have picked to include with it is already installed. The little Teensyduino helper app that comes up when you have a Teensy board selected and compile is now called Teensy.

I could be wrong but I think the name changes were required in order to not conflict with the unaltered Arduino application that must be code signed by them eventually if they haven't done so already. Perhaps the crash we both experienced was something security related with apple since like you my mac had been up many weeks before the installation.

wcalvert
04-14-2020, 10:43 PM
Regarding the failure to upload to T4, I just wanted to share the following.

It is not a bug report and I'm not expecting anyone to do anything about it. It should be treated as anecdotal only.

I have been building a device around the T4 for a while. The T4 has its VIN trace cut, and this seemed to really contribute to the problems. The development system is a Dell XPS 15 with win 10. Strangely, I have found that all the problems go away if I put a plain old unpowered USB hub between the T4 and the computer. The problems with upload, and the USB hub solution, have held over several different T4s and hardware builds. There are too many unknowns, so it the culprit could be windows, it could be the laptop, the external power circuitry. I do not know yet.

As I said... *anecdotal only*... not a bug report. Just thought I would share my experience.

Deleted User
04-15-2020, 02:41 PM
just my two cents:
Oh, that could be the ground loop problem, Frank B mentioned some posts upward, depending on the type of power supply, peripherals, etc. The hub "recreates" the USB signals and might contribute in ironing out any issues with levels and timings.
I've found thant both my Vaio and the HP produce some sort of "static hum" on the metal parts of the shells when connected to AC via their original power brick. They have the grounded italian and german 3-prong connector to the grid. The wall socket has clean and good ground, so I suspect it is some issue within the power bricks, maybe some filtering. The 2001 Toshiba has a eurio 2-pole and does not produce any kind of this hum. Also, the travel power supply for the HP has only two poles and does not introduce hum.

haikuty
04-20-2020, 02:49 AM
Yes, that seems correct. This confused me also.
On macOS 10.15.x Teensyduino.app seems to now be a full replacement for the Arduino.app (likely because of security issues - modifying other applications is not allowed).
The PJRC.com web pages about installation and first steps are very confusing for macOS 10.15 users as a result of this change.

Teensyduino 1.5.1 is working fine on macOS X 10.15.4 for me FWIW (to a Teensy LC).