Teensy 4.0 First Beta Test

Status
Not open for further replies.
QTIMER INTERRUPTS from COMPARATORS

With QTimers, there are two "Status and Control" registers - for example, TMR3_SCTRL1 and TMR3_CSCTRL1. The first is the Status/Control for the timer as a whole. The second is the Status/Control for comparators.

Interestingly, BOTH of these have "interrupt enable" bits for the comparators. Previously, I had set and cleared these bits in both registers when desiring an ISR.

But today I discovered that you do not have to use the IE bit in the SCTRL1 register in order to fire an ISR. It is sufficient to set one of the IE bits in the CSCTRL1 register. This means only one bit (flag) needs to be reset (to zero) within the ISR for respectable/reliable interrupt operation.
 
The code is:
Code:
  unsigned freq = 15000000; //15MHz or any other.. works up to F_BUS_ACTUAL / 2 = 75MHz (without overclocked F_BUS)
  TMR3_CMPLD10 = F_BUS_ACTUAL / 2 / freq - 1;

Edit: Verified with my scope. It show a few Hz off - might be an issue with the scope.

Interesting - have to go pull out my scope now as check. Went back to original sketch as test. If I use the form you posted I get double the freq that I specify when using the gpt clk/interrupt. Here is the sketch if you want to check:
Code:
// GPT1 counter like FreqCount
// external pin is 14 GPIO_AD_B1_02 ALT8  (Frontside - A0)
// test with  PWM pin 13 jumpered to 14

// FreqCount API
static inline void counter_init(void)
{
  CCM_CCGR0 |= CCM_CCGR0_GPT2_BUS(CCM_CCGR_ON) ;  // enable GPT1 module
  //CCM_CCGR0 |= CCM_CCGR0_GPT2_SERIAL(CCM_CCGR_ON) ;
  GPT2_CR = 0;
  GPT2_SR = 0x3F; // clear all prior status
  GPT2_CR =  GPT_CR_CLKSRC(3);// | GPT_CR_FRR ;// 3 external clock
  //*(portConfigRegister(14)) = 8;  // ALT 8
  //CORE_PIN14_CONFIG = 8; 
  IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_02 = 0x08;
  IOMUXC_GPT2_IPP_IND_CLKIN_SELECT_INPUT = 0x01;
}

static inline void counter_start(void)
{
  GPT2_CR |= GPT_CR_EN; // enable
}

static inline void counter_shutdown(void)
{
  GPT2_CR = 0;
}

static inline uint32_t counter_read(void)  // was uint16_t in FreqCount?
{
  return GPT2_CNT;
}

static inline uint8_t counter_overflow(void)
{
  return GPT2_SR & GPT_SR_ROV;
}

static inline void counter_overflow_reset(void)
{
  GPT2_SR |= GPT_SR_ROV;
}

volatile uint32_t count_ready, count_output, count_prev;
void tmr_callback() {
  uint32_t count = counter_read();

  //track rollover ?
  count_output = count - count_prev;
  count_prev = count;
  count_ready = 1;
}

IntervalTimer it1;

void setup() {
  Serial.begin(9600);
  while (!Serial);
  delay(2000);
  pinMode(13, OUTPUT);              //pin 13 as digital output

  
  //enable clocks for QTIMER3
  CCM_CCGR6 |= 0xC0000000;                    //enable clocks to CG15 of CGR6 for QT3

  //configure QTIMER1 Timer0 for test. Period = 65,536 = 436.9 uS (times 2) - rollover
  TMR3_CTRL0 = 0b0000000000100000;  // stop all functions of timer 
  TMR3_SCTRL0 = 0b0100000000000001; // 0(TimerCompareFlag),1(TimerCompareIntEnable),000000,00(Capture Disabled),00000,1(OFLAG to Ext Pin)
  TMR3_CNTR0 = 0;
  TMR3_LOAD0 = 0;
  //TMR3_COMP10 = 10000 -1;              // 6.7nS per clock = 66.7uS for 10,000 clocks on each half cycle
  //TMR3_CMPLD10 = 10000 -1;
  unsigned freq = 4000000;
  Serial.println(F_BUS_ACTUAL/2/freq-1);
  TMR3_CMPLD10 = F_BUS_ACTUAL /2/ freq - 1;
  TMR3_CSCTRL0 = 0b0000000001000001;  //Compare1 interrupt enable
  TMR3_CTRL0 = 0b0011000000100011;  // 001(Count rising edges Primary Source),1000(IP Bus Clock),00 (Secondart Source), 
                                    // 0(Count Once),1(Count up to Compare),0(Count Up),0(Co Channel Init),011(Toggle OFLAG on Compare)
  
  //configure Teensy pin Compare output
  IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_00 = 1;    // QT3 Timer0 is now on pin 19
  
  //enable GPT1 interrupt within NVIC table
  attachInterruptVector(IRQ_QTIMER3, QT3_isr);  //declare which routine performs the ISR function
  NVIC_ENABLE_IRQ(IRQ_QTIMER3);

  counter_init();
  it1.begin(tmr_callback, 1000000);  // us
  counter_start();

}

void QT3_isr(void) {
  digitalWriteFast(13, 1);
  TMR3_SCTRL0 = 0b0100000000000001;
  TMR3_CSCTRL0 = 0b0000000001000001;
  digitalWriteFast(13, 0);
  asm volatile("dsb");
}


void loop() {
  if (count_ready) {
    Serial.printf("Freq Count = %d\n",count_output);
    count_ready = 0;
  }
}

If I use analogWriteFrequency seems like I can get readings up to 15Mhz I think
 
Can probably do either: But if multiple ones on same SPI buss, you can obviously only do one at at a time using DMA...

My ST7735_t3 branch/fork updated: https://github.com/KurtE/ST7735_t3/tree/FB_Asynch
I have simple test program currently updating two displays I believe at same time:View attachment 17055

Which is going through lots of the Teensyview demo screens...
...
I probably want to test this out a little on at least T3.6 to see that it works before I then merge it into my other fork/branch with a current PR into the master...

I just got two ST7789 240x240's today - will they work with this current code?

If there is a working example, a pointer would be great and I can hook them up. These are the ones with software select missing a pin IIRC?
 
With QTimers, there are two "Status and Control" registers - for example, TMR3_SCTRL1 and TMR3_CSCTRL1. The first is the Status/Control for the timer as a whole. The second is the Status/Control for comparators.

Interestingly, BOTH of these have "interrupt enable" bits for the comparators. Previously, I had set and cleared these bits in both registers when desiring an ISR.

But today I discovered that you do not have to use the IE bit in the SCTRL1 register in order to fire an ISR. It is sufficient to set one of the IE bits in the CSCTRL1 register. This means only one bit (flag) needs to be reset (to zero) within the ISR for respectable/reliable interrupt operation.

@TelephoneBill - Been using recent QTimer example - is there an example like that showing the IE bits as you have found them to work?
 
predator/prey stochastic simulation

Tested T3 predator/prey sketch on T4B2R with ILI9341_t3 with 24x32 cell "world". Times (us) for one simulation step (graphics time not included) is
Code:
   1170@996MHz    83 us
   T4@600MHz      44 us
   T3.6@180MHz   300 us
   T3.5@120MHz   500 us
   T3.2@120MHz   537 us
   1052@600MHz    61 us   mbed
   k64f@120MHz   482 us   mbed
   32f405@168MHz 360 us
   F446RE@180MHz 321 us   mbed  -O3
   F767ZI@216MHz 133 us   mbed -O3
   ESP32@240MHZ  392 us   -O2
   m4@120MHz     458 us   SAMD51
   dragon@80MHz  684 us   dragonfly STM32L476
   DUE@84MHz    1135 us
   maple@72MHz  1009 us
   cpx@48MHz    1510 us   SAMD21
   ZERO@48MHz   1501 us
   T2++@16MHz  10492 us
   pico@125MHz   570 us
Different random numbers will affect simulation time.
antsnbugs.gifantsnbugs.jpg
prey blue, predator red
derived from https://github.com/Kristjan93/Ants-and-bugs

predator-prey models and interaction
lynx-hare.jpg

Wator predator-prey simulation (sharks and fish) and Java simulation
 
Last edited:
Tried LTO optimization and compile fails. Simple sketch problem is in setup() with call to ultoa():
Code:
void setup() {
	Serial.begin(115200);
	while (!Serial && millis() < 4000 );
	Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
	uint32_t foo = 1234567;
	char buf[24];
	ultoa( foo, buf, 10 );
	Serial.print( ultoa( foo, buf, 10 ) );
	pinMode( 13, OUTPUT );
}
uint32_t cnt = 0;
void loop() {
	cnt++;
	digitalWriteFast( 13, cnt % 2 );
	delay(500);
}

