Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 25 of 92

Thread: Teensyduino 1.21 Test #2 Available

  1. #1
    Administrator Paul's Avatar
    Join Date
    Oct 2012
    Posts
    386

    Teensyduino 1.21 Test #2 Available

    Here is a test version for Teensyduino 1.21:


    EDIT: old links removed. Please use this newer version.



    Please give this a try and report any bugs. Try to include a sample program that reproduces the problem!

    This test version has a newer 4.8.4 toolchain for Teensy 3.1 and improvements to the Arduino Serial Monitor.

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,592
    Just installed it and loaded my current project which compiled without issues. Could not yet shoot it towards the teensy since I'm at work and not at home. Will report problems later in case there are.

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    111
    Quote Originally Posted by Paul View Post
    improvements to the Arduino Serial Monitor.
    Paul, is there any more detailed changelog available somewhere? I'm wondering what kind of improvements for ASM this Teensyduino version introduces.

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,592
    Quote Originally Posted by pawelsky View Post
    Paul, is there any more detailed changelog available somewhere? I'm wondering what kind of improvements for ASM this Teensyduino version introduces.
    Yes, +1 for a changelog ! :-)

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,391
    Quote Originally Posted by pawelsky View Post
    Paul, is there any more detailed changelog available somewhere?
    Sure. Here's all the details. 1.20 was released on Oct 7th, so ignore commits before that date.

    https://github.com/PaulStoffregen/cores/commits/master

    https://github.com/PaulStoffregen/Ar...commits/master

    https://github.com/PaulStoffregen/SPI/commits/master

    As you can see, pretty minor stuff and small fixes. The toolchain upgrade and edits to the serial monitor are the only major changes.
    Last edited by PaulStoffregen; 12-30-2014 at 03:36 PM.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,391
    I'm really hoping you'll give the improved serial monitor a try. That's the big new change.

    The tricky part to watch is whether is always manages to automatically reopen the connection to your Teensy after an upload.

  7. #7
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,592
    The tricky part to watch is whether is always manages to automatically reopen the connection to your Teensy after an upload.
    Oh, that's a new feature which I consider as being important. Can't wait to go home after work and give it a try!

  8. #8
    Senior Member
    Join Date
    Jan 2014
    Posts
    111
    Quote Originally Posted by PaulStoffregen View Post
    I'm really hoping you'll give the improved serial monitor a try. That's the big new change.

    The tricky part to watch is whether is always manages to automatically reopen the connection to your Teensy after an upload.
    Thanks Paul, will try that for sure. I'm also glad that the memory leak with auto scroll disabled was addressed. I think that was reason why the serial monitor became non-responsive sometimes after long logging session.

  9. #9
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Hi Paul, just a quick note of thanks for the update and so far it seems to coexist very nicely with the xCode environment. I was able to build a program for my device and run it too, with the serial output now coming via a Terminal shell vs. the Arduino Serial Monitor. So far, it looks like it works great.

    Quote Originally Posted by pawelsky View Post
    Thanks Paul, will try that for sure. I'm also glad that the memory leak with auto scroll disabled was addressed. I think that was reason why the serial monitor became non-responsive sometimes after long logging session.
    The memory leak is something I also encountered. Though I didn't know what it was, I just noted that the computer itself would become unstable.

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,391
    Yes, this is supposed to fix the memory leaks and also allow most PCs and Macs to keep up with maximum rate printing. It put the GUI update of the serial monitor on a 30 Hz schedule, so no matter how fast Teensy prints, Java only has to redraw the window contents at 30 Hz.

    But I can't possibly test on a wide range of PCs and Macs... which is the main reason for this test release.

  11. #11
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,023
    Just installed on my OSX 10.9.5 and the RawHID does not print anything to serial monitor now. Sketch:

    Code:
    void setup()   {                
      Serial.begin(38400);
    }
    
    
    void loop()                     
    {
      Serial.println("Hello World");
      delay(1000);
    }

  12. #12
    Senior Member
    Join Date
    Jan 2014
    Posts
    111
    Not sure if you want to add any more corrections in this release, but I've noticed that some of the examples (especially the ones for SD and SPI) are missing some CS pin description for Teensy 3.x. Also in other examples (e.g. where built in LED is used) there is only reference to Teensy 3.0 but not 3.1). These are minor things but in examples which are meant for newcomers may be important.

    Here are some examples:
    CardInfo.ino
    Datalogger.ino
    DumpFile.ino
    Files.ino
    listfiles.ino
    ReadWrite.ino

    But I'm sure there is more...

  13. #13
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,023
    I really hope the serial monitor will work with RAWHID because compiling with Serial crashes my computer still!

  14. #14
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,526
    I can't get sprintf to work with floating point - neither float nor double. It worked this morning before I installed 1.21 Test #2.
    Teensy3.1 on 64-bit Windows 7 Pro.
    A sample program which demonstrates the problem and shows that sprintf still works with integers.

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    float e = 2.7f;
    double p = 3.14159;
    char tmps[64];
    void setup(void)
    {
      Serial.begin(9600);
      while(!Serial);
      Serial.println("Start");
      
      // sprintf of double and float doesn't work at all.
      sprintf(tmps,"%8.5f, %8.5lf",e,p);
      Serial.println(tmps);
      
      // printing a float with Serial works
      Serial.println(e,2);
      // and sprintf of an integer is OK
      sprintf(tmps,"%6d",12345);
      Serial.println(tmps);
    }
    
    void loop(void)
    {
    }
    Output is:
    Code:
    Start
    , 
    2.70
     12345
    Can anyone reproduce this or have I made a dumb mistake?

    Pete
    Last edited by el_supremo; 12-31-2014 at 06:26 PM. Reason: add info

  15. #15
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    1,023
    ok, not trying pile on but it seems after printing data very fast to serial monitor it crashes (freezes) the IDE when you try to upload while its printing.

    OS: OSX 10.9.5
    Teensy: 3.1, Serial, 48MHz, 1.21(#2)
    Arduino: 1.0.6
    Sketch to reproduce this: same as before just changed the delay for fast printing let it go awhile ~(2 minutes) then try to upload the same or any code without closing the serial monitor. The IDE will freeze and I have to Force Quit it.
    Code:
    void setup() {                
      Serial.begin(38400);
    }
    
    
    void loop() {
      Serial.println("Hello World");
      delay(10);
    }
    Edit:
    It also seems that if you just upload this code and then try to upload again very soon after a couple of times it freezes also. I know this is a bit neurotic but just want this serial monitor stuff working good so I'm trying to see where it breaks
    Last edited by duff; 12-31-2014 at 02:27 AM. Reason: more info

  16. #16
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,592
    Edit agin: Don't care about what I wrote before (in italics below).

    A fresh install of Arduino 1.06, then Teensyduino 1.20, then Teensyduino 1.21#2 solved all problems. The serial monitor remains open, clears its content when uploading code, and starts displaying again!

    Thank you for this fine update!

    OK, all that does NOT work for me after upgrading from 1.20 to 1.21#2 ... :-(
    a) The serial monitor window remains blank, no output is seen.
    b) It does not reopen automatically after uploading code to the teensy.
    Thus I'll have to revert to teensyduino 1.20 - hope that this will work for me

    (OSX 10.10.2, Arduino 1.06)

    Edit: Gave it another try. Did a fresh install of Arduino 1.06 and Teensyduino 1.21#2. Same problem. No output on the serial monitor. No automatic (re-)opening of the serial monitor. Now doing a fresh install of 1.06 again with 1.20 and hope that things will art least work as they did before.
    Last edited by Theremingenieur; 01-01-2015 at 06:22 PM.

  17. #17
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    7,555
    I get "deprecated" warnings with

    bool findUntil(char *target, char *terminator); (Stream.h)

    If the strings are "const". I don't know if this is normal (did not test with TEENSYDUINO120).
    Maybe it should be bool findUntil(char const *target, char const *terminator); ?

    Regards,
    Frank.

  18. #18
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    use of double and "lf" in sprintf... does Teensy 3 software floating point support doubles in math as well as the DEFAULT clib formatter for doubles (versus single/float)?

  19. #19
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,526
    With version 1.20 of Teensyduino, this code on a Teensy 3.1:
    Code:
    void setup(void)
    {
      char tmp[32];
      Serial.begin(9600);
      while(!Serial);
      delay(1000);
      
      sprintf(tmp,"%18.12lf",sin(3.14159/4));
      Serial.println(tmp);
    }
    
    void loop(void)
    {
    }
    prints:
    Code:
        0.707106312094
    But it doesn't work with 1.21 test#2. It doesn't print anything.

    Pete

  20. #20
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,592
    Pete, it is not true that it doesn't print anything, it does print - a CRLF... ;-)

    Apparently, what you see is the "normal" behavior. See this link

    It would rather be interesting to understand why this worked in 1.20, though...

  21. #21
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,592
    Just discovered another issue: Even the "simple" Serial.println() does some unexpected and weird variable casting.

    printing a int8_t (signed byte) which contains a negative value gives a int32_t output. WHY???

    void setup(void) {
    Serial.begin(57600);
    while(!Serial);
    delay(1000);
    Serial.println("Started");
    int8_t i = -2;
    Serial.print("DEC");Serial.print("\t");
    Serial.print("size");Serial.print("\t");
    Serial.print("HEX");Serial.print("\t");
    Serial.println("BIN");
    Serial.print(i,DEC);Serial.print("\t");
    Serial.print(sizeof(i));Serial.print("\t");
    Serial.print(i,HEX);Serial.print("\t");
    Serial.println(i,BIN);
    }

    void loop(void) {
    }
    Output:

    Started
    DEC size HEX BIN
    -2 1 FFFFFFFE 11111111111111111111111111111110
    instead if the expected

    Started
    DEC size HEX BIN
    -2 1 FE 11111110
    Last edited by Theremingenieur; 01-03-2015 at 03:24 PM.

  22. #22
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,921

    Cool

    Quote Originally Posted by Theremingenieur View Post
    Just discovered another issue: Even the "simple" Serial.println() does some unexpected and weird variable casting.

    printing a int8_t (signed byte) which contains a negative value gives a int32_t output. WHY???
    That is because there is no version of the Print class that takes signed char (i.e. int8_t) as a type, and the compiler does the standard conversions to one of the types that have alternates in Print.h. The C/C++ languages first convert signed char/short to int. On the arm platform, int is a 32-bit type. On the AVR platform (like the Arduino), int is a 16-bit type.

    Code:
            size_t print(unsigned char n, int base)         { return printNumber(n, base, 0); }
            size_t print(int n, int base)                   { return (base == 10) ? print(n) : printNumber(n, base, 0); }
            size_t print(unsigned int n, int base)          { return printNumber(n, base, 0); }
            size_t print(long n, int base)                  { return (base == 10) ? print(n) : printNumber(n, base, 0); }
            size_t print(unsigned long n, int base)         { return printNumber(n, base, 0); }

  23. #23
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,592
    Thank you, MichaelMeissner!

    I was just trying to accelerate some of my code, replacing floats by integers as pseudo-floats and doing some bitwise operations and bit shifting, which can be dangerous with signed numbers. I need also to use deliberately some rollover effects. All that can be useful when emulating harmonic oscillators with resonating filters.

    So, I wanted to check out some of my "ideas" with the famous "Serial.print debugger" and was really confused by its outputs...

  24. #24
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Quote Originally Posted by Theremingenieur View Post
    Thank you, MichaelMeissner!

    I was just trying to accelerate some of my code, replacing floats by integers as pseudo-floats and doing some bitwise operations and bit shifting, which can be dangerous with signed numbers. I need also to use deliberately some rollover effects. All that can be useful when emulating harmonic oscillators with resonating filters.

    So, I wanted to check out some of my "ideas" with the famous "Serial.print debugger" and was really confused by its outputs...
    Sounds like fixed-point math. There are libraries for fixed-point arithmetic, written in C.

  25. #25
    Member Kontakt's Avatar
    Join Date
    Jan 2015
    Location
    Norfolk, VA
    Posts
    21
    Ran into an error compiling a known good program, and I've found why.
    I don't know when Adafruit_SSD1306 was changed, but the version supplied by the installer doesn't match the version on Paul's github.

    The compile fails due to a prototype not having a matching function definition;
    the header declares
    Code:
    void dim(uint8_t contrast);
    but in the source we have
    Code:
    void Adafruit_SSD1306::dim(boolean dim) {
      uint8_t contrast;
    
      if (dim) {
        contrast = 0; // Dimmed display
      } else {
        if (_vccstate == SSD1306_EXTERNALVCC) {
          contrast = 0x9F;
        } else {
          contrast = 0xCF;
        }
      }
      // the range of contrast to too small to be really useful
      // it is useful to dim the display
      ssd1306_command(SSD1306_SETCONTRAST);
      ssd1306_command(contrast);
    }
    Bringing the prototype in line with the definition removes the error being thrown, but I can't vouch for the functionality.
    Last edited by Kontakt; 01-07-2015 at 09:05 PM. Reason: Fix code tags

Posting Permissions

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