Teensy 4.0 First Beta Test

Status
Not open for further replies.
Did some more testing this morning with that clock generator chip especially between 60-70 Mhz. Looks like I would limit it to 68 or 70Mhz.

Re: FreqCount on T4 with quad timer

I too did some testing with Adafruit clock generator (Si5351A). For my T4B2R, the frequency count is accurate to about 65 mhz as measured against the T4's crystal. @65mhz frequency error is about -22 ppm, but @66mhz error is -73 ppm. @50mhz errors is -20.5 ppm, and @1mhz it is -20 ppm. With GPS PPS, i measured my T4B2R frequency error (24mhz crystal) at -11 ppm, so that suggests the Adafruit generator's crystal has an error of -31 ppm (spec says generator's 25mhz crystal is accurate to within 30 ppm).

I also tested the generator with T3.6 (-6 ppm) FreqCount library, and those tests also showed my Adafruit generator crystal has frequency error of -31 ppm. I also confirmed that T3* can count accurately up to 65 mhz, as documented by Paul in his youtube demo, see
https://forum.pjrc.com/threads/4798...ad-after-12MHz?p=160470&viewfull=1#post160470

Curious that both T4 and T3 frequency counting is good up to 65 mhz. Is there some fundamental IC characteristic that determines counting threshold or capacitance/hysteresis of input or ?? A shorter common ground jumper between the T4 and the T3.2 controlling the generator helps.
Code:
With a 7" ground jumper and 70 mhz PWM
      67656628
      67655729
      67657627
with 2" jumper
      69526989
      69525509
      69535055

As noted in previous posts, a single T4 with its PWM output jumpered to its counter input can count a 75 mhz PWM input.

EDIT: Using GPS PPS, i measured Adafruit generator 25mhz crystal frequency error to be -31.2 ppm.

EDIT 2: the T3* FreqCount uses LPTMR, and the 65 mhz is a limit of the 16-bit timer rollover (intervaltimer checks for rollover every 1000 us, so max external clock rate would be 65mhz) With another sketch, I can count up to 132.5 MHz, see
https://forum.pjrc.com/threads/54711-Teensy-4-0-First-Beta-Test?p=212014&viewfull=1#post212014
 
Last edited:
Re: FreqCount on T4 with quad timer

@manitou

The one thing that i haven't tried is turning hysterisis on for pin 9. But anyway using 8" jumpers i am seeing the following using the updated FreqCount lib sketch:
Code:
@10
10000080
10000081
10000081
10000081

@20
20000163
20000162
20000163

@25
25000200
25000201
25000200
25000200


@60Mhz
60000473
60000473
60000472

@65mhz
65000513
65000515
65000515
65000514

@70
66455620
66455038
66449752
66430449

Other than at 70Mhz it seems to consistently giving me overshoot of *7.9e-8 percent error between the clock generator and the T4. ‬
 
Just in case you are not aware - many/most SI5351 (used in the Adafruit module) libraries provide a calibration function for the XTAL oscillator. You only need to calibrate at one frequency, ie it's a ppm calibration. Of course you need a "gold" standard, I calibrate against the WWV freq standards at 5 or 10 MHz, and routinely get calibration to 1 Hz at the XTAL frequency.
I use the Adafruit module all over the place. The SI5351 is a fantastic little chip - with abysmal documentation :confused:.
Example from the (overly complex) https://github.com/etherkit/Si5351Arduino
Code:
set_correction()
/*
 * set_correction(int32_t corr, enum si5351_pll_input ref_osc)
 *
 * corr - Correction factor in ppb
 * ref_osc - Desired reference oscillator
 *     (use the si5351_pll_input enum)
 *
 * Use this to set the oscillator correction factor.
 * This value is a signed 32-bit integer of the
 * parts-per-billion value that the actual oscillation
 * frequency deviates from the specified frequency.
 *
 * The frequency calibration is done as a one-time procedure.
 * Any desired test frequency within the normal range of the
 * Si5351 should be set, then the actual output frequency
 * should be measured as accurately as possible. The
 * difference between the measured and specified frequencies
 * should be calculated in Hertz, then multiplied by 10 in
 * order to get the parts-per-billion value.
 *
 * Since the Si5351 itself has an intrinsic 0 PPM error, this
 * correction factor is good across the entire tuning range of
 * the Si5351. Once this calibration is done accurately, it
 * should not have to be done again for the same Si5351 and
 * crystal.
 */
I can give you links to easier to use libraries...
 
Just in case you are not aware - many/most SI5351 (used in the Adafruit module) libraries provide a calibration function for the XTAL oscillator.
Re: generator frequency correction

Thanks. Though not really a T4 issue, the Adafruit generator library has a fractional option for multiplying the 25mhz clock for the PLL. So using
clockgen.setupPLL(SI5351_PLL_A, 20, 20*31, 1000000); // ppm fix
I can correct for the -31 ppm error in my Adafruit generator.
 
TeensyThreads Help

I think I got Teensy Threads library working (Tests.ino says everything is OK ) with the T4 - not 100% sure I did it right and I do have a question if someone could help:

Question: How do you get an unused_isr? in the current thread lib it has:
Code:
if (save_svcall_isr == unused_isr) save_svcall_isr = 0;
but there is no unused_isr function in Teensy4 core but I did find an unused_interrupt_vector but its only in startup.c. Just as a test I just did:
Code:
  // commandeer the SVCall & SysTick Exceptions
  save_svcall_isr = _VectorsRam[11];
  //if (save_svcall_isr == unused_isr) save_svcall_isr = 0;
  save_svcall_isr = 0;

Question 2: Not sure I did this one right but need verification...
Was:
Code:
/*
 * Stop using the SysTick interrupt and start using
 * the IntervalTimer timer. The parameter is the number of microseconds
 * for each tick.
 *
 * Implementation strategy suggested by @tni in Teensy Forums; see
 * https://forum.pjrc.com/threads/41504-Teensy-3-x-multithreading-library-first-release
 */
int Threads::setMicroTimer(int tick_microseconds)
{
  // lowest priority so we don't interrupt other interrupts
  context_timer.priority(255);
  // start timer with dummy fuction
  if (context_timer.begin(context_pit_empty, tick_microseconds) == 0) {
    // failed to set the timer!
    return 0;
  }
  currentUseSystick = 0; // disable Systick calls
  // get the PIT number [0-3] (IntervalTimer overrides IRQ_NUMBER_t op)
  int number = (IRQ_NUMBER_t)context_timer - IRQ_PIT_CH0;
  // calculate number of uint32_t per PIT; should be 4.
  // Not hard-coded in case this changes in future CPUs.
  const int width = (PIT_TFLG1 - PIT_TFLG0) / 4;
  // get the right flag to ackowledge PIT interrupt
  context_timer_flag = &PIT_TFLG0 + (width * number);
  attachInterruptVector(context_timer, context_switch_pit_isr);
  return 1;
}
Converted to:
Code:
int Threads::setMicroTimer(int tick_microseconds)
{
  // lowest priority so we don't interrupt other interrupts
  context_timer.priority(255);
  // start timer with dummy fuction
  if (context_timer.begin(context_pit_empty, tick_microseconds) == 0) {
    // failed to set the timer!
    return 0;
  }
  currentUseSystick = 0; // disable Systick calls
  // get the PIT number [0-3] (IntervalTimer overrides IRQ_NUMBER_t op)
  for (int i = 0; i < 4; i++)
  {
    if (IMXRT_PIT_CHANNELS[i].TFLG == 0) 
    {
		int number = i;
  //int number = (IRQ_NUMBER_t)context_timer - IMXRT_PIT_CHANNELS[0];
  // calculate number of uint32_t per PIT; should be 4.
  // Not hard-coded in case this changes in future CPUs.
  const int width = (PIT_TFLG1 - PIT_TFLG0) / 4;
  // get the right flag to ackowledge PIT interrupt
  context_timer_flag = &PIT_TFLG0 + (width * number);
  attachInterruptVector(context_timer, context_switch_pit_isr);
  return 1;
	}
  }
	return 0;
}

EDIT: ok - setMicros does not work... Pretty sure this conversionis wrong:
Code:
int number = (IRQ_NUMBER_t)context_timer - IRQ_PIT_CH0
I hate timers :) Not really

