Forum Rule: Always post complete source code & details to reproduce any issue!
Page 167 of 174 FirstFirst ... 67 117 157 165 166 167 168 169 ... LastLast
Results 4,151 to 4,175 of 4350

Thread: Teensy 4.0 First Beta Test

  1. #4151
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    Paul - Very good update for Windows - just some more fun with the rest of the UI tidbits.

    ~6.5 Hours running here - first and one follow up upload of the LPS.ino. That is twice closing the t_sermon as noted in prior post.

    At this point still running happily - just got back to looking it was up at 230K … now 210K … then back up to 230K.

    It is clearly faster and IIRC the old version would have croaked long ago.

    Click image for larger version. 

Name:	First6hrNewSerMon1.47.png 
Views:	4 
Size:	49.1 KB 
ID:	17283

    That was a long term little disturbance run - just cut power ~10 times and t_sermon picks up on repower.

    … a couple other interruptions and uploads pending …

    >> Did half dozen power Off>On' and t-sermon picks up running fine.
    >> did 10 Button to bootloader and TyComm sending Reset and it did and came up running fine
    >> did 10 Button to bootloader and TyComm Upload of prior lps.hex and it did and came up running fine
    >> did half dozen USB cable Pull and Plug and it came up running fine.

    That seems MORE robust - I've had times where I had to Close SerMon window and click open again to get it to establish a connect.
    Last edited by defragster; 08-22-2019 at 06:14 AM.

  2. #4152
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    >> THIS got dropped on the wrong thread … blaming the foum software since it was too big it failed to post a few times …

    Paul: loop() Code Mod to lps.ino - for a bit more stress that breaks here:
    Code:
    void loop() {
      while (1) {
        Serial.print("count=");
        Serial.print(count);
        Serial.print(", lines/sec=");
        Serial.println(count_per_second);
        count = count + 1;
        uint32_t msec = millis();
        if (msec - prior_msec > 1000) {
          delay(1);
          // when 1 second as elapsed, update the lines/sec count
          prior_msec = prior_msec + 1000;
          count_per_second = count - prior_count;
          prior_count = count;
        }
      }
    }
    With or without the delay(1); on the second update this ruins the operation of Teensy_serialmon. It dies if running - won't get past the first second or now won't start at all.

    At the same time TyCommander for Serial monitor is running at 74K to 116K lps. And running well for some minutes. IT IS USING 29.3% CPU - making this fitful to type. Which is the typical unchanged performance I've seen - until something worse happens where it gets longer faster strings.

    IDE has this in the console: TOO LONG at 270K chars … see file - that had to be zipped for 80KB over limit ::
    Code:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    	at javax.swing.text.DefaultHighlighter$SafeDamager.run(DefaultHighlighter.java:608)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    	at javax.swing.text.DefaultHighlighter$SafeDamager.run(DefaultHighlighter.java:608)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    	at javax.swing.text.DefaultHighlighter$SafeDamager.run(DefaultHighlighter.java:608)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 5273
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    
    
    // ...
    
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 0
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 49591
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "Thread-38" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "Thread-40" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Last edited by defragster; 08-23-2019 at 02:03 AM.

  3. #4153
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,547
    @Paul, @mjs513, @defragster - Not sure which thread to mention this again:
    UncanneyEys0 (earlier mjs513 version) -

    Thought I would try loading it again. And it built fine:

    Output from my current version of the More info
    Code:
    FlexRAM section ITCM+DTCM = 512 KB
        Config : aaaaaaaf
        ITCM :  39664 B	(60.52% of   64 KB)
        DTCM : 185024 B	(40.33% of  448 KB)
        Available for Stack: 273728
    OCRAM: 512KB
        DMAMEM:      0 B	( 0.00% of  512 KB)
        Available for Heap: 524288 B	(100.00% of  512 KB)
    Flash: 214672 B	(10.57% of 1984 KB)
    ===info ||| Multiple libraries were found for "{0}" ||| [Adafruit_GFX.h]
     Used: D:\arduino-1.8.9\hardware\teensy\avr\libraries\Adafruit_GFX
     Not used: C:\Users\kurte\Documents\Arduino\libraries\Adafruit_GFX_Library
    Multiple libraries were found for "ST7735_t3.h"
     Used: C:\Users\kurte\Documents\Arduino\libraries\ST7735_t3
     Not used: D:\arduino-1.8.9\hardware\teensy\avr\libraries\ST7735_t3
    Using library debug_tt in folder: C:\Users\kurte\Documents\Arduino\libraries\debug_tt (legacy)
    Using library SPI at version 1.0 in folder: D:\arduino-1.8.9\hardware\teensy\avr\libraries\SPI 
    Using library Adafruit_GFX at version 1.5.6 in folder: D:\arduino-1.8.9\hardware\teensy\avr\libraries\Adafruit_GFX 
    Using library ST7735_t3 at version 1.0.0 in folder: C:\Users\kurte\Documents\Arduino\libraries\ST7735_t3 
    "D:\\arduino-1.8.9\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-size" -A "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_487078/uncannyEyes0.ino.elf"
    Sketch uses 214672 bytes (10%) of program storage space. Maximum is 2031616 bytes.
    Global variables use 224688 bytes (21%) of dynamic memory, leaving 823888 bytes for local variables. Maximum is 1048576 bytes.
    D:\arduino-1.8.9\hardware\teensy/../tools/teensy_post_compile -file=uncannyEyes0.ino -path=C:\Users\kurte\AppData\Local\Temp\arduino_build_487078 -tools=D:\arduino-1.8.9\hardware\teensy/../tools -board=TEENSY40 -reboot -port=usb:0/140000/0/3/1/2 -portlabel=(null) -portprotocol=(null) 
    No Teensy boards were found on any USB ports of your computer.
    Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
    Board at usb:0/140000/0/3/1/2 is not available
    I am used to having this one kill the USB... But this time when the load completed, windows 10 64 bit gave me a message about installing new device (NXP Generic device???)...

    out of Curiosity, I wondered what it would do if I plugged it into a linux board. Most convenient one I had was RPI4, So I plugged it in there, and sure enough it is showing up as some generic device?

    Taking a look at the system messages I see:
    Code:
    [  172.170541] usb 1-1.3: new high-speed USB device number 6 using xhci_hcd
    [  172.311005] usb 1-1.3: New USB device found, idVendor=1fc9, idProduct=0135, bcdDevice= 1.01
    [  172.311022] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  172.311035] usb 1-1.3: Product: SE Blank RT Family
    [  172.311048] usb 1-1.3: Manufacturer: NXP      SemiConductors Inc
    [  172.314482] hid-generic 0003:1FC9:0135.0004: hiddev97,hidraw3: USB HID v1.00 Device [NXP      SemiConductors Inc  SE Blank RT Family ] on usb-0000:01:00.0-1.3/input0
    Information from USB system:
    Code:
    pi@RPI4B:~ $ lsusb
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 006: ID 1fc9:0135 NXP Semiconductors
    Bus 001 Device 004: ID 04ca:0027 Lite-On Technology Corp.
    Bus 001 Device 003: ID 1241:1177 Belkin Mouse [HT82M21A]
    Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    pi@RPI4B:~ $ lsusb -v -d 1fc9:0135
    
    Bus 001 Device 006: ID 1fc9:0135 NXP Semiconductors
    Couldn't open device, some information will be missing
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            0
      bDeviceSubClass         0
      bDeviceProtocol         0
      bMaxPacketSize0        64
      idVendor           0x1fc9 NXP Semiconductors
      idProduct          0x0135
      bcdDevice            1.01
      iManufacturer           1
      iProduct                2
      iSerial                 0
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength       0x0022
        bNumInterfaces          1
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0xc0
          Self Powered
        MaxPower              100mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         3 Human Interface Device
          bInterfaceSubClass      0
          bInterfaceProtocol      0
          iInterface              0
            HID Device Descriptor:
              bLength                 9
              bDescriptorType        33
              bcdHID               1.00
              bCountryCode            0 Not supported
              bNumDescriptors         1
              bDescriptorType        34 Report
              wDescriptorLength      76
             Report Descriptors:
               ** UNAVAILABLE **
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               4
    Now if I do a 15 second reset, I see:
    Code:
    [ 1219.848267] usb 1-1.3: USB disconnect, device number 6
    [ 1247.279958] usb 1-1.3: new high-speed USB device number 7 using xhci_hcd
    [ 1247.410487] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0486, bcdDevice= 2.79
    [ 1247.410503] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 1247.410516] usb 1-1.3: Product: Teensyduino RawHID
    [ 1247.410528] usb 1-1.3: Manufacturer: Teensyduino
    [ 1247.410540] usb 1-1.3: SerialNumber: 5871650
    [ 1247.424334] hid-generic 0003:16C0:0486.0005: hiddev97,hidraw3: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:01:00.0-1.3/input0
    [ 1247.426207] hid-generic 0003:16C0:0486.0006: hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:01:00.0-1.3/input1
    
    pi@RPI4B:~ $ lsusb
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 007: ID 16c0:0486 Van Ooijen Technische Informatica Teensyduino RawHID
    Bus 001 Device 004: ID 04ca:0027 Lite-On Technology Corp.
    Bus 001 Device 003: ID 1241:1177 Belkin Mouse [HT82M21A]
    Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    And if I then program it on RPI4 with simple program like EchoBoth: I see:
    Code:
    [ 1631.560869] usb 1-1.3: USB disconnect, device number 8
    [ 1631.954513] usb 1-1.3: new high-speed USB device number 9 using xhci_hcd
    [ 1632.085260] usb 1-1.3: config 1 interface 1 altsetting 0 bulk endpoint 0x3 has invalid maxpacket 64
    [ 1632.085270] usb 1-1.3: config 1 interface 1 altsetting 0 bulk endpoint 0x84 has invalid maxpacket 64
    [ 1632.085529] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
    [ 1632.085536] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 1632.085541] usb 1-1.3: Product: USB Serial
    [ 1632.085547] usb 1-1.3: Manufacturer: Teensyduino
    [ 1632.085551] usb 1-1.3: SerialNumber: 5871650
    [ 1632.087656] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
    pi@RPI4B:~ $ lsusb
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 009: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
    Bus 001 Device 004: ID 04ca:0027 Lite-On Technology Corp.
    Bus 001 Device 003: ID 1241:1177 Belkin Mouse [HT82M21A]
    Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    pi@RPI4B:~ $ lsusb -v -d 16c0:0483
    
    Bus 001 Device 009: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            2 Communications
      bDeviceSubClass         0
      bDeviceProtocol         0
      bMaxPacketSize0        64
      idVendor           0x16c0 Van Ooijen Technische Informatica
      idProduct          0x0483 Teensyduino Serial
      bcdDevice            2.79
      iManufacturer           1 Teensyduino
      iProduct                2 USB Serial
      iSerial                 3 5871650
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength       0x0043
        bNumInterfaces          2
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0xc0
          Self Powered
        MaxPower              100mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      1 AT-commands (v.25ter)
          iInterface              0
          CDC Header:
            bcdCDC               1.10
          CDC Call Management:
            bmCapabilities       0x01
              call management
            bDataInterface          1
          CDC ACM:
            bmCapabilities       0x06
              sends break
              line coding and serial state
          CDC Union:
            bMasterInterface        0
            bSlaveInterface         1
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0010  1x 16 bytes
            bInterval              16
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x03  EP 3 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x84  EP 4 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               0
    Device Qualifier (for other device speed):
      bLength                10
      bDescriptorType         6
      bcdUSB               2.00
      bDeviceClass            2 Communications
      bDeviceSubClass         0
      bDeviceProtocol         0
      bMaxPacketSize0        64
      bNumConfigurations      1
    can't get debug descriptor: Resource temporarily unavailable
    Device Status:     0x0000
      (Bus Powered)
    Again not sure if any of this information will be useful, but grabbed it while I could

  4. #4154
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,202
    @Paul, @mjs513, @defragster

    I just gave it a try to see if I could duplicate it and I was sort of able to, to a degree.

    I caused uncannyeyes to fail in my usual way, with one of the eyes without progmem. I do still loose USB but I don't get the window error about loosing the usb port. It prints the setup info to sermon if I open it right away but I will loose the port in the IDE (it gets grayed out). I can upload, but had to do a 15s restart once. I was trying different things - tested it with and with the imxrt-size receipe in the platforms.txt file just out of curiosity.

    UncannyEyes is getting stranger and stranger.

  5. #4155
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    I recognize those 'found devices' - and posted … not reading for context just now - but here are the links matching by name for ref::

    NXP Semiconductors :: 05-18-2019, 12:08 AM :: https://forum.pjrc.com/threads/54711...ors#post206140

    and also :: Van Ooijen
    05-18-2019, 12:08 AM :: https://forum.pjrc.com/threads/54711...jen#post206140

    04-29-2019, 05:29 AM :: https://forum.pjrc.com/threads/54711...jen#post204544

    … those aren't uncanny eyes ….

  6. #4156
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    Popped back to the duplicate post above that listed both names

    @KurtE and @mjs513 :: Are you both using Production boards? In scanning those, that was in the white wire timeframe - not that I know why that would be an issue …

  7. #4157
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,547
    The last one I reported was using one of the white wire versions of the T4...

    I am pretty sure the: 16c0:0486 Van Ooijen Technische Informatica Teensyduino RawHID
    Is a normal value for Teensy...
    Likewise for: 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial

    My guess is that the 16c0:xxxx was originally purchased by Van Ooijen Technische Informatica, who then resold a range of them to PJRC...

    And for example if you look at usb_desc.h, you will see information like:
    Code:
    #if defined(USB_SERIAL)
      #define VENDOR_ID		0x16C0
      #define PRODUCT_ID		0x0483
      #define DEVICE_CLASS		2	// 2 = Communication Class
      #define MANUFACTURER_NAME	{'T','e','e','n','s','y','d','u','i','n','o'}
      #define MANUFACTURER_NAME_LEN	11
      #define PRODUCT_NAME		{'U','S','B',' ','S','e','r','i','a','l'}
      #define PRODUCT_NAME_LEN	10
      #define EP0_SIZE		64
      #define NUM_ENDPOINTS		4
      #define NUM_USB_BUFFERS	12
      #define NUM_INTERFACE		2
      #define CDC_STATUS_INTERFACE	0
      #define CDC_DATA_INTERFACE	1
      #define CDC_ACM_ENDPOINT	2
      #define CDC_RX_ENDPOINT       3
      #define CDC_TX_ENDPOINT       4
      #define CDC_ACM_SIZE          16
      #define CDC_RX_SIZE           64
      #define CDC_TX_SIZE           64
      #define ENDPOINT2_CONFIG	ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
      #define ENDPOINT3_CONFIG	ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_UNUSED
      #define ENDPOINT4_CONFIG      ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_BULK

  8. #4158
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    Quote Originally Posted by defragster View Post

    Paul: loop() Code Mod to lps.ino - for a bit more stress that breaks here:
    Quick follow up on this from #4152 with the while(1) in the lps.ino loop() - Closed IDE and got back to this on teensy_sermon and it has been running fine some time at the same range of rates as before. So it was some accumulation hopefully the failure path is in the console log.

  9. #4159
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,547
    @Paul - Terminal Monitor Wish list...

    Sometimes when I lose USB (either because I unplug it, or something in program kills it), I wish I could still select and copy the text to the clipboard so I could post it, or put in into edit buffer to diagnose things.

    For example "THE **** program killed USB" and I have some debug information like:
    Click image for larger version. 

