Teensyduino 1.31 Beta #3 Available

Status
Not open for further replies.

Paul

Administrator
Staff member
Here is a third beta test for Teensyduino 1.31.


Edit: old beta test linkes removed. Full non-beta release is here:
http://www.pjrc.com/teensy/td_download.html



Changes since Teensyduino 1.31-beta2:

  • Fix Ethernet library socket receive bug (thanks ElOtroMateo)
  • Fix compiler warnings, eg: kinetis_hsrun_enable unused
  • Serial buffer sizes override from command line (Frank B)
  • Stream find functions use const for pointers
  • Add AudioOutputAnalogStereo and AudioInputAnalogStereo
  • Add Audio reverb effect, from Joao Rossi Filho
  • Add Audio waterfall spectrum example (Nathaniel Quillin)
  • Fix USB Audio on Windows when used with USB Serial
  • Fix auto-reboot for newer USB types
  • Fix serial monitor for newer non-serial USB types
  • Many ILI9341_t3 improvements (Frank B, Kurt E, Softegg)
  • SerialFlash allows other SPI ports (Martino Facchin)
  • Teensy Loader shows correct images for Teensy 3.5 & 3.6
 
Speaking of Ethernet, is there any ETA on some sort of Ethernet shield, module, or connector for the 3.6?
 
Right now, I'm working to wrap up a stable 1.31 release. New stuff like USB host & ethernet are on hold until we have a stable 1.31 to build upon.
 
Hi Paul, maybe not important, but yesterday I did a PR on the ILI9341_t3 library to the keywords.txt file that added in all of the new methods...
 
Paul,
I ran into an error with Beta 3 and Teensy 3.0 and the audio library.

I was using Teensyduino 3.1 Beta 2, Arduino 1.6.12 on Windows 10 with a Teensy 3.0 and the Audio library to show my son how odd harmonics can create a square wave and it worked great. After Installing 3.1 Beta 3 over Beta 2 we and ran into "Error Compiling for Board Teensy 3.0." with the details below. The problem occurred with all Audio.h examples that I tried. The Blink example works fine. I tried Teensy 3.2/3.1 and Teensy 3.6 and it compiled fine.

I then reinstalled Teensyduino 3.1 Beta 2 (verified that it installed in "Help\About Arduino") and strangely the problem remained with Teensy 3.0 selected. Finally I deleted Arduino\hardware\teensy, reinstalled Beta 2 and everything compiles and runs fine.

It looks like analog.c is not getting the definition of "__MK20DX128__".

Thanks for your hard work on Teensy. I'm really liking my Teensy 3.6!

Code:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\input_adcs.cpp: In function 'int analogReadADC1(uint8_t)':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\input_adcs.cpp:335:27: error: 'pin2sc1a' was not declared in this scope

         if (pin >= sizeof(pin2sc1a)) return 0;

                           ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\input_adcs.cpp:336:27: error: 'pin2sc1a' was not declared in this scope

         uint8_t channel = pin2sc1a[pin];

                           ^
...
Error compiling for board Teensy 3.0.

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthWaveformSine   sine1;
AudioSynthWaveformSine   sine2;
AudioSynthWaveformSine   sine3;
AudioSynthWaveformSine   sine4;
AudioSynthWaveformSine   sine5;
AudioSynthWaveformSine   sine6;
AudioSynthWaveformSine   sine7;
AudioSynthWaveformSine   sine8;
AudioMixer4              mixer1;
AudioMixer4              mixer2;
AudioMixer4              mixer3;
AudioOutputI2S           i2s1;

AudioConnection          patchCord1(sine1, 0, mixer1, 0);
AudioConnection          patchCord2(sine2, 0, mixer1, 1);
AudioConnection          patchCord3(sine3, 0, mixer1, 2);
AudioConnection          patchCord4(sine4, 0, mixer1, 3);

AudioConnection          patchCord5(sine5, 0, mixer2, 0);
AudioConnection          patchCord6(sine6, 0, mixer2, 1);
AudioConnection          patchCord7(sine7, 0, mixer2, 2);
AudioConnection          patchCord8(sine8, 0, mixer2, 3);

AudioConnection          patchCord94(mixer1, 0, mixer3, 0);
AudioConnection          patchCord10(mixer2, 0, mixer3, 1);

AudioConnection          patchCord11(mixer3, 0, i2s1, 0);
AudioConnection          patchCord12(mixer3, 0, i2s1, 1);

AudioControlSGTL5000     sgtl5000_1;
// GUItool: end automatically generated code

float firstHarmonic = 300.0;

void setup() {
  AudioMemory(30);
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.8);

  float Amplitude = 1.0 / (1.0 + 1.0 / 3.0 + 1.0 / 5.0 + 1.0 / 7.0 + 1.0 / 9.0 + 1.0 / 11.0 + 1.0 / 13.0 + 1.0 / 15.0);

  sine1.amplitude(Amplitude);
  sine1.frequency(firstHarmonic * 1);

  sine2.amplitude(Amplitude * 1.0 / 3.0);
  sine2.frequency(firstHarmonic * 3);

  sine3.amplitude(Amplitude * 1.0 / 5.0);
  sine3.frequency(firstHarmonic * 5);

  sine4.amplitude(Amplitude * 1.0 / 7.0);
  sine4.frequency(firstHarmonic * 7);

  sine5.amplitude(Amplitude * 1.0 / 9.0);
  sine5.frequency(firstHarmonic * 9);

  sine6.amplitude(Amplitude * 1.0 / 11.0);
  sine6.frequency(firstHarmonic * 11);

  sine7.amplitude(Amplitude * 1.0 / 13.0);
  sine7.frequency(firstHarmonic * 13);

  sine8.amplitude(Amplitude * 1.0 / 15.0);
  sine8.frequency(firstHarmonic * 15);