Step ONE:: Compile/Upload default FASTER and upload to see it work to a T4B2.
Step TWO:: results in this error ( hand coded the (used) pull request noted before in startup.c and it does not affect this )::
Using precompiled core: T:\TEMP\arduino_cache_171212\core\core_teensy_avr_teensy4b2_usb_serial,opt_o2lto,keys_en-us_9ff3b2877e4255bb9c7a7e4e314f2b14.a
Linking everything together...
"T:\\Ard186t4b2\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O2 -flto -fno-fat-lto-objects -Wl,--gc-sections,--relax "-TT:\\Ard186t4b2\\hardware\\teensy\\avr\\cores\\teensy4/imxrt1062.ld" -fuse-linker-plugin -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o "T:\\TEMP\\arduino_build_81960/Simple_Ultoa.ino.elf" "T:\\TEMP\\arduino_build_81960\\sketch\\Simple_Ultoa.ino.cpp.o" "T:\\TEMP\\arduino_build_81960/..\\arduino_cache_171212\\core\\core_teensy_avr_teensy4b2_usb_serial,opt_o2lto,keys_en-us_9ff3b2877e4255bb9c7a7e4e314f2b14.a" "-LT:\\TEMP\\arduino_build_81960" -larm_cortexM7lfsp_math -lm -lstdc++
T:\Ard186t4b2\hardware\teensy\avr\cores\teensy4\usb_desc.c: In function 'ResetHandler':

T:\Ard186t4b2\hardware\teensy\avr\cores\teensy4\usb_desc.c:1495:2: error: local frame unavailable (naked function?)
ultoa(num, buf, 10);
^
T:\Ard186t4b2\hardware\teensy\avr\cores\teensy4\usb_desc.c:1495: confused by earlier errors, bailing out
lto-wrapper.exe: fatal error: T:\Ard186t4b2\hardware\teensy/../tools/arm/bin/arm-none-eabi-gcc returned 1 exit status
compilation terminated.
t:/ard186t4b2/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
Error compiling for board Teensy 4-Beta2.

