Teensyduino 1.54 Beta #3

Status
Not open for further replies.
To avoid confusion with users of 3rd party uploaders I want to mention that (in Serial mode) this update changes the usb device from a CDC class on device level to a composite device with a CDC class function (see also https://forum.pjrc.com/threads/63695-malloc-free-for-EXTMEM-and-DTCM?p=257339&viewfull=1#post257339).

At least the tyTools under Win10 get confused by this change (a issue is already opened). For the tyTools you can work around by using dual or triple serial mode which work as usual. Other 3rd party uploaders / port detection code (e.g. TeensySharp) might also be affected.
 
Last edited:
Win 10 :: Installing TD 1.54b3 over current install left SRC files etc in the SD folder >> T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\SD\

Manually deleted CORES and LIBRARIES and reinstalled and it looks right now.
 
Looking to get ILI9341 and Audio card SD on SPI tested with new SD library:

Building Sketch: ".\Part_3_03_TFT_Display.ino"
Using board 'teensy31' from platform in folder: T:\arduino-1.8.13_t54\hardware\teensy\avr
Using core 'teensy3' from platform in folder: T:\arduino-1.8.13_t54\hardware\teensy\avr

First result is this:
td154_sda.jpg

Code:
"-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\SPI" "T:\\TEMP\\arduino_build_Part_3_03_TFT_Display.ino\\sketch\\Part_3_03_TFT_Display.ino.cpp" -o "T:\\TEMP\\arduino_build_Part_3_03_TFT_Display.ino\\sketch\\Part_3_03_TFT_Display.ino.cpp.o"
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino: In function 'void setup()':
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino:70:17: error: 'AudioMemory' was not declared in this scope
   AudioMemory(10);
                 ^
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino:71:3: error: 'sgtl5000_1' was not declared in this scope
   sgtl5000_1.enable();
   ^
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino:75:9: error: 'SD' was not declared in this scope
   if (!(SD.begin(SDCARD_CS_PIN))) {
         ^
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino: In function 'void loop()':
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino:87:7: error: 'playSdWav1' was not declared in this scope
   if (playSdWav1.isPlaying() == false) {
       ^
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino:97:9: error: 'peak1' was not declared in this scope
     if (peak1.available() && peak2.available()) {
         ^
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino:97:30: error: 'peak2' was not declared in this scope
     if (peak1.available() && peak2.available()) {
                              ^
Using library ILI9341_t3 at version 1.0 in folder: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\ILI9341_t3 
Using library SPI at version 1.0 in folder: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\SPI 
exit status 1
[Finished in 3.5s]
 
Arduino is supposed to ignore the old files in the library directory if a "src" folder is present. It's supposed to only use the stuff in "src". Did it get confused? Or is this just cleanup so the folder look nice?
 
Win 10 :: Installing TD 1.54b3 over current install left SRC files etc in the SD folder >> T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\SD\

Manually deleted CORES and LIBRARIES and reinstalled and it looks right now.

Found that too, deleted SD and re-installed TD1.54b3
 
Arduino is supposed to ignore the old files in the library directory if a "src" folder is present. It's supposed to only use the stuff in "src". Did it get confused? Or is this just cleanup so the folder look nice?

Just to look nice ??? - not knowing 'that rule' - assumed the old stuff would have been cleaned away.
 
Opened IDE instead of 'editor' building in IDE gives same errors - note above the added Audio Tools lines copied were still /* commented out */

Src file of sketch :: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino

Code:
Compiling sketch...
"T:\\arduino-1.8.13_t54\\hardware\\teensy/../tools/precompile_helper" "T:\\arduino-1.8.13_t54\\hardware\\teensy\\avr/cores/teensy3" "T:\\TEMP\\arduino_build_314540" "T:\\arduino-1.8.13_t54\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=154 -DARDUINO=10813 -DARDUINO_TEENSY32 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr/cores/teensy3" "T:\\TEMP\\arduino_build_314540/pch/Arduino.h" -o "T:\\TEMP\\arduino_build_314540/pch/Arduino.h.gch"
"T:\\arduino-1.8.13_t54\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=154 -DARDUINO=10813 -DARDUINO_TEENSY32 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\TEMP\\arduino_build_314540/pch" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\cores\\teensy3" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\ILI9341_t3" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\SPI" "T:\\TEMP\\arduino_build_314540\\sketch\\Part_3_03_TFT_Display.ino.cpp" -o "T:\\TEMP\\arduino_build_314540\\sketch\\Part_3_03_TFT_Display.ino.cpp.o"
Part_3_03_TFT_Display:19: error: 'AudioPlaySdWav' does not name a type
 AudioPlaySdWav           playSdWav1;     //xy=136,65
 ^
Part_3_03_TFT_Display:20: error: 'AudioAnalyzePeak' does not name a type
 AudioAnalyzePeak         peak2;          //xy=348,219
 ^
Part_3_03_TFT_Display:21: error: 'AudioAnalyzePeak' does not name a type
 AudioAnalyzePeak         peak1;          //xy=358,171
 ^
Part_3_03_TFT_Display:22: error: 'AudioOutputI2S' does not name a type
 AudioOutputI2S           i2s1;           //xy=380,92
 ^
Part_3_03_TFT_Display:23: error: 'AudioConnection' does not name a type
 AudioConnection          patchCord1(playSdWav1, 0, i2s1, 0);
 ^
Part_3_03_TFT_Display:24: error: 'AudioConnection' does not name a type
 AudioConnection          patchCord2(playSdWav1, 0, peak1, 0);
 ^
Part_3_03_TFT_Display:25: error: 'AudioConnection' does not name a type
 AudioConnection          patchCord3(playSdWav1, 1, i2s1, 1);
 ^
Part_3_03_TFT_Display:26: error: 'AudioConnection' does not name a type
 AudioConnection          patchCord4(playSdWav1, 1, peak2, 0);
 ^
Part_3_03_TFT_Display:27: error: 'AudioControlSGTL5000' does not name a type
 AudioControlSGTL5000     sgtl5000_1;     //xy=155,192
 ^
Part_3_03_TFT_Display: In function 'void setup()':
Part_3_03_TFT_Display:68: error: 'AudioMemory' was not declared in this scope
   AudioMemory(10);
                 ^
Part_3_03_TFT_Display:69: error: 'sgtl5000_1' was not declared in this scope
   sgtl5000_1.enable();
   ^
Part_3_03_TFT_Display:73: error: 'SD' was not declared in this scope
   if (!(SD.begin(SDCARD_CS_PIN))) {
         ^
Part_3_03_TFT_Display: In function 'void loop()':
Part_3_03_TFT_Display:85: error: 'playSdWav1' was not declared in this scope
   if (playSdWav1.isPlaying() == false) {
       ^
Part_3_03_TFT_Display:95: error: 'peak1' was not declared in this scope
     if (peak1.available() && peak2.available()) {
         ^
Part_3_03_TFT_Display:95: error: 'peak2' was not declared in this scope
     if (peak1.available() && peak2.available()) {
                              ^
Using library ILI9341_t3 at version 1.0 in folder: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\ILI9341_t3 
Using library SPI at version 1.0 in folder: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\SPI 
'AudioPlaySdWav' does not name a type
 
Code:
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino:70:17: error: 'AudioMemory' was not declared in this scope
   AudioMemory(10);

Did you draw the diagram the audio tutorial PDF shows on page 22 and export it to Arduino? (as the 4 steps on page 22 say to do)

Or if you want to just copy the code, click File > Examples > Audio > Tutorial > Reference to get all the Design Tool generated code for every part of the tutorial.

Just know those examples under Audio > Tutorial aren't complete ready-to-run programs. They're the code which supports very specific steps described in the tutorial PDF. You have to actually do those tutorial steps to run those programs.
 
Did you draw the diagram the audio tutorial PDF shows on page 22 and export it to Arduino? (as the 4 steps on page 22 say to do)

Or if you want to just copy the code, click File > Examples > Audio > Tutorial > Reference to get all the Design Tool generated code for every part of the tutorial.

Just know those examples under Audio > Tutorial aren't complete ready-to-run programs. They're the code which supports very specific steps described in the tutorial PDF. You have to actually do those tutorial steps to make then run.

Audio code was copied from the :: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Reference\Reference.ino

Opps - did not copy ::
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

Getting Closer - it is choosing the adafruit sdFat-Beta in libraries now:
Code:
Multiple libraries were found for "Audio.h"
 Used: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio
 Not used: T:\tCode\libraries\Audio_-_Adafruit_Fork
Multiple libraries were found for "SD.h"
 Used: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\SD
 Not used: T:\arduino-1.8.13_t54\libraries\SD
Multiple libraries were found for "SdFat.h"
[B] Used: T:\tCode\libraries\SdFat_-_Adafruit_Fork[/B]
 Not used: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\SdFat-beta

<EDIT> :: BUILDING NOW - need to open 64GB uSD card and get the files on it ...
 
Maybe we should replace the 1 SdCardTest program in Audio > HardwareTesting with a folder and put several ready-to-run test programs in there?

I'm working now to recreate a test from years ago which played 4 short overlapping sound clips. The old SD library was never able to handle it. Back in the days before Teensy 3.5 & 3.6, I wrote that read-only optimized SD lib which could do it, using a cache that could hold several sectors and SPI.beginTransaction & SPI.endTransaction as a sort of mutex for access to the cache.
 
RUNNING WELL - T_3.2 :: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\examples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT_Display.ino

On >> pjrc.com/store/audio_tutorial_kit.html WITH 'small' ILI9341
> Sounds play and cycles
> Peak meter running

NEW FROM PACKAGE :: 64 GB 'TeamGroup' - factory ExFAT formatted

generally safe to say :: Examples on disk are best when ready to run ... of course I had to find my copies of the SDTEST#.wav's

ABOVE at 96 MHz :: Runs just as well COMPILED at 24 MHz
For SIZE ref - ( using DUAL SERIAL so I can use TyCommander from my SublimeText Editor )::
Code:
"T:\\arduino-1.8.13_t54\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-size" -A "T:\\TEMP\\arduino_build_Part_3_03_TFT_Display.ino/Part_3_03_TFT_Display.ino.elf"
[B]Sketch uses 72232 bytes (27%) of program storage space. Maximum is 262144 bytes.
Global variables use 12104 bytes (18%) of dynamic memory, leaving 53432 bytes for local variables. Maximum is 65536 bytes.
[/B]       upload@1741290-Teensy  Uploading to board '1741290-Teensy' (Teensy 3.2)
       upload@1741290-Teensy  Triggering board reboot
       upload@1741290-Teensy  Firmware: Part_3_03_TFT_Display.ino.teensy32.hex
       upload@1741290-Teensy  Flash usage: 71 kiB (27.6%)
       upload@1741290-Teensy  Uploading...
       upload@1741290-Teensy  Sending reset command
estack:20008000 ebss:1fffb04c
[Finished in 40.8s]

@KurtE : that looks like debug print of estack showing on T_3.2

<EDIT> Build note it chose Teensy Audio over the AdaF that came with NRF boards - unlike the sdFat-beta above:
Code:
Alternatives for Audio.h: [Audio@1.3 Audio_-_Adafruit_Fork@1.3.1]
[B]ResolveLibrary(Audio.h)[/B]
  -> candidates: [Audio@1.3 Audio_-_Adafruit_Fork@1.3.1]
"T:\\arduino-1.8.13_t54\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=154 -DARDUINO=10600 -DARDUINO_TEENSY32 -[B]DF_CPU=24000000 -DUSB_DUAL_SERIAL[/B] -DLAYOUT_US_ENGLISH "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\cores\\teensy3" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\ILI9341_t3" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\SPI" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\Audio" "T:\\TEMP\\arduino_build_Part_3_03_TFT_Display.ino\\sketch\\Part_3_03_TFT_Display.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
 
Using TeamGroup exFAT 128GB with 4 SDTEST WAV files and same p#13 sketch Part _3_03_TFT_Display.ino have good Audio and Video Peak Meter at both 24 MHz and 120 MHz

Point to any other samples and they can be tested 64GB or 128GB uSD with :: T_3.2 with PJRC Audio card with SPI SD and SD ILI9341 ...
 
Looks like the startup problems I was seeing may just be a problem with that particular card, a 128GB Samsung EVO (which happens to be a rather old one, was probably very expensive at the time....)

I now have 3 large cards. A 256GB Samsung EVO and a 128GB Sandisk Extreme are starting up properly every time with the JPEG slideshow.
 
its not only src/ but also utility/ where another SdFat.h is located

Yup, Arduino is supposed to ignore that too, when "src" is present.

If anyone can show this mess creates an actual problem with any of the 4 supported versions of Arduino on any platform, I'll do something to fix that problem.

But if the problem is just an aesthetically displeasing mess of files which Arduino ignores, I'm going to just leave the case of installing over an old version as a harmless but unsightly mess.
 
Confirming fix from : File-abstraction-and-SdFat-integration

Using "const int chipSelect = 10;" in :: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\SD\examples\CardInfo\CardInfo.ino

With Above T_3.2 on PJRC Audio tutorial kit - and uncommenting the two SPI MOSI and SCK lines:

SerMon shows:
Code:
Initializing SD card...Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT64

Volume size (Kbytes): 61038592
Volume size (Mbytes): 59608

Initializing SD card...Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT64

Volume size (Kbytes): 123441152
Volume size (Mbytes): 120548

And the 64GB uSD :: Audio Tutorial pots 15,16,17 log on 64GB disk with : ...\SD\examples\Datalogger\Datalogger.ino
Code:
...1,979,26
1,979,24
1,981,25
1,1019,24
1,1018,25
1,1019,24
1,1019,25
1,1019,24
1,1019,24
1,1019,24
1,1019,26
1,1019,26
1,1019,301
1,1019,498
1,1018,771
1,1019,847
1,1019,935
1,1018,1003
...

<EDIT> Logger tested at 96 and now 24 MHz to run well
data okay:
Code:
...
1023,21,37
1023,42,42
780,51,47
628,116,104
561,211,165
472,332,214
418,537,215
401,552,215
403,552,215
402,552,215
395,633,356
256,864,542
197,1018,726
115,1018,842
1,1018,851
1,1018,852
1,1018,857
1,1019,857
...
 
Last edited:
Here are the 6 WAV files meant to be used with the SimultaneousPlay test.
 

Attachments

  • num123456.zip
    908.3 KB · Views: 204
Indeed problematic.

Started leftover at 24 MHz T_3.2 and played once through up to FIVE, but prints NUM6 with ms=3500 delay

Dropping delay 1200 or lower went buzzy starting #3

Moved to 96 MHz and 1200 ms delay buzzes on #5

At 96 with delay(3500) = plays 1-5 then silence, but prints NUM6

Problem is number of open files?

Setting to this give a very annoying overlapping THREE...
Code:
...
const int milliseconds = 200;
...
    playNumber(3);
...

TWO FILES OKAY :: Editing above as below - gives okay (annoying) THREE's with intermittent ONE's - some freq ONE's and occasional silence. Then some time later is just went SILENT as I typed this.
Code:
...
const int milliseconds = 200;
...
    playNumber(1);
    playNumber(3);
...

Also I added write of analog Data values to ILI9341 in DataLogger with no issue.
 
Something is wrong with NUM6.WAV ???

Not the number of files ... (alone)

THIS works, unless the while(1) is removed then it dies screaming in loop() on NUM1:
Code:
void setup() {
...
    playNumber(1);
    playNumber(2);
    playNumber(3);
    playNumber(4);
    playNumber(5);
    //playNumber(6);
    while(1);
    delay(1000);

Where this does not work - even with fewer files:
Code:
void setup() {
...
    playNumber(1);
//    playNumber(2);
//    playNumber(3);
//    playNumber(4);
//    playNumber(5);
    playNumber(6);
    while(1);
    delay(1000);

Zzzzz's
 
I do not yet understand what's going so wrong. But I'm pretty sure all 6 files are good. I created them all the same way with Audacity.
 
Looks like the startup problems I was seeing may just be a problem with that particular card, a 128GB Samsung EVO (which happens to be a rather old one, was probably very expensive at the time....)

I now have 3 large cards. A 256GB Samsung EVO and a 128GB Sandisk Extreme are starting up properly every time with the JPEG slideshow.
Thats good news but maybe should be a warning or note maybe in the wiki or someplace.
 
Thats good news but maybe should be a warning or note maybe in the wiki or someplace.

It very well may just be this 1 individual card, rather than all cards of that make & model. Sounds like several of us have more cards incoming this week, so if it is a problem worth warning, I'd imagine we'll see some other cards do it.

I am planning to write a blog article or web page about the SD / SdFat integration and tips for mixing code and libraries which use the 2 different APIs.
 
PaulStoffregen said:
I am planning to write a blog article or web page about the SD / SdFat integration and tips for mixing code and libraries which use the 2 different APIs.
That will be cool - will definitely help with existing code and developing new code.
 
Status
Not open for further replies.
Back
Top