Name:	TerminalMonitor.jpg 
Views:	5 
Size:	69.4 KB 
ID:	17289

    In this case, I had added some debug code, that compared the actual memory that startup.c copied and zeroed, to the current values, at the start of setup(). I expect some of the differences.
    D!=S - was areas that we copied. D!=0 was areas we zeroed...
    The first copy of D!=S values are: F_BUS_ACTUAL, F_CPU_ACTUAL, usb_string_serial_number

    The others in this area are values in the range:
    20028a30 d impure_data
    20028e58 D _impure_ptr

    I have not gone through the areas that were cleared, as probably not as interesting. But maybe interesting is where USB died...
    Click image for larger version. 

Name:	TerminalMonitor_end.jpg 
Views:	3 
Size:	35.7 KB 
ID:	17290

    So maybe again maybe it will boil back down to some problem in the st7735_t3 library which again is showing up when the code does: mytft = new ST7735_t3(...)
    And as such the object is created in the HEAP...

    But again back to point of this message. Wish I could have simply copied the above text...

  10. #4160
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,547
    @Paul, @mjs513, @defragster - Maybe found what was trashing memory (At least in the above case).

    One of the two constructors for st7735_t3 was not initializing a few key variables (which should be nullptr or 0...) Did not show up in all of the cases where someone did something like:
    ST7735_t3 tft = ST7735_t3(...);

    As this was allocated in DTCM and either init or zeroed. But in this case the code does: new ST7735_t3(....) which allocates the data up in OCRAM and it is not init and maybe garbage...

    I added some more init code up in the branch: https://github.com/KurtE/ST7735_t3/tree/T4_DMA_LOW

    You might try it to see if it fixes your version of crashing in UnCannyEyes!

  11. #4161
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    Good work KurtE - now I know why I always thought user code was to init everything - even if zero.

    And TRUE point about the IDE SerMon going dead when 'offline'. One reason I tend to use TyCommander. It doesn't block Copy or scroll back - and also doesn't wipe between restarts (selectable)

    @Paul: Would also be nice to be able to start multiple instances of teensy_sermon - especially being able to run outside of IDE if possible. Is there a CMD_LINE startup for the EXE? Puzzling the "FirstTry" update was just a JAVA.JAR change and no update to the EXE when IIRC the t_sermon was not a JAVA app?

    AND UPDATE to p# 4152 / #4158 on update to teensy_sermon:: That sketch is STILL running now 21 hours later without issue using the while(1) and never leaving loop(). So as anoter @user prior post noted - it may involve restart/upload cycles for instability - not just pure exec speed.

    The console output in IDE is still very short from uninterrupted execution - unlike the FAULTING log posted in #4152 that needed to be zipped:
    Code:
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 9081
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 9081
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Last edited by defragster; 08-24-2019 at 01:12 AM.

  12. #4162
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,680
    Here's my second attempt at speeding up the Arduino Serial Monitor. This one should (hopefully) have everything working....

    Like the first (msg #4139), to install this find pde.jar inside Arduino and replace it the copy from this ZIP file. Make a backup copy of the original pde.jar outside the Arduino folder, in case you want to restore Arduino to the way it was.

    This version should make AutoScroll work properly. You should be able to select and copy text. I even tried to make the text accessible after USB disconnects. Hopefully there are no more Java exceptions or error messages?

    Java memory usage is expected to slowly creep upward and then make sudden drops. That's the normal process of Java garbage collection. The big question is whether this runs acceptably on your computer. Is it free of hangs or pauses (like when that garbage collection happens)? Does it run fast & smoothly? Does it affect the speed of other programs (no Arduino) running on your computer?

    Please give this one a try and let me know how it works for you?
    Attached Files Attached Files
    Last edited by PaulStoffregen; 08-24-2019 at 05:13 PM.

  13. #4163
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    RE: serialmon_speedup_2nd_try.zip

    Seems to work - same speed as 1st. Stopping AutoScroll to copy text or page - stops incoming data write/update? Scroll bar surges a bit - as if it is filling a buffer then freezing that buffer and starting a new one - then it rejoins/jumps with autoscroll enabled. Which seems usable to capture - if done at the right time!

    Indeed Button push on T4 and t_sermon allows select/copy of text from text area:
    Code:
    count=50444750, lines/sec=216682
    count=50444751, lines/sec=216682
    count=50444752, lines/sec=216682
    count=50444753, lines/sec=216682
    count=50444754, lines/sec=216682
    count=50444755, lines/sec=216682
    And POWER Off>On restarts in same window without reconnect.

    I found some Console notes here on Win 10 after playing with Clear/AutoScroll/Scroll bar:
    Code:
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 15971
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 15971
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****

    <edit>: Also nicely allows Keyboard text select !!!

    Quick lps.ino edit to test longer lines looks okay with if ( !(count%5) ) Serial.println();:
    Code:
    count=19110926, lines/sec=231460count=19110927, lines/sec=231460count=19110928, lines/sec=231460count=19110929, lines/sec=231460count=19110930, lines/sec=231460
    count=19110931, lines/sec=231460count=19110932, lines/sec=231460count=19110933, lines/sec=231460count=19110934, lines/sec=231460count=19110935, lines/sec=231460
    count=19110936, lines/sec=231460count=19110937, lines/sec=231460count=19110938, lines/sec=231460count=19110939, lines/sec=231460count=19110940, lines/sec=231460
    count=19110941, lines/sec=231460count=19110942, lines/sec=231460count=19110943, lines/sec=231460count=19110944, lines/sec=231460count=19110945, lines/sec=231460
    and if ( !(count%10) ) Serial.println();:
    Code:
    count=21227361, lines/sec=231633count=21227362, lines/sec=231633count=21227363, lines/sec=231633count=21227364, lines/sec=231633count=21227365, lines/sec=231633count=21227366, lines/sec=231633count=21227367, lines/sec=231633count=21227368, lines/sec=231633count=21227369, lines/sec=231633count=21227370, lines/sec=231633
    count=21227371, lines/sec=231633count=21227372, lines/sec=231633count=21227373, lines/sec=231633count=21227374, lines/sec=231633count=21227375, lines/sec=231633count=21227376, lines/sec=231633count=21227377, lines/sec=231633count=21227378, lines/sec=231633count=21227379, lines/sec=231633count=21227380, lines/sec=231633
    count=21227381, lines/sec=231633count=21227382, lines/sec=231633count=21227383, lines/sec=231633count=21227384, lines/sec=231633count=21227385, lines/sec=231633count=21227386, lines/sec=231633count=21227387, lines/sec=231633count=2

  14. #4164
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,547
    Quote Originally Posted by PaulStoffregen View Post
    Here's my second attempt at speeding up the Arduino Serial Monitor. This one should (hopefully) have everything working....
    ...
    This version should make AutoScroll work properly. You should be able to select and copy text. I even tried to make the text accessible after USB disconnects. Hopefully there are no more Java exceptions or error messages?
    Thanks, so far so good. And as @defragster mentioned, it looks like, I can select and copy and paste:
    Code:
    Estimated max stack usage: 1640
    36
    Estimated max stack usage: 1640
    even if I disconnect from USB, which is a great help!

  15. #4165
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,680
    Quote Originally Posted by defragster View Post
    Stopping AutoScroll to copy text or page - stops incoming data write/update?
    Yes, if the buffer completely fills. This is different behavior than Arduino has today, which I consider to be a bug, though I will admit it's sort of a matter of personal preference.

    With stock Arduino 1.8.9, if you turn off AutoScroll and a lot more data keeps arriving, eventually it will scroll or blank your screen. If the data is coming in at Teensy 4.0 max speed, "eventually" is a matter of seconds. I don't like that. If you've turned off AutoScroll, the window should not scroll or move on its own. At least that's my opinion.

    But what should the serial monitor do is the buffer completely fills while you have AutoScroll turned off? What I have in the code now is the serial monitor tries to keep 40% of the buffer free while scrolling, so you can still receive quite a lot more data after turning off AutoScroll. But the buffer doesn't grow. When it completely fills up, if AutoScroll is off then it must discard the imcoming data. Deleting anything from the buffer can cause the window to scroll or jump or blank while you're reading.

    If the buffer fills and you turn AutoScroll back on, the first incoming character causes ~40% of the old data to be immediately discarded. Scrolling mode uses 60% of the buffer, in anticipation that you might turn off AutoScroll at any moment.


    I found some Console notes here on Win 10 after playing with Clear/AutoScroll/Scroll bar:
    Code:
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 15971
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    Looks like I *still* have more work to do! Anything you can give me to reproduce this here would really help. Or maybe I'll have to make a 3rd version that prints quite a bit more info about what led up to that problem.

  16. #4166
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    Machine a bit WONKY - tried to post and EDGE failed I see - then I see new posts … here is what I saved … hit BUTTON on T4 to pause running - have not looked at PERF number in TaskMan - will restart and do that:

    I see it added a couple of new CONSOLE notes since first post - but still running and ZERO signs of corrupted lines or lost data

    The Errors seem to show on restart? Hit Button { using TyComm so no AUTO load } - then unplug/replug and a new set of CONSOLE text appears.

    Code:
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
      // ABOVE PICKS UP HERE ...
    
    javax.swing.text.BadLocationException: beyond end
    	at processing.app.FifoDocument.createPosition(FifoDocument.java:536)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:375)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    javax.swing.text.BadLocationException: beyond end
    	at processing.app.FifoDocument.createPosition(FifoDocument.java:536)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:375)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    javax.swing.text.BadLocationException: beyond end
    	at processing.app.FifoDocument.createPosition(FifoDocument.java:536)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:375)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    javax.swing.text.BadLocationException: beyond end
    	at processing.app.FifoDocument.createPosition(FifoDocument.java:536)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:375)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    javax.swing.text.BadLocationException: beyond end
    	at processing.app.FifoDocument.createPosition(FifoDocument.java:536)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:375)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    javax.swing.text.BadLocationException: beyond end
    	at processing.app.FifoDocument.createPosition(FifoDocument.java:536)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:375)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 24719
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

  17. #4167
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    Indeed the AutoScroll behavior seems good and usable - it will be like shooting fish in a river trying to hit fast moving 480 Mbps spew ... but that is life. At least it stays where stopped for review and edit - and as noted - continues to fill current 'buffer space'.

    I closed IDE and restarted and notes above seem correct for repro - it is on restart after bootloader?

    TaskMan happy - everything CLOSED with IDE and after restart I see this that looks good - though stopping Teensy allowed me to better post the above last time.
    As note before TyComm has half the throughput at 30% CPU and teensy_serialmon && JAVA are shoing under 10%:
    Click image for larger version. 