Step THREE: Push button on T4B2 - gives error of file not found dialog. Close Dialog
Step FOUR: Do Verify Build ( not Upload)
Step FIVE: Press T4B2 button - fails to program - Red Bootloader LED stays ON, until an Upload is selected - even if a second T4 is plugged in place of the first T4:
Code:
13:57:02.180 (serialmon 30): callback C124
13:57:04.200 (serialmon 30): callback C124
13:57:06.220 (serialmon 30): callback C124
13:57:08.245 (serialmon 30): callback C124
13:57:08.251 (ports 2): callback C124
13:57:10.264 (serialmon 30): callback C124
13:57:10.274 (ports 2): callback C124
13:57:12.297 (serialmon 30): callback C124
13:57:12.304 (ports 2): callback C124
13:57:14.321 (serialmon 30): callback C124
13:57:14.331 (ports 2): callback C124
13:57:16.343 (serialmon 30): callback C124
13:57:16.350 (ports 2): callback C124
13:57:17.182 (loader): file changed
13:57:18.376 (serialmon 30): callback C124
13:57:18.383 (ports 2): callback C124
13:57:20.419 (serialmon 30): callback C124
13:57:20.425 (ports 2): callback C124
13:57:22.437 (serialmon 30): callback C124
13:57:22.443 (ports 2): callback C124
13:57:22.899 (serialmon 30): teensy read ov error
13:57:22.899 (serialmon 30): teensy read error
13:57:22.901 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
13:57:22.901 (serialmon 30): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
13:57:22.902 (ports 2): remove: loc=usb:0/140000/0/8/7
13:57:22.902 (ports 2): usb_remove: usb:0/140000/0/8/7
13:57:22.902 (ports 2): nothing new, skipping HID & Ports enum
13:57:22.903 (serialmon 30): remove: loc=usb:0/140000/0/8/7
13:57:22.903 (serialmon 30): usb_remove: usb:0/140000/0/8/7
13:57:22.903 (serialmon 30): Disconnect \\.\COM33
13:57:22.903 (serialmon 30): nothing new, skipping HID & Ports enum
13:57:22.927 (serialmon 30): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:22.927 (serialmon 30): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
13:57:22.927 (serialmon 30): nothing new, skipping HID & Ports enum
13:57:22.948 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:22.948 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
13:57:22.949 (ports 2): nothing new, skipping HID & Ports enum
13:57:23.311 (serialmon 30): WM_DEVICECHANGE DBT_DEVICEARRIVAL
13:57:23.311 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
13:57:23.313 (serialmon 30): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:23.313 (serialmon 30): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
13:57:23.313 (serialmon 30): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
13:57:23.313 (serialmon 30): found_usb_device, devinst=00000006
13:57:23.313 (serialmon 30): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=00093c64, dev=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:23.313 (serialmon 30): hiddev_from_devinst_list: iface=0
13:57:23.313 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:23.313 (ports 2): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
13:57:23.313 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
13:57:23.313 (ports 2): found_usb_device, devinst=00000028
13:57:23.313 (ports 2): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=00093c64, dev=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:23.313 (ports 2): hiddev_from_devinst_list: iface=0
13:57:23.314 (serialmon 30): found_usb_device complete
13:57:23.314 (ports 2): found_usb_device complete
13:57:23.315 (serialmon 30): usb_add: usb:0/140000/0/8/7
13:57:23.315 (serialmon 30): ignoring partial USB device discovery (Windows XP issue?)
13:57:23.315 (ports 2): usb_add: usb:0/140000/0/8/7  [no_device] (Teensy 4-Beta2) Bootloader
13:57:23.326 (serialmon 30): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:23.327 (serialmon 30): update_usb_device, devinst list change, old had 1, new has 2
13:57:23.327 (serialmon 30): hiddev_from_devinst_list: iface=0
13:57:23.328 (serialmon 30): hid, found devinst=0000000B
13:57:23.329 (serialmon 30): usb_add: usb:0/140000/0/8/7
13:57:23.329 (serialmon 30): ignoring partial USB device discovery (Windows XP issue?)
13:57:23.331 (serialmon 30): hid, found devinst=0000000B
13:57:23.367 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:23.368 (ports 2): update_usb_device, devinst list change, old had 1, new has 2
13:57:23.368 (ports 2): hiddev_from_devinst_list: iface=0
13:57:23.369 (ports 2): hid, found devinst=00000029
13:57:23.369 (ports 2): hid, path=\\?\hid#vid_16c0&pid_0478#7&13065cc&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
13:57:23.369 (ports 2): hid,  opened handle
13:57:23.369 (ports 2):  devinst=00000029, location=usb:0/140000/0/8/7
13:57:23.369 (ports 2):  vid=16C0, pid=0478, ver=0004, usepage=FF9C, use=0024
13:57:23.369 (ports 2):  devpath=\\?\hid#vid_16c0&pid_0478#7&13065cc&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
13:57:23.369 (ports 2): usb_add: usb:0/140000/0/8/7  hid#vid_16c0&pid_0478 (Teensy 4-Beta2) Bootloader
13:57:23.421 (serialmon 30): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:23.423 (serialmon 30): hid, found devinst=0000000B
13:57:23.426 (serialmon 30): hid, found devinst=0000000B
13:57:23.445 (loader): Device came online, code_size = 2031616
13:57:23.450 (loader): Board is: Teensy 4-Beta2 (IMXRT1062), version 0.04
13:57:23.458 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:23.458 (ports 2): nothing new, skipping HID & Ports enum
13:57:23.460 (loader): set background IMG_ONLINE
13:57:23.460 (loader): attempt to start program operation, but file is not readable
13:57:23.670 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:23.672 (serialmon 30): hid, found devinst=0000000B
13:57:23.681 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :-)
13:57:23.931 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:23.937 (serialmon 30): hid, found devinst=0000000B
13:57:24.191 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:24.205 (serialmon 30): hid, found devinst=0000000B
13:57:24.451 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:24.465 (serialmon 30): hid, found devinst=0000000B
13:57:24.522 (serialmon 30): callback C124
13:57:24.524 (serialmon 30): hid, found devinst=0000000B
13:57:24.526 (serialmon 30): hid, found devinst=0000000B
13:57:24.552 (ports 2): callback C124
13:57:24.792 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:24.794 (serialmon 30): hid, found devinst=0000000B
13:57:25.055 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:25.057 (serialmon 30): hid, found devinst=0000000B
13:57:25.309 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:25.310 (serialmon 30): hid, found devinst=0000000B
13:57:25.571 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:25.573 (serialmon 30): hid, found devinst=0000000B
13:57:25.825 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:25.827 (serialmon 30): hid, found devinst=0000000B
13:57:26.094 (serialmon 30): timeout
13:57:26.096 (serialmon 30): hid, found devinst=0000000B
13:57:26.566 (serialmon 30): callback C124
13:57:26.573 (ports 2): callback C124
13:57:28.609 (serialmon 30): callback C124
13:57:28.615 (ports 2): callback C124
13:57:30.627 (serialmon 30): callback C124
13:57:30.632 (ports 2): callback C124
13:57:32.644 (serialmon 30): callback C124
13:57:32.649 (ports 2): callback C124
13:57:34.665 (serialmon 30): callback C124
13:57:34.674 (ports 2): callback C124
13:57:36.687 (serialmon 30): callback C124
13:57:36.694 (ports 2): callback C124
13:57:38.707 (serialmon 30): callback C124
13:57:38.713 (ports 2): callback C124
13:57:40.734 (serialmon 30): callback C124
13:57:40.739 (ports 2): callback C124
13:57:42.750 (serialmon 30): callback C124
13:57:42.762 (ports 2): callback C124
13:57:44.785 (serialmon 30): callback C124
13:57:44.792 (ports 2): callback C124
13:57:45.359 (loader): remote connection 2596 opened
13:57:45.359 (loader): remote cmd from 2596: "comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)"
13:57:45.363 (post_compile 31): Begin, version=1.47-beta4, high-res time
13:57:45.373 (post_compile 31): Sending command: comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)
13:57:45.375 (loader): remote cmd from 2596: "status"
13:57:45.375 (loader): file changed
13:57:45.390 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
13:57:45.406 (loader): remote cmd from 2596: "dir:T:\TEMP\arduino_build_81960\"
13:57:45.406 (loader): remote cmd from 2596: "file:Simple_Ultoa.ino.hex"
13:57:45.410 (post_compile 31): Status: 1, 0, 1, 15, 5, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
13:57:45.410 (post_compile 31): Sending command: dir:T:\TEMP\arduino_build_81960\
13:57:45.418 (post_compile 31): Sending command: file:Simple_Ultoa.ino.hex
13:57:45.430 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
13:57:45.430 (loader): remote cmd from 2596: "status"
13:57:45.451 (post_compile 31): Status: 1, 0, 1, 15, 5, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
13:57:45.451 (post_compile 31): Disconnect
13:57:45.477 (loader): remote connection 2596 closed
13:57:46.819 (serialmon 30): callback C124
13:57:46.825 (ports 2): callback C124
13:57:48.838 (serialmon 30): callback C124
13:57:48.844 (ports 2): callback C124
13:57:50.842 (serialmon 30): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
13:57:50.842 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
13:57:50.843 (serialmon 30): remove: loc=usb:0/140000/0/8/7
13:57:50.843 (serialmon 30): usb_remove: usb:0/140000/0/8/7
13:57:50.843 (ports 2): remove: loc=usb:0/140000/0/8/7
13:57:50.843 (ports 2): usb_remove: usb:0/140000/0/8/7
13:57:50.843 (ports 2): nothing new, skipping HID & Ports enum
13:57:50.843 (serialmon 30): nothing new, skipping HID & Ports enum
13:57:50.881 (serialmon 30): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:50.882 (serialmon 30): nothing new, skipping HID & Ports enum
13:57:50.882 (serialmon 30): callback C124
13:57:50.919 (ports 2): callback C124
13:57:50.921 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:50.922 (ports 2): nothing new, skipping HID & Ports enum
13:57:50.975 (loader): Device went offline
13:57:51.186 (loader): HID/win32:  vid:046D pid:C534 ver:2901
13:57:51.196 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
13:57:51.206 (loader): HID/win32:  vid:046D pid:C534 ver:2901
13:57:51.211 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
13:57:51.219 (loader): HID/win32:  vid:0764 pid:0501 ver:0001
13:57:51.230 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
13:57:51.238 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
13:57:51.238 (serialmon 30): WM_DEVICECHANGE DBT_DEVICEARRIVAL
13:57:51.240 (serialmon 30): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:51.240 (serialmon 30): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
13:57:51.240 (serialmon 30): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
13:57:51.240 (serialmon 30): found_usb_device, devinst=00000006
13:57:51.240 (serialmon 30): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=00093c64, dev=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:51.240 (serialmon 30): hiddev_from_devinst_list: iface=0
13:57:51.240 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:51.240 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
13:57:51.240 (ports 2): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
13:57:51.240 (ports 2): found_usb_device, devinst=00000028
13:57:51.240 (ports 2): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=00093c64, dev=\\?\usb#vid_16c0&pid_0478#00093c64#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
13:57:51.240 (ports 2): hiddev_from_devinst_list: iface=0
13:57:51.241 (serialmon 30): found_usb_device complete
13:57:51.241 (ports 2): found_usb_device complete
13:57:51.242 (serialmon 30): usb_add: usb:0/140000/0/8/7
13:57:51.242 (serialmon 30): ignoring partial USB device discovery (Windows XP issue?)
13:57:51.242 (ports 2): usb_add: usb:0/140000/0/8/7  [no_device] (Teensy 4-Beta2) Bootloader
13:57:51.246 (loader): HID/win32:  vid:046D pid:C534 ver:2901
13:57:51.246 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
13:57:51.257 (loader): HID/win32:  vid:046D pid:C534 ver:2901
13:57:51.301 (serialmon 30): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:51.302 (serialmon 30): update_usb_device, devinst list change, old had 1, new has 2
13:57:51.302 (serialmon 30): hiddev_from_devinst_list: iface=0
13:57:51.303 (serialmon 30): hid, found devinst=0000000B
13:57:51.304 (serialmon 30): usb_add: usb:0/140000/0/8/7
13:57:51.304 (serialmon 30): ignoring partial USB device discovery (Windows XP issue?)
13:57:51.306 (serialmon 30): hid, found devinst=0000000B
13:57:51.382 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:51.383 (ports 2): update_usb_device, devinst list change, old had 1, new has 2
13:57:51.383 (ports 2): hiddev_from_devinst_list: iface=0
13:57:51.384 (ports 2): hid, found devinst=00000029
13:57:51.384 (ports 2): hid, path=\\?\hid#vid_16c0&pid_0478#7&13065cc&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
13:57:51.384 (ports 2): hid,  opened handle
13:57:51.384 (ports 2):  devinst=00000029, location=usb:0/140000/0/8/7
13:57:51.384 (ports 2):  vid=16C0, pid=0478, ver=0004, usepage=FF9C, use=0024
13:57:51.384 (ports 2):  devpath=\\?\hid#vid_16c0&pid_0478#7&13065cc&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
13:57:51.384 (ports 2): usb_add: usb:0/140000/0/8/7  hid#vid_16c0&pid_0478 (Teensy 4-Beta2) Bootloader
13:57:51.491 (loader): Device came online, code_size = 2031616
13:57:51.501 (loader): Board is: Teensy 4-Beta2 (IMXRT1062), version 0.04
13:57:51.516 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
13:57:51.526 (loader): set background IMG_ONLINE
13:57:51.537 (serialmon 30): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:51.538 (serialmon 30): hid, found devinst=0000000B
13:57:51.541 (serialmon 30): hid, found devinst=0000000B
13:57:51.582 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
13:57:51.583 (ports 2): nothing new, skipping HID & Ports enum
13:57:51.686 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :-)
13:57:51.806 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:51.809 (serialmon 30): hid, found devinst=0000000B
13:57:52.076 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:52.089 (serialmon 30): hid, found devinst=0000000B
13:57:52.355 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:52.368 (serialmon 30): hid, found devinst=0000000B
13:57:52.624 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:52.626 (serialmon 30): hid, found devinst=0000000B
13:57:52.878 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:52.879 (serialmon 30): hid, found devinst=0000000B
13:57:52.934 (serialmon 30): callback C124
13:57:52.936 (serialmon 30): hid, found devinst=0000000B
13:57:52.938 (serialmon 30): hid, found devinst=0000000B
13:57:52.986 (ports 2): callback C124
13:57:53.195 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:53.196 (serialmon 30): hid, found devinst=0000000B
13:57:53.449 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:53.450 (serialmon 30): hid, found devinst=0000000B
13:57:53.711 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:53.713 (serialmon 30): hid, found devinst=0000000B
13:57:53.965 (serialmon 30): retry device discovery (Windows XP workaround)
13:57:53.967 (serialmon 30): hid, found devinst=0000000B
13:57:54.228 (serialmon 30): timeout
13:57:54.230 (serialmon 30): hid, found devinst=0000000B
14:05:20.722 (ports 2): callback C124
14:05:21.167 (loader): remote connection 2472 closed
14:05:22.750 (ports 2): callback C124
14:05:24.088 (loader): file changed
14:05:24.093 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
14:05:24.191 (loader): remote connection 2472 opened
14:05:24.191 (loader): remote cmd from 2472: "comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)"
14:05:24.191 (loader): remote cmd from 2472: "status"
14:05:24.191 (loader): remote cmd from 2472: "dir:T:\TEMP\arduino_build_81960\"
14:05:24.191 (loader): remote cmd from 2472: "file:Simple_Ultoa.ino.hex"
14:05:24.196 (post_compile 37): Begin, version=1.47-beta4, high-res time
14:05:24.203 (post_compile 37): Sending command: comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)
14:05:24.205 (post_compile 37): Status: 1, 0, 1, 18, 7, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
14:05:24.205 (post_compile 37): Sending command: dir:T:\TEMP\arduino_build_81960\
14:05:24.206 (post_compile 37): Sending command: file:Simple_Ultoa.ino.hex
14:05:24.206 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
14:05:24.206 (loader): remote cmd from 2472: "status"
14:05:24.216 (post_compile 37): Status: 1, 0, 1, 18, 7, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
14:05:24.216 (post_compile 37): Disconnect
14:05:24.250 (loader): remote connection 2472 closed
14:05:24.504 (post_compile 38): Begin, version=1.47-beta4, high-res time
14:05:24.507 (loader): remote connection 2472 opened
14:05:24.507 (loader): remote cmd from 2472: "comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)"
14:05:24.507 (loader): remote cmd from 2472: "status"
14:05:24.507 (loader): remote cmd from 2472: "dir:T:\TEMP\arduino_build_81960\"
14:05:24.507 (loader): remote cmd from 2472: "file:Simple_Ultoa.ino.hex"
14:05:24.510 (post_compile 38): Sending command: comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)
14:05:24.514 (post_compile 38): Status: 1, 0, 1, 18, 7, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
14:05:24.514 (post_compile 38): Sending command: dir:T:\TEMP\arduino_build_81960\
14:05:24.517 (post_compile 38): Sending command: file:Simple_Ultoa.ino.hex
14:05:24.522 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
14:05:24.522 (loader): remote cmd from 2472: "status"
14:05:24.532 (post_compile 38): Status: 1, 0, 1, 18, 7, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
14:05:24.532 (post_compile 38): Disconnect
14:05:24.549 (loader): remote connection 2472 closed
14:05:24.549 (post_compile 39): Running teensy_reboot: "T:\Ard186t4b2\hardware\teensy\..\tools\teensy_reboot.exe" teensy_reboot.exe "-board=TEENSY40" "-port=usb:0/140000/0/8/7" "-portlabel=hid#vid_16c0&pid_0478 Bootloader" "-portprotocol=Teensy"
14:05:24.551 (loader): remote connection 2472 opened
14:05:24.591 (loader): remote connection 3196 opened
14:05:24.591 (loader): remote cmd from 3196: "show:arduino_attempt_reboot"
14:05:24.594 (reboot 40): Begin, version=1.47-beta4, high-res time
14:05:24.594 (reboot 40): location = usb:0/140000/0/8/7
14:05:24.594 (reboot 40): portlabel = hid#vid_16c0&pid_0478 Bootloader
14:05:24.594 (reboot 40): portprotocol = Teensy
14:05:24.594 (reboot 40): Only location usb:0/140000/0/8/7 will be tried
14:05:24.594 (reboot 40): LoadLibrary cfgmgr32 ok
14:05:24.594 (reboot 40): LoadLibrary ntdll ok
14:05:24.597 (reboot 40): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:24.597 (reboot 40): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:24.597 (reboot 40): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
14:05:24.597 (reboot 40): found_usb_device, devinst=00000005
14:05:24.597 (reboot 40): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=0008ec52, dev=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:24.597 (reboot 40): hiddev_from_devinst_list: iface=0
14:05:24.599 (reboot 40): found_usb_device complete
14:05:24.599 (reboot 40): hid, found devinst=0000000B
14:05:24.606 (reboot 40): found Teensy Loader, version 1.47
14:05:24.606 (reboot 40): Sending command: show:arduino_attempt_reboot
14:05:24.607 (loader): got request to show arduino rebooting message
14:05:24.607 (loader): remote cmd from 3196: "comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_reboot)"
14:05:24.607 (loader): remote cmd from 3196: "status"
14:05:24.607 (loader): remote cmd from 3196: "auto:on"
14:05:24.615 (reboot 40): Sending command: comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_reboot)
14:05:24.622 (reboot 40): Status: 1, 0, 1, 18, 7, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
14:05:24.622 (reboot 40): send: auto:on
14:05:24.622 (reboot 40): Sending command: auto:on
14:05:24.623 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
14:05:24.626 (reboot 40): Disconnect
14:05:24.634 (loader): elf appears to be for Teensy 4-Beta2 (IMXRT1062) (2031616 bytes)
14:05:24.634 (loader): elf binary data matches hex file
14:05:24.634 (loader): elf file is for Teensy 4-Beta2 (IMXRT1062)
14:05:24.634 (loader): begin operation
14:05:24.670 (loader): remote connection 3196 closed
14:05:24.671 (loader): remote connection 2472 closed
14:05:24.689 (loader): flash, block=0, bs=1024, auto=1
14:05:24.695 (loader):  gauge old value = 0
14:05:24.703 (loader): flash, block=1, bs=1024, auto=1
14:05:24.802 (serialmon 41): Begin, version=1.47-beta4, high-res time
14:05:24.802 (serialmon 41): listening for location: usb:0/140000/0/8/7
14:05:24.802 (serialmon 41): LoadLibrary cfgmgr32 ok
14:05:24.802 (serialmon 41): LoadLibrary ntdll ok
14:05:24.808 (serialmon 41): callback 0024
14:05:24.809 (serialmon 41): callback 0081
14:05:24.814 (serialmon 41): callback 0083
14:05:24.817 (serialmon 41): hWnd = 5839108
14:05:24.817 (serialmon 41): loop stdin, ready=2097151
14:05:24.820 (serialmon 41): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:24.820 (serialmon 41): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:24.820 (serialmon 41): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
14:05:24.820 (serialmon 41): found_usb_device, devinst=00000005
14:05:24.820 (serialmon 41): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=0008ec52, dev=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:24.820 (serialmon 41): hiddev_from_devinst_list: iface=0
14:05:24.821 (serialmon 41): found_usb_device complete
14:05:24.822 (serialmon 41): hid, found devinst=0000000B
14:05:24.822 (serialmon 41): usb_add: usb:0/140000/0/8/7
14:05:24.822 (serialmon 41): ignoring partial USB device discovery (Windows XP issue?)
14:05:24.908 (loader):  gauge old value = 1
14:05:24.908 (loader): remote connection 2472 opened
14:05:24.933 (loader): flash, block=2, bs=1024, auto=1
14:05:24.952 (loader):  gauge old value = 2
14:05:24.952 (loader): flash, block=3, bs=1024, auto=1
14:05:24.959 (ports 2): callback C124
14:05:24.967 (loader):  gauge old value = 3
14:05:24.967 (loader): flash, block=4, bs=1024, auto=1
14:05:24.990 (loader):  gauge old value = 4
14:05:25.000 (loader): flash, block=5, bs=1024, auto=1
14:05:25.016 (loader):  gauge old value = 5
14:05:25.016 (loader): flash, block=6, bs=1024, auto=1
14:05:25.036 (loader):  gauge old value = 6
14:05:25.038 (loader): flash, block=7, bs=1024, auto=1
14:05:25.038 (loader):  gauge old value = 7
14:05:25.050 (loader): flash, block=8, bs=1024, auto=1
14:05:25.050 (loader):  gauge old value = 8
14:05:25.067 (loader): flash, block=9, bs=1024, auto=1
14:05:25.067 (loader):  gauge old value = 9
14:05:25.082 (loader): flash, block=10, bs=1024, auto=1
14:05:25.083 (loader):  gauge old value = 10
14:05:25.092 (loader): flash, block=11, bs=1024, auto=1
14:05:25.100 (loader):  gauge old value = 11
14:05:25.100 (loader): flash, block=12, bs=1024, auto=1
14:05:25.117 (loader):  gauge old value = 12
14:05:25.117 (loader): flash, block=13, bs=1024, auto=1
14:05:25.132 (loader):  gauge old value = 13
14:05:25.132 (loader): flash, block=14, bs=1024, auto=1
14:05:25.150 (loader):  gauge old value = 14
14:05:25.165 (loader): flash, block=15, bs=1024, auto=1
14:05:25.181 (loader):  gauge old value = 15
14:05:25.181 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:25.183 (serialmon 41): hid, found devinst=0000000B
14:05:25.234 (loader): flash, block=16, bs=1024, auto=1
14:05:25.234 (loader):  gauge old value = 16
14:05:25.251 (loader): flash, block=17, bs=1024, auto=1
14:05:25.266 (loader):  gauge old value = 17
14:05:25.266 (loader): sending reboot
14:05:25.292 (loader): begin wait_until_offline
14:05:25.301 (loader): offline, waited 0
14:05:25.301 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:25.302 (ports 2): remove: loc=usb:0/140000/0/8/7
14:05:25.302 (ports 2): usb_remove: usb:0/140000/0/8/7
14:05:25.302 (ports 2): nothing new, skipping HID & Ports enum
14:05:25.302 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:25.303 (serialmon 41): remove: loc=usb:0/140000/0/8/7
14:05:25.303 (serialmon 41): usb_remove: usb:0/140000/0/8/7
14:05:25.303 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:25.318 (loader): end operation, total time = 0.684 seconds
14:05:25.318 (loader): set background IMG_REBOOT_OK
14:05:25.334 (loader): redraw timer set, image 14 to show for 1200 ms
14:05:25.364 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:25.364 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:25.365 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:25.452 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:25.460 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:25.461 (ports 2): nothing new, skipping HID & Ports enum
14:05:25.467 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:25.471 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:25.491 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:25.506 (loader): HID/win32:  vid:0764 pid:0501 ver:0001
14:05:25.521 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:25.534 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:25.541 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:25.556 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:25.615 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:25.615 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:25.640 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:25.641 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:25.642 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#5847860#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:25.642 (ports 2): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:25.642 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
14:05:25.642 (ports 2): found_usb_device, devinst=00000002
14:05:25.642 (ports 2): add: loc=usb:0/140000/0/8/7, class=Ports, vid=16C0, pid=0483, ver=0279, serial=5847860, dev=\\?\usb#vid_16c0&pid_0483#5847860#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:25.642 (ports 2):   comport_from_devinst_list attempt
14:05:25.642 (ports 2):   found Ports in classguid_list at index=0
14:05:25.642 (ports 2):   port COM29 found from devnode
14:05:25.642 (ports 2): found_usb_device complete
14:05:25.642 (serialmon 41): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#5847860#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:25.642 (serialmon 41): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:25.642 (serialmon 41): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
14:05:25.642 (serialmon 41): found_usb_device, devinst=0000001e
14:05:25.642 (serialmon 41): add: loc=usb:0/140000/0/8/7, class=Ports, vid=16C0, pid=0483, ver=0279, serial=5847860, dev=\\?\usb#vid_16c0&pid_0483#5847860#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:25.642 (serialmon 41):   comport_from_devinst_list attempt
14:05:25.642 (serialmon 41):   found Ports in classguid_list at index=0
14:05:25.643 (serialmon 41):   port COM29 found from devnode
14:05:25.643 (serialmon 41): found_usb_device complete
14:05:25.643 (ports 2): usb_add: usb:0/140000/0/8/7  COM29 (Teensy 4-Beta2) Serial
14:05:25.644 (serialmon 41): usb_add: usb:0/140000/0/8/7
14:05:25.644 (serialmon 41): translate "COM29" -> "\\.\COM29"
14:05:25.829 (serialmon 41): GetDefaultCommConfig success
14:05:25.988 (serialmon 41): SetDefaultCommConfig success
14:05:25.988 (serialmon 41): Opened \\.\COM29 Serial
14:05:25.991 (ports 2): callback 001A
14:05:25.992 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:25.993 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:25.997 (serialmon 41): callback 001A
14:05:26.001 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:26.537 (loader): redraw, image 9
14:05:26.647 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:26.650 (ports 2): nothing new, skipping HID & Ports enum
14:05:26.650 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:26.655 (ports 2): nothing new, skipping HID & Ports enum
14:05:26.853 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:26.860 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:26.912 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:26.920 (ports 2): nothing new, skipping HID & Ports enum
14:05:27.070 (serialmon 41): callback C124
14:05:27.094 (ports 2): callback C124
14:05:29.115 (serialmon 41): callback C124
14:05:29.126 (ports 2): callback C124
14:05:31.149 (serialmon 41): callback C124
14:05:31.155 (ports 2): callback C124
14:05:32.842 (loader): file changed
14:05:33.190 (serialmon 41): callback C124
14:05:33.197 (ports 2): callback C124
14:05:35.235 (serialmon 41): callback C124
14:05:35.240 (ports 2): callback C124
14:05:37.255 (serialmon 41): callback C124
14:05:37.263 (ports 2): callback C124
14:05:37.731 (serialmon 41): teensy read ov error
14:05:37.731 (serialmon 41): teensy read error
14:05:37.733 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:37.733 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:37.734 (serialmon 41): remove: loc=usb:0/140000/0/8/7
14:05:37.734 (serialmon 41): usb_remove: usb:0/140000/0/8/7
14:05:37.734 (serialmon 41): Disconnect \\.\COM29
14:05:37.734 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:37.734 (ports 2): remove: loc=usb:0/140000/0/8/7
14:05:37.734 (ports 2): usb_remove: usb:0/140000/0/8/7
14:05:37.734 (ports 2): nothing new, skipping HID & Ports enum
14:05:37.766 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:37.767 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:37.767 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:37.768 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:37.868 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:37.868 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:37.869 (ports 2): nothing new, skipping HID & Ports enum
14:05:38.111 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:38.111 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:38.112 (serialmon 41): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:38.112 (serialmon 41): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:38.112 (serialmon 41): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
14:05:38.112 (serialmon 41): found_usb_device, devinst=00000005
14:05:38.112 (serialmon 41): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=0008ec52, dev=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:38.112 (serialmon 41): hiddev_from_devinst_list: iface=0
14:05:38.112 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:38.112 (ports 2): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:38.112 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
14:05:38.112 (ports 2): found_usb_device, devinst=00000021
14:05:38.112 (ports 2): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=0008ec52, dev=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:38.113 (ports 2): hiddev_from_devinst_list: iface=0
14:05:38.113 (serialmon 41): found_usb_device complete
14:05:38.114 (ports 2): found_usb_device complete
14:05:38.115 (serialmon 41): usb_add: usb:0/140000/0/8/7
14:05:38.115 (serialmon 41): ignoring partial USB device discovery (Windows XP issue?)
14:05:38.115 (ports 2): usb_add: usb:0/140000/0/8/7  [no_device] (Teensy 4-Beta2) Bootloader
14:05:38.127 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:38.128 (serialmon 41): update_usb_device, devinst list change, old had 1, new has 2
14:05:38.128 (serialmon 41): hiddev_from_devinst_list: iface=0
14:05:38.129 (serialmon 41): hid, found devinst=0000000B
14:05:38.130 (serialmon 41): usb_add: usb:0/140000/0/8/7
14:05:38.130 (serialmon 41): ignoring partial USB device discovery (Windows XP issue?)
14:05:38.131 (serialmon 41): hid, found devinst=0000000B
14:05:38.335 (loader): Device came online, code_size = 2031616
14:05:38.340 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:38.340 (ports 2): update_usb_device, devinst list change, old had 1, new has 2
14:05:38.340 (ports 2): hiddev_from_devinst_list: iface=0
14:05:38.342 (ports 2): hid, found devinst=00000022
14:05:38.342 (ports 2): hid, path=\\?\hid#vid_16c0&pid_0478#7&5699f46&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
14:05:38.342 (ports 2): hid,  opened handle
14:05:38.342 (ports 2):  devinst=00000022, location=usb:0/140000/0/8/7
14:05:38.342 (ports 2):  vid=16C0, pid=0478, ver=0004, usepage=FF9C, use=0024
14:05:38.342 (ports 2):  devpath=\\?\hid#vid_16c0&pid_0478#7&5699f46&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
14:05:38.342 (ports 2): usb_add: usb:0/140000/0/8/7  hid#vid_16c0&pid_0478 (Teensy 4-Beta2) Bootloader
14:05:38.345 (loader): Board is: Teensy 4-Beta2 (IMXRT1062), version 0.04
14:05:38.355 (loader): set background IMG_ONLINE
14:05:38.365 (loader): attempt to start program operation, but file is not readable
14:05:38.375 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:38.377 (serialmon 41): hid, found devinst=0000000B
14:05:38.409 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:38.410 (serialmon 41): hid, found devinst=0000000B
14:05:38.412 (serialmon 41): hid, found devinst=0000000B
14:05:38.501 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:38.502 (ports 2): nothing new, skipping HID & Ports enum
14:05:38.595 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :-)
14:05:38.675 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:38.677 (serialmon 41): hid, found devinst=0000000B
14:05:38.935 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:38.950 (serialmon 41): hid, found devinst=0000000B
14:05:39.215 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:39.227 (serialmon 41): hid, found devinst=0000000B
14:05:39.342 (serialmon 41): callback C124
14:05:39.343 (serialmon 41): hid, found devinst=0000000B
14:05:39.345 (serialmon 41): hid, found devinst=0000000B
14:05:39.392 (ports 2): callback C124
14:05:39.609 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:39.610 (serialmon 41): hid, found devinst=0000000B
14:05:39.863 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:39.865 (serialmon 41): hid, found devinst=0000000B
14:05:40.113 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:40.115 (serialmon 41): hid, found devinst=0000000B
14:05:40.367 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:40.369 (serialmon 41): hid, found devinst=0000000B
14:05:40.637 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:40.639 (serialmon 41): hid, found devinst=0000000B
14:05:40.900 (serialmon 41): timeout
14:05:40.902 (serialmon 41): hid, found devinst=0000000B
14:05:41.407 (serialmon 41): callback C124
14:05:41.414 (ports 2): callback C124
14:05:43.430 (serialmon 41): callback C124
14:05:43.441 (ports 2): callback C124
14:05:45.453 (serialmon 41): callback C124
14:05:45.459 (ports 2): callback C124
14:05:47.475 (serialmon 41): callback C124
14:05:47.480 (ports 2): callback C124
14:05:49.493 (serialmon 41): callback C124
14:05:49.502 (ports 2): callback C124
14:05:50.533 (loader): remote connection 4028 opened
14:05:50.533 (loader): remote cmd from 4028: "comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)"
14:05:50.536 (post_compile 42): Begin, version=1.47-beta4, high-res time
14:05:50.548 (post_compile 42): Sending command: comment: Teensyduino 1.47-beta4 - WINDOWS (teensy_post_compile)
14:05:50.551 (loader): remote cmd from 4028: "status"
14:05:50.551 (loader): file changed
14:05:50.566 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
14:05:50.583 (loader): remote cmd from 4028: "dir:T:\TEMP\arduino_build_81960\"
14:05:50.589 (post_compile 42): Status: 1, 0, 1, 19, 7, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
14:05:50.589 (post_compile 42): Sending command: dir:T:\TEMP\arduino_build_81960\
14:05:50.599 (post_compile 42): Sending command: file:Simple_Ultoa.ino.hex
14:05:50.599 (loader): remote cmd from 4028: "file:Simple_Ultoa.ino.hex"
14:05:50.599 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
14:05:50.616 (loader): remote cmd from 4028: "status"
14:05:50.632 (post_compile 42): Status: 1, 0, 1, 19, 7, 0, T:\TEMP\arduino_build_81960\, Simple_Ultoa.ino.hex
14:05:50.632 (post_compile 42): Disconnect
14:05:50.657 (loader): remote connection 4028 closed
14:05:51.508 (serialmon 41): callback C124
14:05:51.514 (ports 2): callback C124
14:05:53.527 (serialmon 41): callback C124
14:05:53.534 (ports 2): callback C124
14:05:53.722 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:53.722 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
14:05:53.723 (ports 2): remove: loc=usb:0/140000/0/8/7
14:05:53.723 (ports 2): usb_remove: usb:0/140000/0/8/7
14:05:53.723 (ports 2): nothing new, skipping HID & Ports enum
14:05:53.723 (serialmon 41): remove: loc=usb:0/140000/0/8/7
14:05:53.723 (serialmon 41): usb_remove: usb:0/140000/0/8/7
14:05:53.723 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:53.802 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:53.802 (serialmon 41): nothing new, skipping HID & Ports enum
14:05:53.835 (loader): Device went offline
14:05:53.848 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:53.849 (ports 2): nothing new, skipping HID & Ports enum
14:05:54.095 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:54.095 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:54.110 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:54.120 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:54.134 (serialmon 41): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:54.134 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
14:05:54.135 (loader): HID/win32:  vid:0764 pid:0501 ver:0001
14:05:54.135 (serialmon 41): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:54.135 (serialmon 41): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:54.135 (serialmon 41): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
14:05:54.135 (serialmon 41): found_usb_device, devinst=00000005
14:05:54.135 (serialmon 41): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=0008ec52, dev=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:54.135 (serialmon 41): hiddev_from_devinst_list: iface=0
14:05:54.136 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:54.136 (ports 2): found_usb_device, loc=usb:0/140000/0/8/7    Port_#0007.Hub_#0006
14:05:54.136 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0004
14:05:54.136 (ports 2): found_usb_device, devinst=00000021
14:05:54.136 (ports 2): add: loc=usb:0/140000/0/8/7, class=HID, vid=16C0, pid=0478, ver=0004, serial=0008ec52, dev=\\?\usb#vid_16c0&pid_0478#0008ec52#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
14:05:54.136 (ports 2): hiddev_from_devinst_list: iface=0
14:05:54.137 (serialmon 41): found_usb_device complete
14:05:54.137 (ports 2): found_usb_device complete
14:05:54.138 (serialmon 41): usb_add: usb:0/140000/0/8/7
14:05:54.138 (serialmon 41): ignoring partial USB device discovery (Windows XP issue?)
14:05:54.138 (ports 2): usb_add: usb:0/140000/0/8/7  [no_device] (Teensy 4-Beta2) Bootloader
14:05:54.147 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:54.155 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:54.165 (loader): HID/win32:  vid:1B80 pid:B406 ver:0100
14:05:54.170 (loader): HID/win32:  vid:046D pid:C534 ver:2901
14:05:54.216 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:54.216 (serialmon 41): update_usb_device, devinst list change, old had 1, new has 2
14:05:54.216 (serialmon 41): hiddev_from_devinst_list: iface=0
14:05:54.218 (serialmon 41): hid, found devinst=0000000B
14:05:54.218 (serialmon 41): usb_add: usb:0/140000/0/8/7
14:05:54.218 (serialmon 41): ignoring partial USB device discovery (Windows XP issue?)
14:05:54.219 (serialmon 41): hid, found devinst=0000000B
14:05:54.307 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:54.308 (ports 2): update_usb_device, devinst list change, old had 1, new has 2
14:05:54.308 (ports 2): hiddev_from_devinst_list: iface=0
14:05:54.309 (ports 2): hid, found devinst=00000022
14:05:54.309 (ports 2): hid, path=\\?\hid#vid_16c0&pid_0478#7&5699f46&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
14:05:54.309 (ports 2): hid,  opened handle
14:05:54.309 (ports 2):  devinst=00000022, location=usb:0/140000/0/8/7
14:05:54.309 (ports 2):  vid=16C0, pid=0478, ver=0004, usepage=FF9C, use=0024
14:05:54.309 (ports 2):  devpath=\\?\hid#vid_16c0&pid_0478#7&5699f46&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
14:05:54.309 (ports 2): usb_add: usb:0/140000/0/8/7  hid#vid_16c0&pid_0478 (Teensy 4-Beta2) Bootloader
14:05:54.415 (loader): Device came online, code_size = 2031616
14:05:54.419 (serialmon 41): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:54.421 (serialmon 41): hid, found devinst=0000000B
14:05:54.422 (serialmon 41): hid, found devinst=0000000B
14:05:54.431 (loader): Board is: Teensy 4-Beta2 (IMXRT1062), version 0.04
14:05:54.435 (loader): File "Simple_Ultoa.ino.hex". 17572 bytes, 1% used
14:05:54.445 (loader): set background IMG_ONLINE
14:05:54.504 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:05:54.505 (ports 2): nothing new, skipping HID & Ports enum
14:05:54.585 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :-)
14:05:54.665 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:54.668 (serialmon 41): hid, found devinst=0000000B
14:05:54.926 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:54.941 (serialmon 41): hid, found devinst=0000000B
14:05:55.195 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:55.211 (serialmon 41): hid, found devinst=0000000B
14:05:55.465 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:55.467 (serialmon 41): hid, found devinst=0000000B
14:05:55.588 (serialmon 41): callback C124
14:05:55.589 (serialmon 41): hid, found devinst=0000000B
14:05:55.591 (serialmon 41): hid, found devinst=0000000B
14:05:55.632 (ports 2): callback C124
14:05:55.835 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:55.837 (serialmon 41): hid, found devinst=0000000B
14:05:56.098 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:56.100 (serialmon 41): hid, found devinst=0000000B
14:05:56.352 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:56.354 (serialmon 41): hid, found devinst=0000000B
14:05:56.615 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:56.617 (serialmon 41): hid, found devinst=0000000B
14:05:56.869 (serialmon 41): retry device discovery (Windows XP workaround)
14:05:56.871 (serialmon 41): hid, found devinst=0000000B
14:05:57.138 (serialmon 41): timeout
14:05:57.140 (serialmon 41): hid, found devinst=0000000B
14:05:57.655 (ports 2): callback C124
14:05:59.675 (ports 2): callback C124

