Forum Rule: Always post complete source code & details to reproduce any issue!
Page 172 of 172 FirstFirst ... 72 122 162 170 171 172
Results 4,276 to 4,285 of 4285

Thread: Teensy 4.0 First Beta Test

  1. #4276
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,288
    opps << This ended up on wrong thread ... https://forum.pjrc.com/threads/57441...flow-on-Teensy
    BTW .. the YES/NO recognition takes 2.6 seconds on T4 ...

    Seemed half done to have YES set LED high and then no indication of NO, so modified:
    Code:
    void RespondToCommand(tflite::ErrorReporter* error_reporter,
                          int32_t current_time, const char* found_command,
                          uint8_t score, bool is_new_command) {
      static bool is_initialized = false;
      if (!is_initialized) {
        pinMode(LED_PIN, OUTPUT);
        is_initialized = true;
      }
      static int32_t last_yes_time = 0;
      static int32_t last_no_time = 0;
      static int count = 0;
    
      if (is_new_command) {
        error_reporter->Report("Heard %s (%d) @%dms [ms lag=%d]", found_command, score,
                               current_time, millis()-current_time);
        // If we heard a "yes", switch on an LED and store the time.
        if (found_command[0] == 'y') {
          last_yes_time = current_time;
          digitalWrite(LED_PIN, HIGH);
        }
        if (found_command[0] == 'n') {
          last_no_time = current_time;
          digitalWrite(LED_PIN, LOW);
        }
      }
    
      // If last_yes_time is non-zero but was >3 seconds ago, zero it
      // and switch off the LED.
      if (last_yes_time != 0) {
        if (last_yes_time < (current_time - 3000)) {
          last_yes_time = 0;
          digitalWrite(LED_PIN, LOW);
        }
        // If it is non-zero but <3 seconds ago, do nothing.
        return;
      }
      if (last_no_time != 0) {
        if (last_no_time < (current_time - 3000)) {
          last_no_time = 0;
          digitalWrite(LED_PIN, HIGH);
        }
        // If it is non-zero but <3 seconds ago, do nothing.
        return;
      }
    
      // Otherwise, toggle the LED every time an inference is performed.
      ++count;
      if (count & 1) {
        digitalWrite(LED_PIN, HIGH);
      } else {
        digitalWrite(LED_PIN, LOW);
      }
    }
    Last edited by defragster; 09-05-2019 at 06:34 AM. Reason: wrong thread - but T4 running Tensorflow

  2. #4277
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,288
    @Paul:
    Last code was TensorFlow - IDE still active - not much else. Doing a SIMPLE 1 print/sec sketch and IDE showing this on 5th or so IDE Upload with text selected in t_sermon window
    {Win 10 machine, up 15 days - prob not relevant.}

    BAD/Interesting thing: 'Autoscroll OFF' and with a single number printed per line there was ONE line/Number Selected for prior Copy to paste.
    >> It does REPRO when value selected and IDE Upload executed, no item selected and No Error Spew in console.
    >> Also watching the GUI the selection block crawls around BEFORE new incoming text as the error SPEW arrives. So it is the text selection of the prior instance trying to map on the restarted fresh text when buffer empty?
    Code:
    TeensyPipeMonitor close
    inputPipeListener exception: java.lang.InterruptedException: sleep interrupted
    TeensyPipeMonitor close
    inputPipeListener thread exit
    T:\arduino-1.8.9t4\arduino-builder -dump-prefs -logger=machine -hardware T:\arduino-1.8.9t4\hardware -hardware C:\Users\Tim\AppData\Local\Arduino15\packages -hardware T:\tCode\hardware -tools T:\arduino-1.8.9t4\tools-builder -tools T:\arduino-1.8.9t4\hardware\tools\avr -tools C:\Users\Tim\AppData\Local\Arduino15\packages -built-in-libraries T:\arduino-1.8.9t4\libraries -libraries T:\tCode\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt=o2std,keys=en-us -ide-version=10809 -build-path T:\TEMP\arduino_build_116394 -warnings=more -build-cache T:\TEMP\arduino_cache_60035 -verbose T:\tCode\FORUM\LoopSpeed\LoopSpeed.ino
    errorPipeListener thread exit
    //...
    "T:\\arduino-1.8.9t4\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-size" -A "T:\\TEMP\\arduino_build_116394/LoopSpeed.ino.elf"
    Sketch uses 12528 bytes (0%) of program storage space. Maximum is 2031616 bytes.
    Global variables use 15424 bytes (1%) of dynamic memory, leaving 1033152 bytes for local variables. Maximum is 1048576 bytes.
    T:\arduino-1.8.9t4\hardware\teensy/../tools/teensy_post_compile -file=LoopSpeed.ino -path=T:\TEMP\arduino_build_116394 -tools=T:\arduino-1.8.9t4\hardware\teensy/../tools -board=TEENSY40 -reboot -port=usb:0/140000/0/8/7 -portlabel=hid#vid_16c0&pid_0478 Bootloader -portprotocol=Teensy 
    TeensyPipeMonitor open usb:0/140000/0/8/7
    FifoDocument.getText *****NEGATIVE NUMBER ERROR*****
    opened, dev=COM37, name=Serial
    javax.swing.text.BadLocationException: beyond end
    	at processing.app.FifoDocument.createPosition(FifoDocument.java:580)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.processAppended(FifoDocument.java:391)
    	at processing.app.inputPipeListener$1.run(TeensyPipeMonitor.java:293)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    	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:580)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.processAppended(FifoDocument.java:391)
    	at processing.app.inputPipeListener$1.run(TeensyPipeMonitor.java:293)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    	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:580)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.processAppended(FifoDocument.java:391)
    	at processing.app.inputPipeListener$1.run(TeensyPipeMonitor.java:293)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    	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:580)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.processAppended(FifoDocument.java:391)
    	at processing.app.inputPipeListener$1.run(TeensyPipeMonitor.java:293)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    	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:580)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.processAppended(FifoDocument.java:391)
    	at processing.app.inputPipeListener$1.run(TeensyPipeMonitor.java:293)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    	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:580)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:245)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.processAppended(FifoDocument.java:391)
    	at processing.app.inputPipeListener$1.run(TeensyPipeMonitor.java:293)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    	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:580)
    	at javax.swing.text.DefaultHighlighter.changeHighlight(DefaultHighlighter.java:246)
    	at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1676)
    	at processing.app.FifoDocument.processAppended(FifoDocument.java:391)
    	at processing.app.inputPipeListener$1.run(TeensyPipeMonitor.java:293)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
    	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)
    Simple sketch:
    Code:
    int Counter = 0;
    unsigned long TickCount = 0;
    
    void setup() {
      Serial.begin(9600);
      TickCount = millis();
    }
    
    void loop() {
      Counter ++;
      if (millis() - TickCount > 1000) {
        Serial.println(Counter);
        TickCount = millis();
        Counter = 0;
      }
    }

  3. #4278
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,439
    Quote Originally Posted by defragster View Post
    BAD/Interesting thing: 'Autoscroll OFF' and with a single number printed per line there was ONE line/Number Selected for prior Copy to paste.
    >> It does REPRO when value selected and IDE Upload executed, no item selected and No Error Spew in console.
    >> Also watching the GUI the selection block crawls around BEFORE new incoming text as the error SPEW arrives. So it is the text selection of the prior instance trying to map on the restarted fresh text when buffer empty?
    I was able to reproduce this bug. Committed a fix on github.

    https://github.com/PaulStoffregen/Ar...bc3a6ab62d880c

    I also made some changes in the Mac version of teensy_serialmon to make it slightly more efficient (but sadly, still nowhere near the Windows & Linux versions) and hopefully more stable. Sadly, I just don't see any solution for the excessive CPU usage on Macintosh. It seems reading from the serial device uses quite a lot of CPU time on MacOS.

    So far I have not managed to reproduce the freezing on windows resize issue on msg #4257. I've put it on my list of bugs to (later) investigate.

    Rather than publish a 9th JAR file here, I'm going to put a day or two into porting libs and looking into other non-IDE reported issues, then publish 1.48-beta1 to roll up everything.

  4. #4279
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,267
    @PaulStoffregen - I put in a PR for SPI where I changed the Drive Strength and Speed values for the SPI pins for T4. It helped for some of our displays.

    You might want to double check to see if you think these are the best settings for them or not.

    Thanks
    Kurt

  5. #4280
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,288
    Quote Originally Posted by PaulStoffregen View Post
    I was able to reproduce this bug. Committed a fix on github.

    https://github.com/PaulStoffregen/Ar...bc3a6ab62d880c

    I also made some changes in the Mac version of teensy_serialmon to make it slightly more efficient (but sadly, still nowhere near the Windows & Linux versions) and hopefully more stable. Sadly, I just don't see any solution for the excessive CPU usage on Macintosh. It seems reading from the serial device uses quite a lot of CPU time on MacOS.

    So far I have not managed to reproduce the freezing on windows resize issue on msg #4257. I've put it on my list of bugs to (later) investigate.

    Rather than publish a 9th JAR file here, I'm going to put a day or two into porting libs and looking into other non-IDE reported issues, then publish 1.48-beta1 to roll up everything.
    That fix looks like it felt, cool.

    Odd the MAC being the odd one.

    Scrolled from the above fix - any chance the resize error is catching in here and going to sleep to the next 'USB event' after a abort return without notice or - does that account for all the exceptions? - just wondering:
    Code:
    	private void update_gui(int chars_added, boolean auto_scroll) {
    		final Runnable do_update = new Runnable() {
    //...		};
    		int retry = 0;
    		while (true) {
    			try {
    				SwingUtilities.invokeAndWait(do_update);				return;
    			} catch (InterruptedException e) {
    				if (output.debug) System.err.println("GUI update interrupted");
    				if (output.program == null) return;
    				if (++retry > 4) return;
    			} catch (Exception e) {

  6. #4281
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,439
    Quote Originally Posted by defragster View Post
    any chance the resize error is catching in here and going to sleep to the next 'USB event' after a abort return without notice or - does that account for all the exceptions? - just wondering:
    Are you seeing "GUI update interrupted" print multiple times when the resize problem happens?

    Resizing or moving the window shouldn't cause Java to interrupt the thread. Normally the listener thread is only supposed to be interrupted by the close() function.

    https://github.com/PaulStoffregen/Ar...itor.java#L156

  7. #4282
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,288
    Quote Originally Posted by PaulStoffregen View Post
    Are you seeing "GUI update interrupted" print multiple times when the resize problem happens?

    Resizing or moving the window shouldn't cause Java to interrupt the thread. Normally the listener thread is only supposed to be interrupted by the close() function.

    https://github.com/PaulStoffregen/Ar...itor.java#L156
    No as noted ' nothing ever prints ' from the time it stalls including after it restarts. Though skipped reading that line in context … for the retry exit. So it isn't that code path.

    Don't know Exception behavior - assuming any failed try would be caught in the second catch()? And uncaught it would fault otherwise and not just stay in while(1)?

    If related to that code my other question would be related to note in prior post - if a message got lost or mishandled would this wait forever - until USB changes trigger restart? :: SwingUtilities.invokeAndWait(do_update);

    Not sure why I can repro Stall so easily - and then it resumes with a USB [arrive,depart] from Windows core.

  8. #4283
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,439
    Quote Originally Posted by neurofun View Post
    MacBookPro8,2 early 2011 4Gb ram, i7 2.2GHz, osx 10.14.6, arduino 1.8.9, td1.47

    I managed to install Mojave on my 3th machine, which is NOT supported by Apple.
    Everything freshly installed.

    attempt 1: 11min
    attempt 2: 6min
    attempt 3: 50min
    attempt 4: 58min
    attempt 5: 17min
    attempt 6: 4min
    attempt 7: 40sec
    attempt 7: 8min
    @neurofun - Could I talk you into giving 1.48-beta1 a try on your Macs?

    https://forum.pjrc.com/threads/57609...no-1-48-Beta-1

    I made some changes inside teensy_ports which might make it more stable. I ran for hours on my Macbook Air. But very hard to know how it'll do on other Macs...

  9. #4284
    Member
    Join Date
    Nov 2017
    Location
    Belgium
    Posts
    85
    @PaulStoffregen
    MacBookPro8,2 early 2011 4Gb ram, i7 2.2GHz, osx 10.14.6, arduino 1.8.9, td1.48beta1

    first run
    attempt 1: 5m30s 40% cpu load arduino
    attempt 2: 30s 40%
    attempt 3: 1m35s 40%
    attempt 4: 19m30s 40%
    attempt 5: 3m40s 265%
    attempt 6: 42m 400%
    attempt 7: 88m 400%

    second run
    attempt 1: 50s 40%
    attempt 2: 3m42s 40%
    attempt 3: 9m 40%
    attempt 4: 2m15s 40%
    attempt 5: 9m 40%
    attempt 6: 4m 220%
    attempt 7: 46m 280%

  10. #4285
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,267
    Also it appears like I can no longer select and copy text in the Terminal Monitor when the cable is unplugged.
    1.8.10, Windows 10 64 bit.

Posting Permissions

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