EDIT1: Could also be the context switcher that is the assembly language file which I know nothing about.
 
Last edited:
I've uploaded 1.47-beta5. As always, links on msg #2.

This version will update your T4 bootloader to 1.05, which is the version we plan to ship when we release Teensy 4.0 "real soon now". 1.05 fixes a bug where the red LED would blink (indicating no USB connectivity - like a charge-only cable) when Windows would use USB suspend to save power. Now the LED remains on, indicating good USB.

An obscure bug where printing binary data to the Arduino Serial Monitor when in native "Teensy Port" mode could sometimes stall the serial monitor window has also been fixed.

1.47-beta5 also includes Kurt & Mike & Tim, to FreqCount, ST7735_t3 and minor fixes in the Audio library.
 
@PaulStoffregen

Just downloaded and installed 1.47-beta5 on Windows 10 x64 with no problem. Saw the bootloader updating and out of curiosity checked the log
Code:
08:23:52.731 (loader): Bootloader upgrade: 0.04 -> 1.05
. On new load always seems to load T3.2 as the selected board. Did a quick retest of FreqCount since I had it still set up from yesterday and changes did still work - always happy when things work. Now back to playing with Teensy Threads.

Hope all is well.
 
@PaulStoffregen

Installed a fresh copy of Arduino 1.8.9 and TD 1.47B5. I was compiling one of my test programs that use the time library and got an error.
So I tried compiling 'TimeRTC.ino' and it gave the same error below:
Code:
Arduino: 1.8.9 (Linux), TD: 1.47-beta5, Board: "Teensy 4.0, Serial, Fastest, US English"