Step SIX: Change Optimize to FASTEST + Pure Code and get this alternate 'Verify' build fail with same code:
Code:
"T:\\Ard186t4b2\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -c -O3 -mpure-code -D__PURE_CODE__ -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\Ard186t4b2\\hardware\\teensy\\avr\\cores\\teensy4" "T:\\Ard186t4b2\\hardware\\teensy\\avr\\cores\\teensy4\\usb_desc.c" -o "T:\\TEMP\\arduino_build_81960\\core\\usb_desc.c.o"
T:\Ard186t4b2\hardware\teensy\avr\cores\teensy4\pwm.c: In function 'flexpwmFrequency':
T:\Ard186t4b2\hardware\teensy\avr\cores\teensy4\pwm.c:163:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 32 27 28 2 (set (reg:SI 31 s15 [orig:114 D.5878 ] [114])
        (mem/v/c:SI (reg/f:SI 2 r2 [175]) [4 F_BUS_ACTUAL+0 S4 A32])) T:\Ard186t4b2\hardware\teensy\avr\cores\teensy4\pwm.c:143 615 {*thumb2_movsi_vfp}
     (nil))

T:\Ard186t4b2\hardware\teensy\avr\cores\teensy4\pwm.c:163:1: internal compiler error: in extract_constrain_insn, at recog.c:2246
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Error compiling for board Teensy 4-Beta2.
 