Name:	2ndNewSerMon1.47.png 
Views:	2 
Size:	41.0 KB 
ID:	17306

    REPRO:
    >> No TeensyLoader open [ or OFF AUTO ]
    >> Press POWER OFF then ON - restarts NO ERRORS
    >> Press Button to bootloader : THEN >> Press POWER OFF then ON - restarts ERRORS below:

    Code:
    Board at usb:0/140000/0/8/6 is not available
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 24735
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

  18. #4168
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    @Paul: closing TyComm and IDE then IDE restart {no T_loader} and open t_sermon it picks up running. Did POWER OFF then POWER ON and got the error on second Power cycle to ON - with vBat removed - No Button:

    Code:
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 24714
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    <EDIT>:: About an hour later without interruption and still running perfectly well with no signs of data loss/corruption in display - an no new Console Errors. So indeed it is the 'Stop/Start' of T4 exit/arrive that causes the errors it seems - which is where trouble comes with repeated uploads.

    Currently SIX sets of lps.ino update per line that would show it , and dropping those 5 \n's has the Win 10 throughput at +/- 230K lines per sec.
    Last edited by defragster; 08-24-2019 at 07:06 PM.

  19. #4169
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,926
    @Paul - just seeing pjrc.com
    Inventory Status: Out Of Stock
    Last physical count: Aug 23, 2019
    Update, Aug 9: More Teensy 4.0 are in production now
    Congratulations again - but it might be good freshen "Update, Aug 9" with the incoming BIGGEST EVER Batch #3 expectations for September - and the good news that second batches have gone out to other distributors.

    Speaking of feature creep and helpful suggestions:
    > can the t_SerMon be changed for on the fly font size change with CTRL and [+/-] or Ctrl+Mouse Wheel?
    > Multi Instance of t_Sermon to UART debug or second active Teensy

  20. #4170
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    133
    @Paul
    Tested your second try and really like it as others have commented. You asked for issues so: Can still crash Arduino where memory is ~780MB CPU 350%.

    Here's a little more precisely how to do it.
    1. Compiled and loaded DejaVu with Serial.println("DejaVu"); commented for known start state, opened Arduino serial to verify.

    DejaVu.ino
    Code:
    void setup() {
      Serial.begin(9600);
      while(!Serial)
       ;
      Serial.println("I'm starting up");
    }
    
    void loop() {
      Serial.println("DejaVu"); // comment and uncomment this line
    }
    2. Quit Arduino and Teensyduino but leave T4 plugged in.
    3. Start Arduino, deny network connections, and open seral monitor as below.(the other serial method works fine ie slower)
    Click image for larger version. 