/home/wwatson/arduino-1.8.9/arduino-builder -dump-prefs -logger=machine -hardware /home/wwatson/arduino-1.8.9/hardware -hardware /home/wwatson/.arduino15/packages -tools /home/wwatson/arduino-1.8.9/tools-builder -tools /home/wwatson/arduino-1.8.9/hardware/tools/avr -tools /home/wwatson/.arduino15/packages -built-in-libraries /home/wwatson/arduino-1.8.9/libraries -libraries /home/wwatson/Arduino/libraries -fqbn=teensy:avr:teensy40:usb=serial,opt=o3std,keys=en-us -ide-version=10809 -build-path /tmp/arduino_build_964940 -warnings=none -build-cache /tmp/arduino_cache_9678 -verbose /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/examples/TimeRTC/TimeRTC.ino
/home/wwatson/arduino-1.8.9/arduino-builder -compile -logger=machine -hardware /home/wwatson/arduino-1.8.9/hardware -hardware /home/wwatson/.arduino15/packages -tools /home/wwatson/arduino-1.8.9/tools-builder -tools /home/wwatson/arduino-1.8.9/hardware/tools/avr -tools /home/wwatson/.arduino15/packages -built-in-libraries /home/wwatson/arduino-1.8.9/libraries -libraries /home/wwatson/Arduino/libraries -fqbn=teensy:avr:teensy40:usb=serial,opt=o3std,keys=en-us -ide-version=10809 -build-path /tmp/arduino_build_964940 -warnings=none -build-cache /tmp/arduino_cache_9678 -verbose /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/examples/TimeRTC/TimeRTC.ino
Using board 'teensy40' from platform in folder: /home/wwatson/arduino-1.8.9/hardware/teensy/avr
Using core 'teensy4' from platform in folder: /home/wwatson/arduino-1.8.9/hardware/teensy/avr
Detecting libraries used...
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 /tmp/arduino_build_964940/sketch/TimeRTC.ino.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time /tmp/arduino_build_964940/sketch/TimeRTC.ino.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire /tmp/arduino_build_964940/sketch/TimeRTC.ino.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /tmp/arduino_build_964940/sketch/TimeRTC.ino.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/DateStrings.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/Time.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/utility /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/Wire.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/utility /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireIMXRT.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/utility /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireKinetis.cpp -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/utility /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/utility/twi.c -o /dev/null
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC/DS1307RTC.cpp -o /dev/null
Generating function prototypes...
/home/wwatson/arduino-1.8.9/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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /tmp/arduino_build_964940/sketch/TimeRTC.ino.cpp -o /tmp/arduino_build_964940/preproc/ctags_target_for_gcc_minus_e.cpp
/home/wwatson/arduino-1.8.9/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_964940/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/home/wwatson/arduino-1.8.9/hardware/teensy/../tools/precompile_helper /home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 /tmp/arduino_build_964940 /home/wwatson/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -x c++-header -O3 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 /tmp/arduino_build_964940/pch/Arduino.h -o /tmp/arduino_build_964940/pch/Arduino.h.gch
/home/wwatson/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -c -O3 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/tmp/arduino_build_964940/pch -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /tmp/arduino_build_964940/sketch/TimeRTC.ino.cpp -o /tmp/arduino_build_964940/sketch/TimeRTC.ino.cpp.o
Compiling libraries...
Compiling library "Time"
/home/wwatson/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -c -O3 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/tmp/arduino_build_964940/pch -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/DateStrings.cpp -o /tmp/arduino_build_964940/libraries/Time/DateStrings.cpp.o
/home/wwatson/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -c -O3 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/tmp/arduino_build_964940/pch -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/cores/teensy4 -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/Time.cpp -o /tmp/arduino_build_964940/libraries/Time/Time.cpp.o
/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/DateStrings.cpp: In function 'char* monthStr(uint8_t)':
/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/DateStrings.cpp:76:66: [COLOR="#FF0000"]error: 'strcpy_P' was not declared in this scope[/COLOR]
     strcpy_P(buffer, (PGM_P)pgm_read_word(&(monthNames_P[month])));
                                                                  ^
/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/DateStrings.cpp: In function 'char* dayStr(uint8_t)':
/home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time/DateStrings.cpp:90:61: [COLOR="#FF0000"]error: 'strcpy_P' was not declared in this scope[/COLOR]
    strcpy_P(buffer, (PGM_P)pgm_read_word(&(dayNames_P[day])));
                                                             ^
Using library Time at version 1.5 in folder: /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Time 
Using library Wire at version 1.0 in folder: /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/Wire 
Using library DS1307RTC at version 1.4.1 in folder: /home/wwatson/arduino-1.8.9/hardware/teensy/avr/libraries/DS1307RTC 
Error compiling for board Teensy 4.0.

I searched for 'strcpy_P' in the compiler libs but did not find it.
I changed line 20 in 'DateStrings.cpp' to this:
Code:
#if defined(ESP8266) || defined(ARDUINO_ARCH_ESP32) [COLOR="#FF0000"]|| defined(__IMXRT1062__)[/COLOR]

It compiled ok after that.
Can't wait for the T4 release:)
 
Time/DateStrings.cpp - Not sure why the changes were made that were made...

