Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: T3.5 Interval Timer example-OK in Arduino IDE,compiles but doesnt work in VM

  1. #1
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    130

    T3.5 Interval Timer example-OK in Arduino IDE,compiles but doesnt work in VM

    Environment: T3.5 , Arduino IDE 1.8, Teensyduino 1.34, Visual Micro Release 1709.3 (latest)

    My program works fine under the Arduino IDE. It will compile without errors and run, but the Interval Timer ISR is not called (or the Interval Timer interrupt is masked out) when I compile the same program using Visual Micro.
    I narrowed it down by trying just the Interval Timer example program on the PJRC site- it is also affected the same way
    https://www.pjrc.com/teensy/td_timin...rvalTimer.html

    I know the program size for the Arduino IDE build (82632 bytes) is different from the VM program size (82720 bytes). VM is supposed to be using the same toolchain as Arduino/Teensyduino, so I don't understand the discrepancy in program code size. However, this size discrepancy is also found in other Teensy programs I've written, which do compile/work fine.
    Anyone experienced this problem? I know it should probably be addressed on the VM forum, but the Teensy Forum is much more active/helpful.
    I routinely use the much better Visual Micro development platform for Teensy/ESP32 and it really hurts to have to go back to the Arduino IDE to finish this program.
    Thanks

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,638
    Have you looked at the the options passed in for both builds? That is could it be an optimize difference? Or maybe some defines that are different?

    That is where I would probably what I would first check out. It has been a long time since I used VM builds and I don't have a valid version of it on my machine anymore... Maybe should try it again.

  3. #3
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    130

    Smile

    Quote Originally Posted by KurtE View Post
    Have you looked at the the options passed in for both builds? That is could it be an optimize difference? Or maybe some defines that are different?

    That is where I would probably what I would first check out. It has been a long time since I used VM builds and I don't have a valid version of it on my machine anymore... Maybe should try it again.
    Well, that was fast! I had Optimize Faster in VM and Optimize Fast in Arduino. Switching VM to Optimize Fast fixed things. I tend to forget looking at these options from project to project, apart from setting the processor, clock and USB type.
    You must be using some other great IDE if you have tried Visual Micro and then stopped. Once I adopted it, I seldom revert to using the Arduino IDE. In this particular case, I needed the Arduino IDE Serial Plotter for debugging, which VM doesn't have. So, I was puzzled when I tried to compile this program in VM, after using Arduino early on in the project, for debugging.
    Many thanks Kurt.

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,638
    Glad you got it working... Although maybe someone should look why building it with Faster is not working properly.

    Actually currently mostly building using Arduino IDE. Earlier this year when I moved over to a new dev machine, the Visual Micro stuff did not move over and my subscription had elapsed and I would need to buy new one... Have not gotten around to it. For awhile I was using Sublime text with Stino to build. Still using sublime text. But Stino has some issues where it did not sometimes produce valid builds, and problems where it was holding open I believe file handles for every file in your libraries, plus other places and kept running out of resources. And then the developer of it just disappeared... No updates or the like in 9 months...

    So depending on if I am simply editing a sketch or editing a sketch with library files, my workflow changes. Sometimes I just edit in the IDE. It ain't great but not too bad. If however I am doing major changes and/or updating libraries, I do the editing in sublimetext and set the Arduino preferences for external editor and have it do the builds. I just wish that Arduino had the settings to turn on external editor mode by menu item for a specific sketch... Or simply watched file changes and if it saw them would ask you if you would like to reload...

  5. #5
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    130
    Quote Originally Posted by KurtE View Post
    Glad you got it working... Although maybe someone should look why building it with Faster is not working properly.

    Actually currently mostly building using Arduino IDE. Earlier this year when I moved over to a new dev machine, the Visual Micro stuff did not move over and my subscription had elapsed and I would need to buy new one... Have not gotten around to it. For awhile I was using Sublime text with Stino to build. Still using sublime text. But Stino has some issues where it did not sometimes produce valid builds, and problems where it was holding open I believe file handles for every file in your libraries, plus other places and kept running out of resources. And then the developer of it just disappeared... No updates or the like in 9 months...

    So depending on if I am simply editing a sketch or editing a sketch with library files, my workflow changes. Sometimes I just edit in the IDE. It ain't great but not too bad. If however I am doing major changes and/or updating libraries, I do the editing in sublimetext and set the Arduino preferences for external editor and have it do the builds. I just wish that Arduino had the settings to turn on external editor mode by menu item for a specific sketch... Or simply watched file changes and if it saw them would ask you if you would like to reload...
    Hi Kurt: I'm a bit puzzled at your comment re VM license expiration. When I started using VM, the basic version was free, but you could buy the advanced version with serial port debugging. I bought licenses for 2 of my computers for the advanced version, to support the developer (although I seldom use the serial debugging feature with the Teensy/ESP32, just do the old println debugging) . My licenses have not expired (5+ years so far) but the free version of VM still would do anything I need. I believe the VM basic version is still free.
    For me, Visual Studio is what I use for Visual Basic on the PC, and the VS/VM plug-in for AVR/Teensy/ESP32 covers all my MCU work.
    A while back I saw DD4WH's Teensy SDR project in the forum. I wanted to adapt it to a bigger FT800 touchscreen display. That adaptation was a big change to his code, both his and my versions are > 5000 lines of code. I can't even conceive doing something like this with just the Arduino IDE- all of the advanced features of VM are really needed to work your way through everything. VM does have the feature that it recognizes any changes you make externally from Arduino IDE, and allows you to (optionally) import the changes and re-compile. That is great.
    I never change toolchains in the middle of a project, so I haven't tried the newest Arduino/Teensyduino versions yet, but I have an Intel x7 so the new parallel processing feature may speed things up for me when I do.
    Again, thanks a lot for your help.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,186
    Any chance you could retry this test with 1.41-beta2? Version 1.34 is very old.

    I tried just now with Arduino 1.8.5 (on Linux, not using Visual Micro) and 1.41-beta2. I uploaded the IntervalTimer example program using all 12 options in the Tools > Optimize menu. All 12 seems to work correctly when I run on a Teensy 3.5 here.

    Is there any settings that reproduce this problem on Visual Micro when using the latest 1.41-beta2 or 1.40 version of Teensyduino?

  7. #7
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    130
    I have just downloaded the necessary Arduino and Teensyduino install files. It looks like my visual micro (newest release) should integrate with Arduino 1.9. I'll install it tomorrow and see if everything still works, then try compiling the example program under VM, with the different compiler optimization levels, and test with my T3.5 project. If it works for you, as you stated,it should also work for me under VM.

  8. #8
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    130
    Quote Originally Posted by PaulStoffregen View Post
    Any chance you could retry this test with 1.41-beta2? Version 1.34 is very old.

    I tried just now with Arduino 1.8.5 (on Linux, not using Visual Micro) and 1.41-beta2. I uploaded the IntervalTimer example program using all 12 options in the Tools > Optimize menu. All 12 seems to work correctly when I run on a Teensy 3.5 here.

    Is there any settings that reproduce this problem on Visual Micro when using the latest 1.41-beta2 or 1.40 version of Teensyduino?
    I can confirm that the Interval Timer example (and my program that uses the interval timer interrupt) work fine with T3.5, Arduino 1.90 Beta31/Teensyduino 1.41-beta2 under Visual Micro Release 1709.3 -using all 12 of the compiler optimization options.

Posting Permissions

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