Name:	Screen Shot 2019-08-24 at 11.45.40 AM.png 
Views:	3 
Size:	654.6 KB 
ID:	17308
    4. Leaving monitor open and with Serial.println("DejaVu"); uncommented hit upload button.
    5. Close monitor window after about 2 seconds of DejaVu.
    6. Comment println and upload. Open monitor, all is good.
    7. goto 4.

    Usually seizes after 2-4 tries, not sure about effect of length monitor is open and exact effect of messing with auto scroll button, can crash either way.

    As far as usability, this version seems 4/5 stars for me. The procedure above would take a real twit to not fix the problem first. The only reason not 5 stars is because I'm a real twit

    Code:
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException
    	at java.lang.String.getChars(String.java:826)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:331)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException
    	at java.lang.String.getChars(String.java:826)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:331)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException
    	at java.lang.String.getChars(String.java:826)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:331)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException
    	at java.lang.String.getChars(String.java:826)
    	at processing.app.FifoDocument.insertString(FifoDocument.java:331)
    	at javax.swing.JTextArea.append(JTextArea.java:477)
    	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:188)
    	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:176)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

  21. #4171
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,680
    Here's a 3rd attempt. This one adds synchronized functions, to check if these negative number errors are due to multi-threading conflicts.

    Other than the question of whether this solves those bugs, the big question is how much this hurts performance? It's likely to increase CPU usage. Memory use should be pretty similar.
    Attached Files Attached Files

  22. #4172
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,166
    I've tried the 2nd attempt on Windows 10 Pro x64 on a 6 cpu (12 hyperthreads) i7-6800K @3.4GHz and 64GB of ram with arduino 1.8.9 + TD1.47
    If I just leave it running, the Java process uses about 5% of the cpu and reports about 175,000 lines/sec.
    However, if I try disconnecting and reconnecting the USB or just hitting the reprogram button, it generates the Negative number error exactly as reported by @bicycleguy and @defragster.
    I think I can make it happen consistently. If I hold the button, or remove the USB plug for 5 seconds or less and then reconnect, it will continue without any error. But if I wait 6 seconds or more it throws the Java error. It usually only throws the error once and recovers. But one time I tried it, it just went into a loop throwing the error continuously.
    I get this repeated:
    Code:
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 64233
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    It occasionally throws an extra error line in there too:
    Code:
    Error, FifoDocument line search results differ!                         <<< This one
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Can't render line: 235295
    	at javax.swing.text.PlainView.drawLine(PlainView.java:92)
    	at javax.swing.text.PlainView.paint(PlainView.java:311)
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
    	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
    	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
    	at javax.swing.JComponent.paintComponent(JComponent.java:780)
    	at javax.swing.JComponent.paint(JComponent.java:1056)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JViewport.paint(JViewport.java:728)
    	at javax.swing.JComponent.paintChildren(JComponent.java:889)
    	at javax.swing.JComponent.paint(JComponent.java:1065)
    	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
    	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
    	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
    	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
    	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
    	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Pete

  23. #4173
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,680
    Has anyone tried the 3rd attempt (msg #4171) on Windows?

    My best guess so far is the "StateInvariantError" may be a thread synchronization bug. The 3rd try attempts to fix that by synchronizing all the functions. If that works, the question is what does it cost in performance. On Linux, seems about the same.

  24. #4174
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,166
    Just tried the 3rd attempt. Looks like a winner. Even if I pull the plug or hold the button for 20 seconds, it still recovers without an error message.
    Speed seems to be the same - varies from approx. 169,000 to 176,000 lines/sec - and cpu usage looks essentially the same.

    Pete

  25. #4175
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,202
    I am currently using for I guess you would call normal operations - the only thing I noticed is the SerMon is gray when data is getting dumped to it and white when I am doing a compile/upload until data starts streaming then it turns gray again. Haven't done any heavy dumps yet.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •