Issue between Teensy and STM32duino

Status
Not open for further replies.

Kurt_R

Member
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.
 
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.
 
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
 
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

Screenshot 2017-08-26 16.14.11.png

Here is a screenshot from my Laptop.
At the bottom you can see the 3.6 selected.
 
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.
 
Screenshot 2017-08-26 16.37.04.jpg
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.
 
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.
 
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?
 
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.
 
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.
 
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
 
Status
Not open for further replies.
Back
Top