@defragster: Tried with a newer compiler?
Anyway, we have to live with the old 5.4, so we should try to find a workaround.
 
@defragster: Tried with a newer compiler?
Anyway, we have to live with the old 5.4, so we should try to find a workaround.

No, did the one quick check with gDrive ARM6 - noted it failed to find the exe to compile - mjs513 suggested yet another hack just replacing the ARM not adding ARM6 path - seemed since toolchain wasn't likely to be changing at this late date - that it wasn't worth messing build up.

So as you said either we need to get workarounds done - or find enough things broken to justify making a toolchain update.

Of course these possibly point to issues with segmentation or other 1062 mem .ld choices - which means they could follow the toolchain - or perhaps resolve out in an unplanned way.
 
Just ordered two, too.. they'll come end of august.
So far I have not had much luck with these types of displays that do not have a CS pin.

What I have read up on the web is some/all of them may require +5v to their VIN (looks like a VR on them).

Some had luck editing Adafruit_st7735/89 library, although it looks like some of the stuff may be built in now...

But the instructions were to set CS to -1 so that it was not used... I tried instead just using some random CS pin... Then instead of SPI_MODE0, some say for these boards you need SPI_MODE2 and others say SPI_MODE3. I was experimenting with that with my previous boards, but I think they are all DOA.

