Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 67 of 67

Thread: Teensyduino 1.20 Released

  1. #51
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    The uploader works as it should now on Linux too. I think Paul nailed the problem finally.

  2. #52
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,193
    Hmmm, not sure which release this might have happened in, but under 1.20, this program no longer compiles for teensy 3
    https://github.com/manitou48/teensy3...er/lowvolt.ino
    it can't find the PMC_LVDSC* variables. I tried including kinetis.h (the symbols seem to be defined there now), but that didn't help ???
    Last edited by manitou; 10-31-2014 at 06:03 PM.

  3. #53
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,559
    Opps, sorry, somehow a typo got into the code.

    Fixed on github.

    https://github.com/PaulStoffregen/co...8fad831d13ddc0

  4. #54
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679

    Fastrun

    I need help with the new "FASTRUN" Feature, how can i use it ?
    Could you please provide an example ?

  5. #55
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,559
    Here's an example. A rather silly one, since you'd want to use FASTRUN on functions that matter for performance.

    Code:
    FASTRUN void loop() {
      digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);               // wait for a second
      digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);               // wait for a second
    }
    Sometimes FASTRUN can help a lot, especially when running at faster clock speeds (eg, overclocking stuff that's disabled by default in boards.txt), but more often than not it gives little to no benefit, for a lot of extra RAM usage, when used on functions that don't matter for performance.

  6. #56
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Thank you!

    Different topic: While experementing with GCC 4.8.3, i got this warning:
    Code:
    C:\Arduino\libraries\Audio\effect_fade.cpp:31:22: warning: type of 'fader_table' does not match original declaration [enabled by default]
     extern const int16_t fader_table[256];
                          ^
    C:\Arduino\libraries\Audio\data_waveforms.c:81:15: note: previously declared here
     const int16_t fader_table[257] = {

  7. #57
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,108
    Quote Originally Posted by PaulStoffregen View Post
    Here's an example. A rather silly one, since you'd want to use FASTRUN on functions that matter for performance.

    Code:
    FASTRUN void loop() {
      digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);               // wait for a second
      digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);               // wait for a second
    }
    Sometimes FASTRUN can help a lot, especially when running at faster clock speeds (eg, overclocking stuff that's disabled by default in boards.txt), but more often than not it gives little to no benefit, for a lot of extra RAM usage, when used on functions that don't matter for performance.
    Thanks for the example. How does it make things faster, inlining to avoid call and return overhead?

  8. #58
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,255

    Cool

    Quote Originally Posted by Nantonos View Post
    Thanks for the example. How does it make things faster, inlining to avoid call and return overhead?
    No, the FASTRUN macro uses an __attribute__ to put the code for the function into the .fastrun data section, instead of the the .text section. The linker script puts the .fastrun section into the read/write SRAM instead of the read-only FLASH memory that normally the code goes into. I would imagine the trade off is SRAM is much faster to reference, but by using it, you have less data for your data. Because it is in read/write memory, you also run the risk of something that writes outside of its bounds changing the code.

  9. #59
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,559
    The RAM is faster than Flash.

  10. #60
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,108
    Thanks, that makes sense.

  11. #61
    In the new SPI library in 1.20, is it possible to change
    Code:
    #elif defined(__arm__) && defined(TEENSYDUINO)
    to this?
    Code:
    #elif defined(__arm__) && defined(CORE_TEENSY)
    I'm running sublime text 3 with the Stino plugin, and for some reason, TEENSYDUINO is not defined, but CORE_TEENSY is.
    In the previous version of the SPI libraries, CORE_TEENSY is used instead of TEENSYDUINO.

    Otherwise, upon compiling, the whole section for the Teensy 3.x is not used and I get all these errors with SPIClass is not defined etc.

    I have manually changed this, but it'd be great if it could be added to the next release.

    Thanks.
    Last edited by BrianC; 11-29-2014 at 01:01 AM.

  12. #62
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    Hey Paul, Any chance of bundling the teensy_loader_cli under hardware/tools/ ?? This would be very handy.

  13. #63
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,559
    I'm not really maintaining teensy_loader_cli.

  14. #64
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    Why not? Any particular reason?

  15. #65
    Member
    Join Date
    Jul 2015
    Location
    Ontario, Canada
    Posts
    68
    You may want to include the FASTRUN discussion above in the Wiki when it comes.

    And can it be used in conjunction with static inline void function()? An example of static inline is shown at https://forum.pjrc.com/threads/24573...with-Teensy3-0

  16. #66
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    I don't know what the compiler would do, but inlining a "FASTRUN"-Function (which means that it should run in the RAM) to code which is in the FLASH would be pretty obscure...

  17. #67
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    This is the definition:
    Code:
     #define FASTRUN __attribute__ ((section(".fastrun"), noinline, noclone ))
    You'll notice the "noinline"

Posting Permissions

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