That is, that section of code:

Code:
#if defined(ESP8266) || defined(ARDUINO_ARCH_ESP32)
#ifndef strcpy_P
#define strcpy_P(dest, src) strcpy((dest), (src))
#endif
#endif

In June a PR changed the #if from: #ifndef ESP8266

To: #ifdef ESP8266

So before that change all other platforms checked for existence of strcpy_P to only exp8266 ???

Then later PR, was needed to get ESP32 to work again, which you pulled in on July 4th...

Maybe that whole #if defined ... Should just be removed? Again wonder of needed for T3.x? or is this some differences in which version of compiler that is used?
 
Installed TD_1.47b5. Install ran FINE! Win 10 - Malwarebytes and Windows Defender Security active. IDE and TeensyLoader closed - Found no Orphaned Teensy Processes!

Did a PURGE of sketchbook\libraries into sketchbook\T4_libraries to make sure I was using nothing not part of the install!

Current sketches were ST7789 based:
PROBLEM : Adafruit_GFX
>> Had to restore "T:\tCode\libraries\Adafruit_GFX" [AFAIK] KurtE version of this library as the one in Teensy\AVR FAILS!
Multiple libraries were found for "Adafruit_GFX.h"
Used: T:\tCode\libraries\Adafruit_GFX
Not used: T:\Ard186t4b2\hardware\teensy\avr\libraries\Adafruit_GFX

Two recent sketches - both using TWIN ST7789's compile and run fine on latest T4 with this install of TD1.47b5!

@mjs513: with the T4 in BETA - the changes to make the T4 a 'default'/known device are not yet connected AFAIK - that is why each new install still reverts to T_3.2

>> Oh and yes the T4 tested with got a BOOTLOADER update and is running well
Code:
[B]10:17:45.354 (loader): Bootloader upgrade: 0.04 -> 1.05[/B]
10:17:45.356 (loader): flash, block=0, bs=1024
10:17:45.356 (loader): flash, block=1, bs=1024
10:17:45.556 (loader): remote cmd from 1404: "status"
// …
10:17:48.677 (loader): Bootloader update: 34% of estimated 8 seconds, wait=27
10:17:48.787 (loader): Bootloader update: 35% of estimated 8 seconds, wait=28
10:17:48.788 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
10:17:48.789 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
10:17:48.789 (ports 2): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
10:17:48.789 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0105
10:17:48.789 (ports 2): found_usb_device, devinst=0000001d
10:17:48.789 (ports 2): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0105, serial=00093c64, dev=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
10:17:48.803 (ports 2): hiddev_from_devinst_list: iface=0
10:17:48.805 (ports 2): found_usb_device complete
10:17:48.806 (ports 2): usb_add: usb:0/140000/0/8/7  [no_device] (Teensy) Bootloader
10:17:48.897 (loader): Bootloader update: 36% of estimated 8 seconds, wait=29
[B]10:17:48.897 (loader): Bootloader update finished, 2.9 seconds[/B]
10:17:48.897 (loader): Board is: Teensy 4.0 (IMXRT1062), version 1.05
10:17:48.897 (loader): flash, block=0, bs=1024, auto=1
10:17:48.897 (loader):  gauge old value = 0
10:17:48.909 (loader): flash, block=1, bs=1024, auto=1
10:17:48.910 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED

