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

Thread: Issue between Teensy and STM32duino

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    10

    Issue between Teensy and STM32duino

    I might have discovered a bug in between Teensy and STM32duino.

    I am cross-posting this to both forums.

    In trying to test a pre-release of Visuino, a graphic Arduino programming solution, I was attempting to test the BUILTIN_SDCARD function when the Generated Visuino code failed to compile.
    Then when I open an Example, from the IDE under ‘SD’ the sketch, ‘CardInfo’, the BUILTIN_SDCARD line was missing from the comments section that lists the ‘chipSelect' pins.

    Here’s the example text that is correct:
    // change this to match your SD shield or module;
    // Arduino Ethernet shield: pin 4
    // Adafruit SD shields and modules: pin 10
    // Sparkfun SD shield: pin 8
    // Teensy audio board: pin 10
    // Teensy 3.5 & 3.6 on-board: BUILTIN_SDCARD
    // Wiz820+SD board: pin 4
    // Teensy 2.0: pin 0
    // Teensy++ 2.0: pin 20
    const int chipSelect = 4;

    While this is the comments from the system that doesn’t work:
    // change this to match your SD shield or module;
    // Arduino Ethernet shield: pin 4
    // Adafruit SD shields and modules: pin 10
    // Sparkfun SD shield: pin 8
    // MKRZero SD: SDCARD_SS_PIN
    const int chipSelect = 4;


    I then created a clean Windows VM installed Arduino IDE 1.8.2 and TeensyduinoInstall.exe and the Generated file compiled fine.
    Next after some intense searching I ran across the board listings for STM32 on all three systems that didn’t work.
    Then I created a blank Arduino ‘sketch folder’ and after restarting the IDE, the Visuino Generated file compiled just fine.

    So, I believe there are some incompatibilities between the STM32 and Teensy libraries/hardware profiles, but I don’t know what it is.
    All I see is Can anyone else confirm this, by installing both of these and trying to view that Example sketch for the BUILTIN_SDCARD line.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,475
    Arduino customizes the File > Examples menu and uses a different set of certain libraries depending on which board you've selected in Tools > Boards.

    When Teensy is selected, it will show you the SD library which is customized for Teensy.

    If you open stuff from the SD lib for another board, and then try to use it with Teensy, odds are it will be missing the Teensy-specific functionality.

  3. #3
    Junior Member
    Join Date
    Oct 2016
    Posts
    10
    OKay, I did have the Teensy 3.6 selected in all cases, as that was the board the sketch was written for.
    I will double check

  4. #4
    Junior Member
    Join Date
    Oct 2016
    Posts
    10
    Quote Originally Posted by Kurt_R View Post
    OKay, I did have the Teensy 3.6 selected in all cases, as that was the board the sketch was written for.
    I will double check
    Click image for larger version. 

Name:	Screenshot 2017-08-26 16.14.11.png 
Views:	25 
Size:	48.7 KB 
ID:	11384

    Here is a screenshot from my Laptop.
    At the bottom you can see the 3.6 selected.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,475
    Quote Originally Posted by Kurt_R View Post
    At the bottom you can see the 3.6 selected.
    Yes, but this was opened when Teensy was not selected, then remained open after the setting was changed.

    With Teensy selected, click File > Examples and open it again. Then you'll get the Teensyduino version.

  6. #6
    Junior Member
    Join Date
    Oct 2016
    Posts
    10
    Click image for larger version. 

Name:	Screenshot 2017-08-26 16.37.04.jpg 
Views:	24 
Size:	109.8 KB 
ID:	11385
    This is after selecting the Teensy again, with just the left window open then selecting the 'cardInfo' example again.
    I have done this on 2 different computers now with always the same result, after I close out the IDE all the way and re-open it the Teensy is selected, and opening the example always shows the result above.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,375
    That shows a duplicate SD library that is being used in the sketchbook folder?

    >> Used: c:\users\kroesener\documents\arduino\libraries\SD

    Remove that and try again.

  8. #8
    Junior Member
    Join Date
    Oct 2016
    Posts
    10
    Alright, that does help, thank you. I can see why my other install after I changed sketch folders, that didn't have that library installed then worked fine, so that was just a coincidence.

    This does bring up the question, though; How does someone know, after installing the default SD library, when it does cause problems and how do we know it's safe to get rid of it?

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,475
    There's no single guideline that applies in all cases.

    But in general, it's not a good idea to install copies of the "built in" libraries like SD, SPI, Wire, Servo, etc. Most boards provide their own customized versions of these libs.

    However, Arduino is meant to facilitate experimenting and learning. That's one of the main reasons you can install libs in your sketchbook folder, so you can override all other copies within Arduino if you want to customize. It's a powerful feature, but all too often a lib like SD gets installed to solve some specific problem, and then later ends up causing other problems because it's not the well tested and tailored to each board. That is the reason why Arduino has that duplicate libraries message.

  10. #10
    Junior Member
    Join Date
    Oct 2016
    Posts
    10
    Okay, good to know, thanks!

    Will the ones in other folders get updated via the built in mechanism?

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,375
    Quote Originally Posted by Kurt_R View Post
    Okay, good to know, thanks!

    Will the ones in other folders get updated via the built in mechanism?
    Everything in 'installed' locations should updates through the mechanism they used before - TeensyDuino installer does just that. Library manager should as well. if you pull down things manually - like github or put it in sketchbook libraries it is up to the user to repeat or maintain that.

  12. #12
    Junior Member
    Join Date
    Oct 2016
    Posts
    10
    Alright thanks to both of you for your guidance, big fan of Teensy and hope to make some good things.
    Just got a Teensy Audio and can't wait to try out the GUI for that.

    Kurt

Posting Permissions

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