delay(4000);
}

void loop() {
  // put your main code here, to run repeatedly:
}
 
The SD library seems to be GNU General Public License V3, but what does that mean, yeah, the exact legal definition I can easily find, but not as easily to understand.

So can I use the SD library as it is, as part of code that is commercially sold, without needing to publish my code?
 
The SD library seems to be GNU General Public License V3, but what does that mean, yeah, the exact legal definition I can easily find, but not as easily to understand.

So can I use the SD library as it is, as part of code that is commercially sold, without needing to publish my code?

I am not a lawyer, but given that the Teensy does not have shared libraries (where you could load the library outside of the program proper), you would have to make your code available under the GPL V3 if you use the SD library.
 
Yes, the Arduino SD lib is GPL. My understanding is this means you're not allowed to use in a proprietary project where you don't release your code. Of course, this isn't legal advice. Legal advice can only come from your own attorney.

My intention has always been to allow people to use Teensy in their own products. Earlier this year, I began a complete rewrite of the SD lib. It's still in the experimental stage, and so far the code only supports reading. You can't write any data to the card, but it does work well for reading, with some optimizations not found in the old SD lib. All this new code is MIT license. The files are all together in the same SD lib folder. There's a define in SD_t3.h which selects the alternate code to compile.

Eventually I'm going to add write support, and SDIO support with large multi sector access, and advanced caching. All MIT to allow use in products. If only there were a lot more hours in every day....
 
Thanks Michael. That is what I am afraid of, so it would not be usable for me, unless I dedicate one board just for SD...

But I am a bit confused the SD_t3.h seems not to be that limited

/* Why reinvent the SD library wheel...
* 4: Permissive MIT license

Over all, what is the situation with basic* libraries with Teensy 3.2, 3.5 and 3.6 Are they free to use with these boards without obligation to share by the board user developed code, so that the boards can be used for commercial purposes?

*SERIAL, I2C, SPI, SD, ...

Edit: I see this was answered above for the SD part while I was typing
 
Last edited:
No matter what is said here, the final word on licensing is the actual license info found in each library, or any properly signed agreement you make directly with the author.
 
Yes, But it would be good to get an overall understanding of the situation. I am most concerned of Serial, SPI and I2C, those I need.

(I have not looked to the Teensy 3.5 and 3.6 libraries yet and not sure even where to find them.)
 
Probably yes, but I have no Idea where to find the Teensy 3.5 and 3.6 used SPI, Serial and I2C libraries and if there is other code I should be worried about.

And further more it should not be this difficult.

If my code that runs on Teensy uses just Serial, SPI and I2C,maybe CanBUS also, do the provided libraries limit the commercial use of the Teensy, is there requirements for me to publish the code.

If they do not allow commercial use without publishing code, I certainly hope it would be negotiated by the board provider so that they can be used for commercial use. The commercial use Teensy boards could come with an additional license fee if needed.
 
Last edited:
Paul can answer better on what is the license stuff for his code and libraries...
On my machine I have arduino installed at: C:\arduino-1.6.12 - So change any path I show to where it is installed on your machine.

Serial is part of cores: https://github.com/PaulStoffregen/cores
C:\arduino-1.6.12\hardware\teensy\avr\cores\teensy3

SPI: Source is up at: https://github.com/PaulStoffregen/SPI
Installs in C:\arduino-1.6.12\hardware\teensy\avr\libraries\SPI

I2C: (depends) Wire library - https://github.com/PaulStoffregen/Wire
Installs in C:\arduino-1.6.12\hardware\teensy\avr\libraries\Wire

If you use I2C_t3: https://github.com/nox771/i2c_t3
C:\arduino-1.6.12\hardware\teensy\avr\libraries\i2c_t3

I have not used canbus: I believe comes from: https://github.com/teachop/FlexCAN_Library (Paul's copy is some commits behind)
C:\arduino-1.6.12\hardware\teensy\avr\libraries\FlexCAN
 
Thanks Kurt, I just can not find the files on my Mac, but looking the files in Github, it looks pretty bad for SPI (if I was looking right libraries), but maybe ok for Serial, I2C_t3 and CAN. Is there an alternative library for SPI, that would not be GNU?
 
Last edited:
Paul, would you please clear this out. What is free to be used with the Teensy boards (I am thinking of using 3.2 and 3.6, maybe 3.5), what is contaminated by the GNU? Even some of the core libraries seem to be GNU?

1. If I add no libraries to my code, is everything free to be used for commercial purposes, without obligation to share the code?

2. Is there free to be used; I2C, SPI, Serial, CAN libraries, no obligation to share my own code when using them .

3. And yes, would be nice to be able to use the SD for commercial purposes, but can do without for now. Hopefully in future though possible.

I like the Teensy a lot, it is great for my own purposes, but the question is can it be used for commercial purposes (sell a product using teensy board) without obligation to share the code.
 
Last edited:
I'm about to wrap this up and publish 1.31. Anyone have any bugs I should look at fixing before 1.31 releases?

It would be nice if the Adafruit_ST7735 library worked if you choose pins that are the CS pins, but right now, I just fall back to the Adafruit driver. Likewise, it would be nice if the 128x128 display support from Adafruit was folded into the driver.

I am seeing some funnyness with Bounce2, but I haven't made a simple test case yet, so don't hold 1.31.
 
Last edited:
Status
Not open for further replies.
Back
Top