The Init code on Adafruit library allowed you to pass in a SPI_MODE to the ST7789::init method. So my current version allows it as well and defaults to SPI_MODE0.
But in theory you should be able to do: tft.init(240,240, SPI_MODE3);

And or SPI MODE 2... But non of them worked for me...

When I tried the last one I got from EBAY - when I tried starting it up, it almost looked like a tear in the display when it was powered up...

I have two other ST7789 displays: One from Adafruit, which arrived yesterday... Have not tried it yet.
And one from Amazon (https://smile.amazon.com/gp/product/B07MH93747/) which has CS pin and works.
 
Hi Kurt,

I modified now your graphicstest (attached to this post).
Apart form the cache-issue (which is not really an issue, because we know how to solve it!), it stops/hangs:
Code:
ILI9341 Test!
After TFT Begin
13
Screen fill              1171
Text                     422
Lines
I've seen this in my own program, too.

Thanks, I will take a look and hopefully figure out what is happening.
 
So far I have not had much luck with these types of displays that do not have a CS pin.

What I have read up on the web is some/all of them may require +5v to their VIN (looks like a VR on them).

Some had luck editing Adafruit_st7735/89 library, although it looks like some of the stuff may be built in now...

But the instructions were to set CS to -1 so that it was not used... I tried instead just using some random CS pin... Then instead of SPI_MODE0, some say for these boards you need SPI_MODE2 and others say SPI_MODE3. I was experimenting with that with my previous boards, but I think they are all DOA.

The Init code on Adafruit library allowed you to pass in a SPI_MODE to the ST7789::init method. So my current version allows it as well and defaults to SPI_MODE0.
But in theory you should be able to do: tft.init(240,240, SPI_MODE3);

And or SPI MODE 2... But non of them worked for me...

When I tried the last one I got from EBAY - when I tried starting it up, it almost looked like a tear in the display when it was powered up...

I have two other ST7789 displays: One from Adafruit, which arrived yesterday... Have not tried it yet.
And one from Amazon (https://smile.amazon.com/gp/product/B07MH93747/) which has CS pin and works.

I may be trying these st7789's on ESP32 - looking that way this Adafruit FORK has this line:
/Arduino-ST7789-Library/blob/master/examples/graphicstest/ESP32_Watch_graphicstest.ino#L35
> noted as :: This is a library for ESP8266 and the ST7789 IPS SPI display.
//Arduino_ST7789 tft = Arduino_ST7789(TFT_DC, TFT_RST); //for display without CS pin

I wonder if they have captured any of the machinations needed to operate like the KeDei?
 
@defragster -
For what it is worth, this is the same constructor as if you, did: /Arduino_ST7789 tft = Arduino_ST7789(TFT_DC, TFT_RST, -1);

As -1 is default value in this constructor...

And then it leads to an interesting bug:
Code:
 pinMode(_dc, OUTPUT);
  if(_cs) {
	  pinMode(_cs, OUTPUT);
  }

#if defined(USE_FAST_IO)
  dcport    = portOutputRegister(digitalPinToPort(_dc));
  dcpinmask = digitalPinToBitMask(_dc);
  if(_cs) {
	csport    = portOutputRegister(digitalPinToPort(_cs));
	cspinmask = digitalPinToBitMask(_cs);
  }
That is no CS is set to int8_t -1... But they test for 0 to say don't do CS, where 0 is a valid IO pin...
And it looks like they default to SPI_MODE2: mySPISettings = SPISettings(24000000, MSBFIRST, SPI_MODE2);
 
@defragster -
For what it is worth, this is the same constructor as if you, did: /Arduino_ST7789 tft = Arduino_ST7789(TFT_DC, TFT_RST, -1);

As -1 is default value in this constructor...

And then it leads to an interesting bug:


That is no CS is set to int8_t -1... But they test for 0 to say don't do CS, where 0 is a valid IO pin...
And it looks like they default to SPI_MODE2: mySPISettings = SPISettings(24000000, MSBFIRST, SPI_MODE2);

Indeed as noted - suggests they put in the comment but may not have tried the code much ? As they also have this for _LOW and _HIGH:
Code:
inline void Arduino_ST7789::CS_LOW(void) {
	if(_cs) {

though maybe other elements of that code might be useful versus the LA decode you and mjs513 have been doing for KeDei and rPi hacking:
static const uint8_t PROGMEM
cmd_240x240[] = { // Initialization commands for 7789 screens

But maybe that is in other sources and working.

problem in that code could be, without CS pin, that bit in the CMD word as needed (?) - based on quick reading of KeDei comments - to get software CMD bit in controller to activate the device? And then on common bus it could only work for one display
 
Nice price is why I ordered a pair - only to have KurtE note the missing CS pin - so that needs resolved. They did it on the rPi KeDei 480x320 display as it seems to work.

Well it might be possible to solder in a CS pin, since the 12 pin connector looks like it has wire connectors to the pins and resistors/capacitors.

But I wonder for multiple displays whether using a transistor between SCLK and MISO and the pins would allow turning one off and one.
 
Hi Kurt,

I modified now your graphicstest (attached to this post).
Apart form the cache-issue (which is not really an issue, because we know how to solve it!), it stops/hangs:
Code:
ILI9341 Test!
After TFT Begin
13
Screen fill              1171
Text                     422
Lines
I've seen this in my own program, too.
Fixed - Bug in the drawLine function that was not detecting we were in frame buffer mode and it was starting an SPI transaction and at end was sending NULL char, plus ending transaction.
Which in the case of continuous updates screws things up.

Pushed up change to github
 
@defragster -
For what it is worth, this is the same constructor as if you, did: /Arduino_ST7789 tft = Arduino_ST7789(TFT_DC, TFT_RST, -1);

As -1 is default value in this constructor...

And then it leads to an interesting bug:
Code:
 pinMode(_dc, OUTPUT);
  if(_cs) {
	  pinMode(_cs, OUTPUT);
  }

#if defined(USE_FAST_IO)
  dcport    = portOutputRegister(digitalPinToPort(_dc));
  dcpinmask = digitalPinToBitMask(_dc);
  if(_cs) {
	csport    = portOutputRegister(digitalPinToPort(_cs));
	cspinmask = digitalPinToBitMask(_cs);
  }
That is no CS is set to int8_t -1... But they test for 0 to say don't do CS, where 0 is a valid IO pin...
And it looks like they default to SPI_MODE2: mySPISettings = SPISettings(24000000, MSBFIRST, SPI_MODE2);

@KurtE - @MichaelMeissner - @defragster
Ok - wasn't planning on this but you caught me at a weak moment. So for $5 each I went ahead and ordered a pair. I took a quick look and found this that looks like its for the same display: https://github.com/devbis/st7789_mpy
 
FreqCount - FreqMeasure Libs

Resolved the issue I think I was having - I put QT3 on one T4 and ran lib examples on the other teensy. That seemed to work better. But.... Looks like I can get a max of 10Mhz with FreqCount and 5Mhz with FreqMeasure. Seems funny.
 
FreqCount - FreqMeasure Libs

Resolved the issue I think I was having - I put QT3 on one T4 and ran lib examples on the other teensy. That seemed to work better. But.... Looks like I can get a max of 10Mhz with FreqCount and 5Mhz with FreqMeasure. Seems funny.

Hmm, maybe you are lucky to get that. On the T4 the GPT is clocked at 24mhz, and ref 51.3.1 says "input frequency should be less than 1/4 of frequency of the peripheral clock (ipg_clk)". Now i do get my peripheral and ipg_clk confused... You could change source clock for GPT to 150mhz, but that changes source clock for PIT (and breaks interval timer etc.). ? Or since we're using external clock for GPT in this case, maybe the 24mhz doesn't apply ??
 
Last edited:
@manitou

Or since we're using external clock for GPT in this case, maybe the 24mhz doesn't apply ??
I don't think that applies. Looking at the GPT clock figure in the GPT chapter the Input Clock is selectable - 24Mhz or Input Clock. Just don't know what the reason cant get more.
 
QTIMER INTERRUPTS from COMPARATORS

@TelephoneBill - Been using recent QTimer example - is there an example like that showing the IE bits as you have found them to work?
@defragster - This three phase example illustrates the point. It is derived from my previous "alternating compare" example, which is why Compare1 and Compare2 are both being used.

I have not set Bit 14 (TCFIE) in SCTRL (page 3130), but have used Bit 7 (TCF2EN) in CSCTRL (page 3133). The ISR is called three times during one 100KHz cycle when each phase reaches its Compare2 value. I'm only needing to clear CSCTRL flags.

Looks to me as if the QTimer interrupts (when enabled and due) are or'ed together before sending to the interrupt mechanism?

QT3ThreePhase01.jpg

Code:
//TestT4008 - QTIMER TEST PROGRAM for T4
//======================================
//Author: TelephoneBill
//Date: 22 JUL 2019

//NOTES: Using QT3 as timer. Timer0, Timer1, Timer2 arranged to give a three phase output.

//definitions
bool PrintISRTicksOn;
byte Byte1;
volatile uint32_t ISRTicks = 0;


//SETUP
//=====
void setup() {
  //initialise general hardware
  Serial.begin(115200);                 //setup serial port
  pinMode(13, OUTPUT);                  //pin 13 as digital output
  FlashLED(4);                          //confidence boost on startup
  
  //enable clocks for QTIMER3
  CCM_CCGR6 |= 0xC0000000;              //enable clocks to CG15 of CGR6 for QT3

  //configure QTIMER3 Timer0 for 1st phase
  TMR3_CTRL0 = 0b0000000000000000;      //stop all functions of timer 
  TMR3_SCTRL0 = 0b0000000000000001;     //b0=1(OFLAG to Ext Pin)
  TMR3_CNTR0 = 750-1;                   //phase1 (6.7nS per clk)
  TMR3_LOAD0 = 0;
  TMR3_COMP10 = 750-1;
  TMR3_CMPLD10 = 750-1;
  TMR3_COMP20 = 750-1;
  TMR3_CMPLD20 = 750-1;
  TMR3_CSCTRL0 = 0b0000000010001001;    //b7=1(CMP2 interrupt enabled), b32=10(preload CMP2 from CMPLD2),b10=01(preload CMP1 from CMPLD1)
  
  //configure QTIMER3 Timer1 for 2nd phase
  TMR3_CTRL1 = 0b0000000000000000;      //stop all functions of timer 
  TMR3_SCTRL1 = 0b0000000000000001;     //b0=1(OFLAG to Ext Pin)
  TMR3_CNTR1 = 250-1;                   //phase2 - lags phase1 by 500 clks (6.7nS per clk)
  TMR3_LOAD1 = 0;
  TMR3_COMP11 = 750-1;
  TMR3_CMPLD11 = 750-1;
  TMR3_COMP21 = 750-1;
  TMR3_CMPLD21 = 750-1;
  TMR3_CSCTRL1 = 0b0000000010001001;    //b7=1(CMP2 interrupt enabled), b32=10(preload CMP2 from CMPLD2),b10=01(preload CMP1 from CMPLD1)
  
  //configure QTIMER3 Timer2 for 3rd phase
  TMR3_CTRL2 = 0b0000000000000000;      //stop all functions of timer 
  TMR3_SCTRL2 = 0b0000000000000001;     //b0=1(OFLAG to Ext Pin)
  TMR3_CNTR2 = -250-1;                  //phase3  - leads phase1 by 500 clks(6.7nS per clk)
  TMR3_LOAD2 = 0;
  TMR3_COMP12 = 750-1;
  TMR3_CMPLD12 = 750-1;
  TMR3_COMP22 = 750-1;
  TMR3_CMPLD22 = 750-1;
  TMR3_CSCTRL2 = 0b0000000010001001;    //b7=1(CMP2 interrupt enabled), b32=10(preload CMP2 from CMPLD2),b10=01(preload CMP1 from CMPLD1)

  //configure Teensy pin Compare outputs
  IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_00 = 1;      // QT3 Timer0 is now on pin 19
  IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_01 = 1;      // QT3 Timer1 is now on pin 18
  IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_02 = 1;      // QT3 Timer2 is now on pin 14

  //enable QT3 interrupt within NVIC table
  attachInterruptVector(IRQ_QTIMER3, QT3_isr);  //declare which routine performs the ISR function
  NVIC_ENABLE_IRQ(IRQ_QTIMER3);

  //start the timers
  TMR3_CTRL0 = 0b0011000000100100;      //CM=001,PCS=1000,LENGTH=1,OUTMODE=100
  TMR3_CTRL1 = 0b0011000000100100;      //as above
  TMR3_CTRL2 = 0b0011000000100100;      //as above
}


//ISR ROUTINE FOR QT3
//====================
//FASTRUN puts this code into RAM
FASTRUN void QT3_isr(void) {
  //reset any interrupt flags
  TMR3_CSCTRL0 &= ~(TMR_CSCTRL_TCF1|TMR_CSCTRL_TCF2);
  TMR3_CSCTRL1 &= ~(TMR_CSCTRL_TCF1|TMR_CSCTRL_TCF2);
  TMR3_CSCTRL2 &= ~(TMR_CSCTRL_TCF1|TMR_CSCTRL_TCF2);
  ISRTicks++;
  asm volatile("dsb");                  //ensure memory synch
}


//MAIN LOOP
//=========
void loop() {
  //call KeyInput() routine
  KeyInput();
  if ((ISRTicks%300000)==0) {   //ISR fires 3 times 100,000KHz = 300,000 times/sec
    digitalWriteFast(13, 1);
    delay(10);
    digitalWriteFast(13, 0);
    if (PrintISRTicksOn) {
      Serial.print("ISRTicks = "); Serial.println(ISRTicks);    
    }
  }
}

//SUBROUTINES
//===========
//Flash LED routine
void FlashLED(int m) {
  for (int n=0;n<m;n++) {
    digitalWriteFast(13, 1);          //set pin 13 high
    delay(100);
    digitalWriteFast(13, 0);          //set pin 13 low
    delay(100);
  }
}

//KeyInput routine
void KeyInput() {
  //process any keystrokes available
  if (Serial.available()>0) {
    //read the incoming byte
    Byte1 = Serial.read();
    if (Byte1>0x20) {
      switch (Byte1) {
      case 'T':  //print the ISRTicks value
        //task goes here...
        PrintISRTicksOn = !PrintISRTicksOn; //toggle print status
        break;
      }
    }
  }
}
 
@manitou

I don't think that applies. Looking at the GPT clock figure in the GPT chapter the Input Clock is selectable - 24Mhz or Input Clock. Just don't know what the reason cant get more.

Well, the proof may be in the pudding -- since it doesn't want to count above 10mhz.

So I changed the test sketch to not use the interval timer (spin on micros() for a second), and before init'ing GPT2 clock, changed source clock to 150mhz
CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // turn off 24mhz mode
and sketch counted properly for PWM running at 15 mhz (which wasn't working in 24mhz mode).
Works @30mhz, and when i PWM @40mhz, it reports 37.5mhz, and 50 MHz PWM reports 50 mhz.

modified sketch
Code:
// GPT2 counter like FreqCount
// external pin is 14 GPIO_AD_B1_02 ALT8  (Frontside - A0) Serial3 Tx
// test with  PWM pin 11 jumpered to 14

// FreqCount API
static inline void counter_init(void)
{
  CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // turn off 24mhz mode
  CCM_CCGR0 |= CCM_CCGR0_GPT2_BUS(CCM_CCGR_ON) ;  // enable GPT1 module
  //CCM_CCGR0 |= CCM_CCGR0_GPT2_SERIAL(CCM_CCGR_ON) ;
  GPT2_CR = 0;
  GPT2_SR = 0x3F; // clear all prior status
  GPT2_CR =  GPT_CR_CLKSRC(3);// | GPT_CR_FRR ;// 3 external clock
  //*(portConfigRegister(14)) = 8;  // ALT 1
  //CORE_PIN14_CONFIG = 8;
  IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_02 = 8;
  IOMUXC_GPT2_IPP_IND_CLKIN_SELECT_INPUT = 1;
}

static inline void counter_start(void)
{
  GPT2_CR |= GPT_CR_EN; // enable
}

static inline void counter_shutdown(void)
{
  GPT2_CR = 0;
}

static inline uint32_t counter_read(void)  // was uint16_t in FreqCount?
{
  return GPT2_CNT;
}

static inline uint8_t counter_overflow(void)
{
  return GPT2_SR & GPT_SR_ROV;
}

static inline void counter_overflow_reset(void)
{
  GPT2_SR |= GPT_SR_ROV;
}

volatile uint32_t count_ready, count_output, count_prev;
void tmr_callback() {
  uint32_t count = counter_read();

  //track rollover ?
  count_output = count - count_prev;
  count_prev = count;
  count_ready = 1;
}

//IntervalTimer it1;
uint32_t us;
void setup() {
  Serial.begin(9600);
  while (!Serial);
  delay(2000);
  analogWriteFrequency(11, 40000000);  // test jumper 11 to 14
  analogWrite(11, 128);

  counter_init();
  //it1.begin(tmr_callback, 1000000);  // us
  counter_start();
  us = micros();
}

void loop() {
  if (micros() - us >= 1000000) {
    uint32_t count = counter_read();
    us = micros();
    count_output = count - count_prev;
    count_prev = count;
    Serial.println(count_output);
    // count_ready = 0;

  }
}
 
Last edited:
Status
Not open for further replies.
Back
Top