And for TTS files {had to run in firefox as it won't run in EDGE} :: https://lingojam.com/MicrosoftSamOnline
This online tool lets you generate a Microsoft Sam style voice (not the exact original) that you can play and download easily.
 
Paul: Is that NEW that a 'Programming Progress' or other status update - like 'Updating Bootloader' pops up as Top Window during TLoader activity?

Also :: A 15 Second Restore with New Bootloader - No problem! No complaints from Windows - T4 returned to 'Blink Sketch' and IDE was OPEN and did Upload without any grief!
TIMING > looks like about 15 seconds for Button initiate and 14 Seconds for Restore and device arrival? Based on :: '10:44:09' >> '10:44:38'
Code:
10:44:09.911 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
10:44:09.912 (ports 2): remove: loc=usb:0/140000/0/8/7
10:44:09.912 (ports 2): usb_remove: usb:0/140000/0/8/7
10:44:09.912 (ports 2): nothing new, skipping HID & Ports enum
10:44:09.931 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
10:44:09.931 (ports 2): nothing new, skipping HID & Ports enum
10:44:09.935 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
[B]10:44:09.935 (ports 2): nothing new, skipping HID & Ports enum
10:44:11.551 (ports 2): purge, name=COM33 (Teensy 4-Beta2) Serial, loc=usb:0/140000/0/8/7, age=1.638 sec
[/B]10:44:11.951 (ports 2): callback C1A9
10:44:13.972 (ports 2): callback C1A9
10:44:16.049 (ports 2): callback C1A9
10:44:18.061 (ports 2): callback C1A9
10:44:20.088 (ports 2): callback C1A9
10:44:22.106 (ports 2): callback C1A9
10:44:24.125 (ports 2): callback C1A9
10:44:26.141 (ports 2): callback C1A9
10:44:28.198 (ports 2): callback C1A9
10:44:30.253 (ports 2): callback C1A9
10:44:31.836 (loader): Verbose Info event
10:44:32.267 (ports 2): callback C1A9
10:44:34.322 (ports 2): callback C1A9
10:44:36.378 (ports 2): callback C1A9
10:44:38.274 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
10:44:38.275 (ports 2): nothing new, skipping HID & Ports enum
[B]10:44:38.298 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
[/B]10:44:38.299 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0486#6052840#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
10:44:38.299 (ports 2): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
10:44:38.299 (ports 2): found_usb_device, devinst=0000001f
10:44:38.299 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0486&REV_0279
10:44:38.299 (ports 2): add: loc=usb:0/140000/0/8/7, class=USB, vid=16C0, pid=0486, ver=0279, serial=6052840, dev=\\?\usb#vid_16c0&pid_0486#6052840#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
10:44:38.300 (ports 2): hiddev_from_devinst_list: iface=1
10:44:38.301 (ports 2): found_usb_device complete
10:44:38.302 (ports 2): usb_add: usb:0/140000/0/8/7  [no_device] (Teensy 4-Beta2) RawHID
10:44:38.557 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
10:44:38.557 (ports 2): callback C1A9
10:44:38.558 (ports 2): update_usb_device, devinst list change, old had 2, new has 5
10:44:38.558 (ports 2): hiddev_from_devinst_list: iface=1
10:44:38.559 (ports 2):   00000023: path=\\?\hid#vid_16c0&pid_0486&mi_01#8&826c72&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
10:44:38.559 (ports 2): hid, found devinst=00000021
10:44:38.560 (ports 2): hid, found devinst=00000023
10:44:38.560 (ports 2): usb_add: usb:0/140000/0/8/7  hid#vid_16c0&pid_0486 (Teensy 4-Beta2) RawHID
10:44:38.697 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
10:44:38.698 (ports 2): nothing new, skipping HID & Ports enum
 
Just a heads up.
I installed beta 5 over top of beta 4 and then compiled a test of an audio microphone test sketch which I had successfully compiled 5 minutes previously with beta 4 for the T4B2.
Beta 5 gives these errors.
Code:
.
.
.
"C:\\arduino-1.8.9_1.47_b5\\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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Audio" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\SPI" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\SD" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\SerialFlash" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Wire" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Audio\\utility" "C:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Audio\\output_i2s.cpp" -o nul
Error while detecting libraries included by C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp
"C:\\arduino-1.8.9_1.47_b5\\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=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Audio" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\SPI" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\SD" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\SerialFlash" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Wire" "-IC:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Audio\\utility" "C:\\arduino-1.8.9_1.47_b5\\hardware\\teensy\\avr\\libraries\\Audio\\output_i2s2.cpp" -o nul
.
.
.
C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:547:2: error: #elif without #if

 #elif 0 && (defined(__IMXRT1052__) || defined(__IMXRT1062__) )

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:615:2: error: #endif without #if

 #endif

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp: In static member function 'static void AudioOutputI2Sslave::config_i2s()':

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:507:2: error: 'SIM_SCGC6' was not declared in this scope

  SIM_SCGC6 |= SIM_SCGC6_I2S;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:507:15: error: 'SIM_SCGC6_I2S' was not declared in this scope

  SIM_SCGC6 |= SIM_SCGC6_I2S;

               ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:508:2: error: 'SIM_SCGC7' was not declared in this scope

  SIM_SCGC7 |= SIM_SCGC7_DMA;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:508:15: error: 'SIM_SCGC7_DMA' was not declared in this scope

  SIM_SCGC7 |= SIM_SCGC7_DMA;

               ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:509:15: error: 'SIM_SCGC6_DMAMUX' was not declared in this scope

  SIM_SCGC6 |= SIM_SCGC6_DMAMUX;

               ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:512:6: error: 'I2S0_TCSR' was not declared in this scope

  if (I2S0_TCSR & I2S_TCSR_TE) return;

      ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:513:6: error: 'I2S0_RCSR' was not declared in this scope

  if (I2S0_RCSR & I2S_RCSR_RE) return;

      ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:517:2: error: 'I2S0_MCR' was not declared in this scope

  I2S0_MCR = I2S_MCR_MICS(0);

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:517:27: error: 'I2S_MCR_MICS' was not declared in this scope

  I2S0_MCR = I2S_MCR_MICS(0);

                           ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:518:2: error: 'I2S0_MDR' was not declared in this scope

  I2S0_MDR = 0;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:521:2: error: 'I2S0_TMR' was not declared in this scope

  I2S0_TMR = 0;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:522:2: error: 'I2S0_TCR1' was not declared in this scope

  I2S0_TCR1 = I2S_TCR1_TFW(1);  // watermark at half fifo size

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:522:28: error: 'I2S_TCR1_TFW' was not declared in this scope

  I2S0_TCR1 = I2S_TCR1_TFW(1);  // watermark at half fifo size

                            ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:523:2: error: 'I2S0_TCR2' was not declared in this scope

  I2S0_TCR2 = I2S_TCR2_SYNC(0) | I2S_TCR2_BCP;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:525:2: error: 'I2S0_TCR3' was not declared in this scope

  I2S0_TCR3 = I2S_TCR3_TCE;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:526:2: error: 'I2S0_TCR4' was not declared in this scope

  I2S0_TCR4 = I2S_TCR4_FRSZ(1) | I2S_TCR4_SYWD(31) | I2S_TCR4_MF

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:529:2: error: 'I2S0_TCR5' was not declared in this scope

  I2S0_TCR5 = I2S_TCR5_WNW(31) | I2S_TCR5_W0W(31) | I2S_TCR5_FBT(31);

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:532:2: error: 'I2S0_RMR' was not declared in this scope

  I2S0_RMR = 0;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:533:2: error: 'I2S0_RCR1' was not declared in this scope

  I2S0_RCR1 = I2S_RCR1_RFW(1);

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:534:2: error: 'I2S0_RCR2' was not declared in this scope

  I2S0_RCR2 = I2S_RCR2_SYNC(1) | I2S_TCR2_BCP;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:536:2: error: 'I2S0_RCR3' was not declared in this scope

  I2S0_RCR3 = I2S_RCR3_RCE;

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:537:2: error: 'I2S0_RCR4' was not declared in this scope

  I2S0_RCR4 = I2S_RCR4_FRSZ(1) | I2S_RCR4_SYWD(31) | I2S_RCR4_MF

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:540:2: error: 'I2S0_RCR5' was not declared in this scope

  I2S0_RCR5 = I2S_RCR5_WNW(31) | I2S_RCR5_W0W(31) | I2S_RCR5_FBT(31);

  ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:543:36: error: 'PORT_PCR_MUX' was not declared in this scope

  CORE_PIN23_CONFIG = PORT_PCR_MUX(6); // pin 23, PTC2, I2S0_TX_FS (LRCLK)

                                    ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:598:2: error: 'i2s' was not declared in this scope

  i2s->TX.MR = 0;

  ^

In file included from C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\cores\teensy4/core_pins.h:32:0,

                 from C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\cores\teensy4/wiring.h:38,

                 from C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\cores\teensy4/WProgram.h:45,

                 from C:\Users\Peter\AppData\Local\Temp\arduino_build_165994\pch\Arduino.h:6:

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:600:30: error: 'tsync' was not declared in this scope

  i2s->TX.CR2 = I2S_TCR2_SYNC(tsync) | I2S_TCR2_BCP;

                              ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\cores\teensy4/imxrt.h:7420:39: note: in definition of macro 'I2S_TCR2_SYNC'

 #define I2S_TCR2_SYNC(n)  ((uint32_t)(n & 3)<<30) // 0=async 1=sync with receiver

                                       ^

C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio\output_i2s.cpp:609:30: error: 'rsync' was not declared in this scope

  i2s->RX.CR2 = I2S_RCR2_SYNC(rsync) | I2S_TCR2_BCP;

                              ^

Multiple libraries were found for "SD.h"
C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\cores\teensy4/imxrt.h:7399:39: note: in definition of macro 'I2S_RCR2_SYNC'

 Used: C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\SD
 #define I2S_RCR2_SYNC(n)  ((uint32_t)(n & 3)<<30) // 0=async 1=sync with trasmitter

 Not used: C:\arduino-1.8.9_1.47_b5\libraries\SD
                                       ^

Using library Audio at version 1.3 in folder: C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Audio 
Using library SPI at version 1.0 in folder: C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\SPI 
Using library SD at version 1.2.2 in folder: C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\SD 
Using library SerialFlash at version 0.5 in folder: C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\SerialFlash 
Using library Wire at version 1.0 in folder: C:\arduino-1.8.9_1.47_b5\hardware\teensy\avr\libraries\Wire 
Error compiling for board Teensy 4.0.

The code is:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputI2S            i2s1;           //xy=61.66667938232422,103.66667175292969
AudioMixer4              mixer1;         //xy=192,116
AudioEffectDelay         delay1;         //xy=343,69
AudioMixer4              mixer2;         //xy=489,247
AudioOutputI2S           i2s2;           //xy=632,246.6666717529297
AudioConnection          patchCord1(i2s1, 0, mixer1, 0);
AudioConnection          patchCord2(i2s1, 1, mixer1, 1);
AudioConnection          patchCord3(mixer1, delay1);
AudioConnection          patchCord4(mixer1, 0, mixer2, 1);
AudioConnection          patchCord5(delay1, 0, mixer2, 0);
AudioConnection          patchCord6(mixer2, 0, i2s2, 0);
AudioConnection          patchCord7(mixer2, 0, i2s2, 1);
AudioControlSGTL5000     sgtl5000_1;     //xy=76.66667175292969,28.333333015441895
// GUItool: end automatically generated code

void setup() {

  AudioMemory(100);                               //  <----- moved this line to here

  Serial.begin(9600);
  while(!Serial);
  
  Serial.println("Begin Initialization...");
                                                  //  <----- from here
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.8);
  sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
  sgtl5000_1.micGain(0);
  mixer1.gain(0,0.4);
  mixer1.gain(1,0.4);
  mixer2.gain(0,0.4);
  mixer2.gain(1,0.3);
  delay1.delay(0,100);
  Serial.println("... Initialization Complete!");

}

void loop() {
  static int volume;
  int n = analogRead(15);
  if (n != volume) {
    volume = n;
    sgtl5000_1.volume(n / 1024.);
  }
}

I have since tried this with a fresh install of Arduino 1.8.9 with beta 5 and it gives the same errors.
I'll try to sort it out a bit later this afternoon.

Pete
 
I have made a quick workaround to the problem. There is an #if statement in beta4 Audio/output_i2s.cpp which was removed in beta5 but the matching #elif and #endif are still there.
I have just added the #if back in and the sketch compiles again - it still doesn't work, but that's a different kettle of fish.

Code:
void AudioOutputI2Sslave::config_i2s(void)
{
//>>> PAH Add the #if back in for now
#if defined(KINETISK)

Pete
 
BUILTIN_SDCARD on T4B2R no longer working.

I was testing beta5, and SD example listfiles failed for my BUILTIN_SDCARD on my T4B2R. At first I thought it was beta5, but on another host with beta4, listfiles still failed. I then tried my older T4B2 board with beta5 and BUILTIN_CARD listfiles worked ok on that earlier T4 ... sigh. I'm not aware of any physical trauma to the T4B2R other than pulling the audio shield in and out over the last few weeks. listfiles works on uSD on the audio shield. I've never pulled out the MCU board or messed with the ribbon.

thoughts?
 
BUILTIN_SDCARD on T4B2R no longer working.

I was testing beta5, and SD example listfiles failed for my BUILTIN_SDCARD on my T4B2R. At first I thought it was beta5, but on another host with beta4, listfiles still failed. I then tried my older T4B2 board with beta5 and BUILTIN_CARD listfiles worked ok on that earlier T4 ... sigh. I'm not aware of any physical trauma to the T4B2R other than pulling the audio shield in and out over the last few weeks. listfiles works on uSD on the audio shield. I've never pulled out the MCU board or messed with the ribbon.

thoughts?

Just tested with the T4B2R. Getting a initialization failed error. This happens whether you specify the BUILTIN_SDCARD or specify the actual pins. I also downloaded the SD lib from the GitHub library and reinstalled the SD library and it still fails. Something strange is going on - that always worked - sd logger used to fail on me.
 
Works on the T4B2R breakout I have. More than a few files 210 lines including subdirs.

<EDIT>:: Confirmed to work as well with same SD card on T4BM with white wire on POGO SD breakout with Button program of same compiled sketch … three times.

NOTE:: my sketchbook libraries folder has one entry as noted above - adafruit_GFX - any chance there are conflicts on trouble machines?
"T:\\Ard186t4b2\\hardware\\teensy/../tools/teensy_post_compile" -file=listfiles.ino "-path=T:\\TEMP\\arduino_build_252223" "-tools=T:\\Ard186t4b2\\hardware\\teensy/../tools/" -board=TEENSY40
Multiple libraries were found for "SD.h"
Used: T:\Ard186t4b2\hardware\teensy\avr\libraries\SD
Not used: T:\Ard186t4b2\libraries\SD
Using library SD at version 1.2.2 in folder: T:\Ard186t4b2\hardware\teensy\avr\libraries\SD
Using library SPI at version 1.0 in folder: T:\Ard186t4b2\hardware\teensy\avr\libraries\SPI
"T:\\Ard186t4b2\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-size" -A "T:\\TEMP\\arduino_build_252223/listfiles.ino.elf"
Sketch uses 32368 bytes (1%) of program storage space. Maximum is 2031616 bytes.

I've unseated the T4 a few times - added some POGO's - but never disconnected the ribbon AFAIK.

>> "T:\Ard186t4b2\hardware\teensy\avr\libraries\SD\examples\listfiles\listfiles.ino" with :: const int chipSelect = BUILTIN_SDCARD;
Code:
Initializing SD card...initialization done.
SYSTEM~1/
	INDEXE~1		76
	WPSETT~1.DAT		12
ADC4PI~1.BIN		131072000
ADC~2173.BIN		131072000
D_00001.DAT		32768000
D_00002.DAT		32768000
D_00003.DAT		32768000
D_00004.DAT		32768000
D_00005.DAT		0
D_00006.DAT		32768000
D_00007.DAT		32768000
D_00008.DAT		32768000
NEWFILE.TXT		0
SDTEST3.WAV		13617358
SDTEST4.WAV		17173152
TDINER8.WAV		2058994
SDTEST1.WAV		16787550
SDTEST2.WAV		16425698
MVVHV/
	DATES.TXT		966
	HP250E~1.PNG		228285

//…

		TEAMVI~2.EXE		8220568
	PICS/
		061618~1.JPG		172386
		070818~1.JPG		169893
		427613~1.JPG		165863
		511953~1.JPG		105978
		910976~1.JPG		465615
		BACKPI~1.JPG		1378892
		MVVHOP~1.JPG		161238
		WI2WA.PNG		49484
D_00009.DAT		32768000
D_00010.DAT		32768000
done!
 
Last edited:
@defragster

The Adafruit_GFX lib is @KurtE's updated version - didn't install the version in Teensyduino. Local copy in my library folder. The SPI Library does have @KurtE's changes incorporated. No open PRs from Kurt's branch.

Reinstalled SPI library from GitHub just in case and made sure the SD Card was seated securely. So now it is working:
Code:
Initializing SD card...initialization done.
DATALOG.TXT		26152
SYSTEM~1/
	INDEXE~1		76
	WPSETT~1.DAT		12
ASCII/
	HELLO13.TXT		69
OPERAT~1.WAV		772140
2001/
	CALCUL~1.WAV		426300
	COMPLE~1.WAV		276460
	DANGER~1.WAV		372892
	ENOUGH~1.WAV		513388
	FUNCTI~1.WAV		237356
	ONE_MO~1.WAV		202236
	OPERAT~1.WAV		772140
	SORRY_~1.WAV		791164
	STOP.WAV		200844
FLAC/
	T1_1024.FLA		9802802
BERLIN~1.FLA		30401785
CHRIST~1.AAC		3177823
ODD.MP3		21430
ODD1.MP3		46888
ZARATH~1.MP3		489461
ODD1.WAV		553004
SDTEST1.WAV		16787550
CALCUL~1.WAV		426300
BINARY/
	TEST03.BIN		4096
done!
 
@mjs513 - Good you are seeing function!

Seems that AdaFruit_GFX needs to be confirmed and added to installer.

All else on my system was from installer and that was good

<edit>: Paul BTW - that means I updated two other T4BM's to the new bootloader in post #3916. They were both the same time - 2.7 secs IIRC.
 
Last edited:
@mjs513, @defragster, ... my version of Adafruit_GFX - Should now read Adafruit's version, as my few changes to the library were awhile ago and they were all pulled in by Lady Ada and new releases have been made since then.

In fact I have been running on their current stuff for awhile as my version was cloned into my <arduino sketches>/libraries folder and the library manager thought my version was out of date and I let it update to current released stuff.
 
@Frank B: I tried imxrt-size.exe today (with TD beta5) and it didn't output anything. It turns out that _teensy_model_identifier is 0x24 instead of 0x23. imxrt-size only prints info if the model is 0x23. I changed that in your code and recompiled it with cygwin and now it works.

Pete
 
Pete - did it still show good numbers for the segments?

@KurtE - downloading https://github.com/adafruit/Adafruit-GFX-Library to put in my local libraries to confirm that it has your changes to the better.
>> confirmed using Adafruit-GFX-Library-master.zip properly renamed into Used: T:\tCode\libraries\Adafruit_GFX builds and runs the ST7789 examples

@manitou - did you get a working SD ListFiles?
 
It reports a wild number for DTCM.
Code:
ITCM :  63616 B	(48.54% of  128 KB)
DTCM : 451264 B	(344.29% of  128 KB)   <<< 344% ?
OCRAM:  33792 B	(12.89% of  256 KB)
Flash: 499616 B	(31.76% of 1536 KB)
.
.
Sketch uses 499616 bytes (24%) of program storage space. Maximum is 2031616 bytes.
Global variables use 548672 bytes (52%) of dynamic memory, leaving 499904 bytes for local variables. Maximum is 1048576 bytes.
I've been playing around trying to get my channel vocoder to compile on the T4. It uses a lot of memory for arrays of samples. When I declare them to be PROGMEM the above output changes to this:
Code:
ITCM :  63616 B	(48.54% of  128 KB)
DTCM :  33472 B	(25.54% of  128 KB)
OCRAM:  33792 B	(12.89% of  256 KB)
Flash: 499600 B	(31.76% of 1536 KB)

Sketch uses 499600 bytes (24%) of program storage space. Maximum is 2031616 bytes.
Global variables use 130880 bytes (12%) of dynamic memory, leaving 917696 bytes for local variables. Maximum is 1048576 bytes.

Using PROGMEM somehow reduced DTCM by 417,792 bytes without adding them anywhere else. It looks like the DTCM total is included in Flash so that moving data from DTCM to flash (with PROGMEM) doesn't affect the total.

Pete
 
Those limits look like the fixed sizes from the early 1052-based beta hardware.

On 1062, OCRAM is always 512K, and we now automatically allocate the other 512K between ITCM and DTCM. ITCM is allocated as whatever your code uses, rounded up to the nearest 32K boundary. The rest of that 512K is all DTCM.

Flash support was increased to 1984K as well.
 
That is something FrankB did for 1052 not revisted since until el_supremo's update.

I've never tracked all the ins and outs of what's split where. Then what is PROGMEM and other and what CODE stays on Flash - all not PROGMEM? is pulled into RAM at load time?
 
Status
Not open for further replies.
Back
Top