PDA

View Full Version : Teensyduino 1.54 Beta #3



Paul
11-02-2020, 01:15 AM
Here is a third beta test for Teensyduino 1.54.


Linux 32 bit:
https://www.pjrc.com/teensy/td_154-beta3/TeensyduinoInstall.linux32

Linux 64 bit:
https://www.pjrc.com/teensy/td_154-beta3/TeensyduinoInstall.linux64

Linux ARM:
https://www.pjrc.com/teensy/td_154-beta3/TeensyduinoInstall.linuxarm

Linux ARM64:
(sorry, something is broken on my Jetson TX2....)

MacOS 10.10 to 10.15:
https://www.pjrc.com/teensy/td_154-beta3/Teensyduino_MacOS_Catalina.zip

MacOS 10.8 to 10.14:
https://www.pjrc.com/teensy/td_154-beta3/TeensyduinoInstall.dmg

Windows:
https://www.pjrc.com/teensy/td_154-beta3/TeensyduinoInstall.exe


Changes since Teensyduino 1.54-beta2:

Add File base class and FS.h header
Add SdFat-beta library
Replace SD library with wrapper which uses SdFat
SoftwareSerial improvements on Teensy 3.5, 3.6, 4.1

luni
11-02-2020, 04:46 AM
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 (https://github.com/Koromix/tytools) under Win10 get confused by this change (a issue (https://github.com/Koromix/tytools/issues/64) 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 (https://github.com/luni64/TeensySharp)) might also be affected.

defragster
11-02-2020, 07:33 AM
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.

defragster
11-02-2020, 07:42 AM
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:
22281


"-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\exa mples\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\exa mples\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\exa mples\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\exa mples\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\exa mples\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\exa mples\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\exa mples\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\exa mples\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_t 3
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]

PaulStoffregen
11-02-2020, 07:43 AM
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?

WMXZ
11-02-2020, 07:43 AM
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

defragster
11-02-2020, 07:44 AM
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.

defragster
11-02-2020, 07:47 AM
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\exa mples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT _Display.ino



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\\ILI9 341_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_t 3
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

WMXZ
11-02-2020, 07:47 AM
its not only src/ but also utility/ where another SdFat.h is located

PaulStoffregen
11-02-2020, 07:51 AM
T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\exa mples\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 (https://github.com/PaulStoffregen/AudioWorkshop2015/raw/master/workshop.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.

defragster
11-02-2020, 07:56 AM
Did you draw the diagram the audio tutorial PDF (https://github.com/PaulStoffregen/AudioWorkshop2015/raw/master/workshop.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\exa mples\Tutorial\Reference\Reference.ino

Opps - did not copy ::


#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:


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"
Used: T:\tCode\libraries\SdFat_-_Adafruit_Fork
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 ...

PaulStoffregen
11-02-2020, 08:06 AM
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.

defragster
11-02-2020, 08:17 AM
RUNNING WELL - T_3.2 :: T:\arduino-1.8.13_t54\hardware\teensy\avr\libraries\Audio\exa mples\Tutorial\Part_3_03_TFT_Display\Part_3_03_TFT _Display.ino

On >> pjrc.com/store/audio_tutorial_kit.html (https://www.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 )::


"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"
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.
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:

Alternatives for Audio.h: [Audio@1.3 Audio_-_Adafruit_Fork@1.3.1]
ResolveLibrary(Audio.h)
-> 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 -DF_CPU=24000000 -DUSB_DUAL_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\cores\\teensy3" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\ILI9 341_t3" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\SPI" "-IT:\\arduino-1.8.13_t54\\hardware\\teensy\\avr\\libraries\\Audi o" "T:\\TEMP\\arduino_build_Part_3_03_TFT_Display.ino\ \sketch\\Part_3_03_TFT_Display.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

defragster
11-02-2020, 08:32 AM
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 ...

PaulStoffregen
11-02-2020, 08:48 AM
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.

PaulStoffregen
11-02-2020, 08:56 AM
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.

defragster
11-02-2020, 09:04 AM
Confirming fix from : File-abstraction-and-SdFat-integration (https://forum.pjrc.com/threads/64136-File-abstraction-and-SdFat-integration?p=257842&viewfull=1#post257842)

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

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

SerMon shows:

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


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

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

PaulStoffregen
11-02-2020, 09:43 AM
Looks like I found a couple bugs. I added an Audio > HardwareTesting > SD_Card folder, and in that folder added this SimultaneousPlay test program.

https://github.com/PaulStoffregen/Audio/blob/master/examples/HardwareTesting/SD_Card/SimultaneousPlay/SimultaneousPlay.ino

PaulStoffregen
11-02-2020, 09:45 AM
Here are the 6 WAV files meant to be used with the SimultaneousPlay test.

defragster
11-02-2020, 10:09 AM
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...


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


...
const int milliseconds = 200;
...
playNumber(1);
playNumber(3);
...


Also I added write of analog Data values to ILI9341 in DataLogger with no issue.

defragster
11-02-2020, 10:26 AM
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:


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:


void setup() {
...
playNumber(1);
// playNumber(2);
// playNumber(3);
// playNumber(4);
// playNumber(5);
playNumber(6);
while(1);
delay(1000);


Zzzzz's

PaulStoffregen
11-02-2020, 10:51 AM
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.

mjs513
11-02-2020, 11:13 AM
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.

PaulStoffregen
11-02-2020, 11:39 AM
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.

mjs513
11-02-2020, 11:49 AM
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.

KurtE
11-02-2020, 01:11 PM
Good idea to do a page or blog about SD... Hopefully also a link up on the forum some place.

So far I have the new beta installed W10 64bit... And it is working.

I am sort of curious on the changing the default USB of Serial to now be a composite, as it is now breaking a some utilities like the TyTools.

Hopefully that one will be fixed soon.


So far tested simple SD stuff on a few different cards I have sitting here, like Ulta 32, a 16 and an 8... And so far they are working.

Still wondering about comments in some of the examples like: // Teensy 3.5 & 3.6 & 4.1 on-board: BUILTIN_SDCARD
Especially for T4 which has ability for builtin as well if one has adapter.

PaulStoffregen
11-02-2020, 01:15 PM
BUILTIN_SDCARD should work on Teensy 4.0, if you have the hardware connected. But I haven't personally tested it.

From a documentation point of view where there's 1 line of space, it's simplest to only mention the 3 boards which come with a SD socket.

KurtE
11-02-2020, 01:26 PM
Yep - I ran a couple of card lists now with T4 (with the 4236 adapter... I am guessing that there are not that many who will install external SD readers on these, unless they need it in a smaller footprint....

mjs513
11-02-2020, 04:12 PM
Just ran into an interesting issue with a T3.2.

Use Case:

Adafruit micro-sd breakout - running listfiles on a SansDisk 128mb card works no issue by itself
ILI9488 - graphicstest works no problem by itself
JPECDEC Slideshow on a ILI9488 get the error message "Unable to Open SD Card" - initialization issue:)
JPECDEC Slideshow on a ILI9341 get the error message "Unable to Open SD Card" - initialization issue:)

KurtE
11-02-2020, 05:04 PM
Hi @mjs513 - I don't remember but I think the ILI9488 has issues with MISO pin? Wonder if you disconnect it from the display will it work?

Note I have a couple of these displays.
One from BuyDisplay and another from Ebay.

Another FYI: Saturday I ordered another one from Ebay: https://www.ebay.com/itm/333754817506
There appears to be many listings out there for probably the same display.

But may try to set one up...

bicycleguy
11-02-2020, 05:11 PM
Installed on macOS Catalina 10.15.7
My older programs compiled and seem to run well. Get this new warning:

n file included from /Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/arm-none-eabi/include/sys/stat.h:9:0,
from /Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/arm-none-eabi/include/sys/_default_fcntl.h:188,
from /Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/arm-none-eabi/include/sys/fcntl.h:4,
from /Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/arm-none-eabi/include/fcntl.h:1,
from /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SdFat-beta/src/ExFatLib/../common/FsApiConstants.h:30,
from /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SdFat-beta/src/ExFatLib/ExFatFile.h:36,
from /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SdFat-beta/src/ExFatLib/ExFatVolume.h:28,
from /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SdFat-beta/src/ExFatLib/ExFatLib.h:27,
from /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SdFat-beta/src/SdFat.h:33,
from /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/src/SD.h:6,
from /Users/michaelrunyan/Documents/Arduino/myT4multisensor/myT4multisensor.ino:12:
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Time/time.h:1:2: warning: #warning "Please include TimeLib.h, not Time.h. Future versions will remove Time.h" [-Wcpp]
#warning "Please include TimeLib.h, not Time.h. Future versions will remove Time.h"

myT4multisensor.ino:12: is #include <TimeLib.h>

mjs513
11-02-2020, 06:03 PM
Hi @mjs513 - I don't remember but I think the ILI9488 has issues with MISO pin? Wonder if you disconnect it from the display will it work?

Note I have a couple of these displays.
One from BuyDisplay and another from Ebay.

Another FYI: Saturday I ordered another one from Ebay: https://www.ebay.com/itm/333754817506
There appears to be many listings out there for probably the same display.

But may try to set one up... @KurtE - darn it - forgot about that - but thats probably it - when I designed my boards I used a tri-state buffer to get it to work - damn - maybe will try another display

WMXZ
11-02-2020, 06:06 PM
Installed on macOS Catalina 10.15.7
My older programs compiled and seem to run well. Get this new warning:


#warning "Please include TimeLib.h, not Time.h. Future versions will remove Time.h"


this will stay to be there until all libraries remove Time.h, or you are not using Windows, or you delete TimeLib library

KurtE
11-02-2020, 07:25 PM
@KurtE - darn it - forgot about that - but thats probably it - when I designed my boards I used a tri-state buffer to get it to work - damn - maybe will try another display

Ok I installed the library JPEGDEC

Put some JPG files (case sensitive in the example sketch) edited the sketch to use ST7735_t3/ST7789 library and tried it with T3.5 using both Built in SD as well as the SD slot on the 240x320 Adafruit display. And it appears to be working.,

mjs513
11-02-2020, 07:46 PM
Ok I installed the library JPEGDEC

Put some JPG files (case sensitive in the example sketch) edited the sketch to use ST7735_t3/ST7789 library and tried it with T3.5 using both Built in SD as well as the SD slot on the 240x320 Adafruit display. And it appears to be working.,

Cool that was my next try - did try the HX display but for some reason not working with the t3.2. Right now trying the tristate buffer but that didnt work with the ILI9488 with the t3,2

Think will have to try with T3.5 next

KurtE
11-02-2020, 08:16 PM
Cool that was my next try - did try the HX display but for some reason not working with the t3.2. Right now trying the tristate buffer but that didnt work with the ILI9488 with the t3,2

Think will have to try with T3.5 next

I swapped in T3.2 for 3.5 and so far it appears to work ST7789...

Sketch:

// A simple image slideshow which reads all the .JPG files from the root
// directory of a SD card and shows each for 1 second on an ILI9341 display.

#include <JPEGDEC.h>
#include <ST7735_t3.h>
#include <ST7789_t3.h>

#include <Bounce.h>
#include <SD.h>

#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10

ST7789_t3 tft = ST7789_t3(TFT_CS, TFT_DC, TFT_RST);
JPEGDEC jpeg;

// Setup - initialize ILI9341 display, wait for serial monitor, open SD card
void setup() {
pinMode(34, INPUT_PULLDOWN);
pinMode(33, OUTPUT);
digitalWrite(33, HIGH); // pushbuttons short pins 33 & 34 together
Serial.begin(115200);
tft.init(240, 320); // Init ST7789 2.0" 320x240
tft.setRotation(0);
tft.fillScreen(ST77XX_BLACK);
tft.setTextColor(ST77XX_YELLOW);
tft.setTextSize(2);
tft.println("Waiting for Arduino Serial Monitor...");

while (!Serial && millis() < 3000); // wait up to 3 seconds for Arduino Serial Monitor
Serial.println("ILI9341 Slideshow");
tft.fillScreen(ST77XX_BLACK);
tft.setCursor(0, 0);

while (!SD.begin(4/*BUILTIN_SDCARD*/)) {
Serial.println("Unable to access SD Card");
tft.println("Unable to access SD Card");
delay(1000);
}
}

// Functions to access a file on the SD card
File myfile;

void * myOpen(const char *filename, int32_t *size) {
myfile = SD.open(filename);
*size = myfile.size();
return &myfile;
}
void myClose(void *handle) {
if (myfile) myfile.close();
}
int32_t myRead(JPEGFILE *handle, uint8_t *buffer, int32_t length) {
if (!myfile) return 0;
return myfile.read(buffer, length);
}
int32_t mySeek(JPEGFILE *handle, int32_t position) {
if (!myfile) return 0;
return myfile.seek(position);
}

// Function to draw pixels to the display
void JPEGDraw(JPEGDRAW *pDraw) {
//Serial.printf("jpeg draw: x,y=%d,%d, cx,cy = %d,%d\n",
//pDraw->x, pDraw->y, pDraw->iWidth, pDraw->iHeight);
tft.writeRect(pDraw->x, pDraw->y, pDraw->iWidth, pDraw->iHeight, pDraw->pPixels);
}

// Main loop, scan for all .JPG files on the card and display them
void loop() {
int filecount = 0;
tft.setCursor(0, 0);
File dir = SD.open("/");
while (true) {
File entry = dir.openNextFile();
if (!entry) break;
if (entry.isDirectory() == false) {
const char *name = entry.name();
const int len = strlen(name);
if (len > 3 && strcmp(name + len - 3, "JPG") == 0) {
Serial.print("File: ");
Serial.println(name);
tft.print("File: ");
tft.println(name);
jpeg.open((const char *)name, myOpen, myClose, myRead, mySeek, JPEGDraw);
jpeg.decode(0, 0, 0);
jpeg.close();
filecount = filecount + 1;
if (digitalRead(34) == LOW) {
// skip delay between images when pushbutton is pressed
delay(1000);
}
}
}
entry.close();
}
if (filecount == 0) {
Serial.println("No .JPG files found");
tft.println("No .JPG files found");
delay(2000);
}
}
Note: the line in RED where I edited the CS pin... Probably should move to #define... But...

mjs513
11-02-2020, 08:47 PM
I swapped in T3.2 for 3.5 and so far it appears to work ST7789...

Note: the line in RED where I edited the CS pin... Probably should move to #define... But...

Ok with a tri-state buffer doesn't seem to work. So I added a tri-state buffer to the MISO line on the ILI9488 and tested with an external card on the T3.2, T3.5 and T4.1:
1. T3.2: No luck - keep getting a Unable to access the SDCARD
2. Swapped the T3.2 with a T3.5 and worked like a charm - Displays JPEG images and reads from the external card no problem.
3. Swapped the T4.1 for the T3.5 and again no issue with the external card and JPEG demo sketch with the external card.

KurtE
11-02-2020, 09:05 PM
@mjs513 - What size card? I am using 8gb one. right now...

But wonder if memory issue by size of card?

mjs513
11-02-2020, 09:05 PM
Testing with SansDisk Extreme 512Gbmicro SD:

Builtin_SDCARD Cardinfo:

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

Card type: SDHC
Volume type is FAT64

Volume size (Kbytes): 499806208
Volume size (Mbytes): 488092


Extern Card Reader:


Initializing SD card...Wiring is correct and a card is present.
Card type: SDHC
Volume type is FAT64
Volume size (Kbytes): 499806208
Volume size (Mbytes): 488092


Also tried it with the ILI9341_slideshow JPEG sketch and read and displayed no issues

So far it seems to be working as tested

mjs513
11-02-2020, 09:06 PM
@mjs513 - What size card? I am using 8gb one. right now...

But wonder if memory issue by size of card? Using my standard 32gb card. As long as I am not accessing the display it does read the card. Not sure what is going on - power issue - clocking?

EDIT: remember this is with a ILI9488 display and a tristate buffer.

WMXZ
11-03-2020, 04:57 AM
Testing with SansDisk Extreme 512Mb micro SD:

512 Gb, right?

defragster
11-03-2020, 06:01 AM
8 hour run of edited :: ...examples\SimultaneousPlay\SimultaneousPlay.ino

Only cycling through 4 WAV's on T_3.2 on Audio Kit from a 64GB uSD. Odd note is the pulsing of the ILI9341 backlight. It is running from 5V USB

The four WAV's are NUM 1, 2 and 3 and the fourth added as NUM0==playNumber(0); is renamed SDTEST1.WAV - the 16KB song.

Running in loop w/3500 ms delay the song starts and then 3.5s intervals nums 1, 2 and 3 are merged - then it restarts.

So it seems Longer term all is well - it is just the init and startup beyond some point of added WAV's.

Also I renamed the NUM6 file and then copied NUM1 again as NUM6 - and that still wouldn't help it work in cycling as tried ??? So it isn't the NUM6=='SIX' audio file as the problem.

@Paul - not sure what final param here is to do ? Should be numbered 0-3 to associate properly per mixer?

AudioConnection patchCord1(playSdWav6, 0, mixer1, 3);
AudioConnection patchCord2(playSdWav3, 0, mixer1, 2);
AudioConnection patchCord3(playSdWav5, 0, mixer2, 1);
AudioConnection patchCord4(playSdWav4, 0, mixer2, 2);
AudioConnection patchCord0(playSdWav0, 0, mixer2, 2);
AudioConnection patchCord5(playSdWav2, 0, mixer1, 1);
AudioConnection patchCord6(playSdWav1, 0, mixer1, 0);


It works as above where :: mixer2, 2
is duplicated - but if I move it to : patchCord0(playSdWav0, 0, mixer2, 0);

It fails to even start up playing ???

Of course I cannot play SdWav4 like this

WMXZ
11-03-2020, 06:50 AM
not sure what final param here is to do ? Should be numbered 0-3 to associate properly per mixer?


I guess you know that the AudioConnection if defining link between (Object, OutChannel -> Object, InChannel)

defragster
11-03-2020, 07:16 AM
I guess you know that the AudioConnection if defining link between (Object, OutChannel -> Object, InChannel)

Indeed that was my assumption - clicked a few times on pjrc.com audio and it wasn't spelled out - and didn't get as far as to look at the code.

Which suggests it is a problem when these - wrong - values works better:


AudioConnection patchCord4(playSdWav4, 0, mixer2, 2);
AudioConnection patchCord0(playSdWav0, 0, mixer2, 2);

Than this does? - though as noted above when playSdWav4 not played:


AudioConnection patchCord4(playSdWav4, 0, mixer2, 2);
AudioConnection patchCord0(playSdWav0, 0, mixer2, 0);

Assuming also it is ZERO based following that portion Paul created when posting the sketch.

Was hoping - if relevant - it would trigger something with Paul in the setup/handling of the linkages.

Also found that when Meter + probe in wrong jack (for current measure) it shorts probes and kills Teensy trying to measure voltage. Wanted to see the 3.3V on the ili9341 that was pulsing the LED backlight as it played.

>> What I saw was shorting those restarted the Teensy - and on restart what played for 8 hours would not - even after proper power off restart until it was reprogrammed ??? Maybe if put the uSD processor in an odd state? But read only - and it went back to working only with fresh upload ???

defragster
11-03-2020, 07:16 AM
I guess you know that the AudioConnection if defining link between (Object, OutChannel -> Object, InChannel)

Indeed that was my assumption - clicked a few times on pjrc.com audio and it wasn't spelled out - and didn't get as far as to look at the code.

Which suggests it is a problem when these - wrong - values works better:


AudioConnection patchCord4(playSdWav4, 0, mixer2, 2);
AudioConnection patchCord0(playSdWav0, 0, mixer2, 2);

Than this does? - though as noted above when playSdWav4 not played:


AudioConnection patchCord4(playSdWav4, 0, mixer2, 2);
AudioConnection patchCord0(playSdWav0, 0, mixer2, 0);

Assuming also it is ZERO based following that portion Paul created when posting the sketch.

Was hoping - if relevant - it would trigger something with Paul in the setup/handling of the linkages.

Also found that when Meter + probe in wrong jack (for current measure) it shorts probes and kills Teensy trying to measure voltage. Wanted to see the 3.3V on the ili9341 that was pulsing the LED backlight as it played.

>> What I saw was shorting those restarted the Teensy - and on restart what played for 8 hours would not - even after proper power off restart until it was reprogrammed ??? Maybe if put the uSD processor in an odd state? But read only - and it went back to working only with fresh upload ???

PaulStoffregen
11-03-2020, 07:19 AM
Well, this was an embarrassing little mistake!

https://github.com/PaulStoffregen/Audio/commit/6ab951bfcf3a978b1a62e7b45053e1349890a0e6

With this fix, all 6 files should play. Well, at least as long as you don't try to go too fast - which is the issue I meant to test...

mjs513
11-03-2020, 07:35 AM
512 Gb, right?
Oops 512gb. Have to fix

defragster
11-03-2020, 08:52 AM
Is this a double use of mixer2 4th param with channel '1':


AudioConnection patchCord3(playSdWav5, 0, mixer2, 1);
...
AudioConnection patchCord9(mixer2, 0, i2s1, 1);


Well, this was an embarrassing little mistake!

https://github.com/PaulStoffregen/Audio/commit/6ab951bfcf3a978b1a62e7b45053e1349890a0e6

With this fix, all 6 files should play. Well, at least as long as you don't try to go too fast - which is the issue I meant to test...

Indeed it does - that explains last file#6 seeming broken.

T_3.2 works at :: const int milliseconds = 1800; , But not much below that.

Something odd - removed 64GB card and put '6' back instead of renamed file - then plugged and repowered and got noise before it got to 6, where it was working on prior file. Had to reupload and it works again ... something seems on the edge?

BUZZ noise varies - supposing that is request for SD to fill buffer not complete when buffer is needed so it then running on a void or ill formed buffer - then it breaks?

Very odd that 4 playNumber( # ) sequentially CAN work [it varies upload to upload :( ] with NO DELAY - because at least one valid buffer is ready, but multiple numbers are overlaid audibly well. But putting even 1ms delay between them allows one to fail and it gets lost and goes buzzy.

If so - I don't suppose there is a way to make a persistent 'silent' (?) buffer to set as a placeholder *ptr until the SD card data fills a usable buffer? Still 'broken' - but fail gracefully when SD data not ready?


In testing have had multiples playing/mixing at once, the SDTEST1.WAV to make the numbers less boring.
Trying to add that again as last in the list and the next to last number gets elevated volume - and then either skips the song or goes buzzy.
Just noted above mixer channel re-use? So two 4 ch mixers won't allow for a 7th sample with two i2s channels?

PaulStoffregen
11-03-2020, 09:08 AM
Here's a patch which greatly improves the WAV simultaneous playback.

https://github.com/PaulStoffregen/Audio/commit/6369a6ae1f3b6ea547a5192f9bf7efe3b778a629

I'm not sure if this solves 100% of the issues. But it is playing on my workbench right now with the delay at only 300 ms.

PaulStoffregen
11-03-2020, 09:34 AM
Is this a double use of mixer2 4th param with channel '1':


AudioConnection patchCord3(playSdWav5, 0, mixer2, 1);
...
AudioConnection patchCord9(mixer2, 0, i2s1, 1);

Nope, it's correct because the 1st & 2nd parameters are the connection's source and the 3rd & 4th parameters are the connection's destination.

This is the drawing from the design tool which generated those connections.

22299

mjs513
11-03-2020, 11:56 AM
@mjs513 - What size card? I am using 8gb one. right now...

But wonder if memory issue by size of card?

Ok did a bit more testing this morning on the T3.2 using a 32GB sd card using the ST7789 240x320 display.

Tried 2 different external readers and the internal reader and all three cases failed. Can't find any of my small cards so will have to punt on this.


EDIT: Got it finally working but had to change the clock speed from 24Mhz to 16Mhz in the library.

Paul - think you may need to make the clock speed part of the sd.begin call instead of making it a fixed value.

PaulStoffregen
11-03-2020, 12:08 PM
I'm currently working on 3 serial monitor bugs....

1: Printing a very long line forces horizontal scroll

2: Copy to clipboard gives double spaced lines

3: Memory leak on MacOS with repeated reopening of window

mjs513
11-03-2020, 12:31 PM
@KurtE


Ok did a bit more testing this morning on the T3.2 using a 32GB sd card using the ST7789 240x320 display.

Tried 2 different external readers and the internal reader and all three cases failed. Can't find any of my small cards so will have to punt on this.


EDIT: Got it finally working but had to change the clock speed from 24Mhz to 16Mhz in the library.

Paul - think you may need to make the clock speed part of the sd.begin call instead of making it a fixed value.

Just a quick update. Retested ILI9341 and ILI9488 (with tri-state buffer chip on MISO line) at 16Mhz clock with a 32Gb SD card on a T3.2. SUCCESS - both are working at the lower clock speed. Running the JPEG Slideshow sketch without an issue.

As a test I inserted the 512Gb card and its working with the clock at 16Mhz.

mjs513
11-03-2020, 12:32 PM
I'm currently working on 3 serial monitor bugs....

1: Printing a very long line forces horizontal scroll

2: Copy to clipboard gives double spaced lines

3: Memory leak on MacOS with repeated reopening of window

Great and good luck - besides issue 2 noticed issue 1 as well which was a bit annoying but didn't remember if it did it before or not so never reported it. Sorry.

WMXZ
11-03-2020, 12:46 PM
Paul - think you may need to make the clock speed part of the sd.begin call instead of making it a fixed value.

You always can use sd.sdfs.begin(...) to directly accesss the SdFat begin

KurtE
11-03-2020, 12:52 PM
@KurtE
Just a quick update. Retested ILI9341 and ILI9488 (with tri-state buffer chip on MISO line) at 16Mhz clock with a 32Gb SD card on a T3.2. SUCCESS - both are working at the lower clock speed. Running the JPEG Slideshow sketch without an issue.

As a test I inserted the 512Gb card and its working with the clock at 16Mhz.
Maybe I will have to play again. I found I had an Sparkfun external SD reader and could not get it to do anything with T3.2... Did not try with anything else yet.
I think it is this one: https://www.sparkfun.com/products/13743

But for example it failed to init... I just retried it with 16 still failing, but need to double check what state I left the wiring in...

I assume you changed the line: return sdfs.begin(SdSpiConfig(csPin, SHARED_SPI, SD_SCK_MHZ(16)));

mjs513
11-03-2020, 01:07 PM
Maybe I will have to play again. I found I had an Sparkfun external SD reader and could not get it to do anything with T3.2... Did not try with anything else yet.
I think it is this one: https://www.sparkfun.com/products/13743

But for example it failed to init... I just retried it with 16 still failing, but need to double check what state I left the wiring in...

I assume you changed the line: return sdfs.begin(SdSpiConfig(csPin, SHARED_SPI, SD_SCK_MHZ(16)));

Yep thats what I did. You could also do what @WMXZ suggested and use SD.sdfs.begin(SdSpiConfig(csPin, SHARED_SPI, SD_SCK_MHZ(16))) directly in place of
SD.begin(ChipSelect).

For reference I have the breakout from Adafruit https://www.adafruit.com/product/254 that I have been using, also the one been using the Teensy backpack SD Card reader from @brtaylor.


You always can use sd.sdfs.begin(...) to directly accesss the SdFat begin Yep I agree. Just thought if you include it in the SD.begin function it would be more consistent even though its not currently in the SD lib so you wouldn't have to mix and match. 24Mhz seems to work fine for T3.5 and above.

WMXZ
11-03-2020, 01:22 PM
Yep I agree. Just thought if you include it in the SD.begin function it would be more consistent even though its not currently in the SD lib so you wouldn't have to mix and match. 24Mhz seems to work fine for T3.5 and above.

Originally, I thought that too and started a PR, but then realized that this is becoming too difficult (SDClass, FS, etc) and Paul commented on PR saying that sdfs is public exactly for that purpose. PR is closed now.

PaulStoffregen
11-03-2020, 01:32 PM
Ok, 16 MHz sounds fine a safe default.

https://github.com/PaulStoffregen/SD/commit/159feec5a78e6cef5d0134c908d8fd50079f5171

mjs513
11-03-2020, 01:41 PM
Ok, 16 MHz sounds fine a safe default.

https://github.com/PaulStoffregen/SD/commit/159feec5a78e6cef5d0134c908d8fd50079f5171

Sounds good - just double checked it with the TeensyBackpack SD card reader with the ILI9488 and its working at 16Mhz as well. So at least that's with 2 different card readers.

KurtE
11-03-2020, 02:23 PM
I think my Sparkfun one might be DOA... Never had any luck with it.

Actually I just redid it again and it worked, with: two different cards: an old Kingston 16GB and a Sandisk Ultra 32gb.

But a Samsung32 EVO Select fails on the external Sparkfun unit:

Initializing SD card...initialization failed!


But works on T3.5 Built in:


Initializing SD card...initialization done.
overlays/
adau7002-simple.dtbo 1587
README 113431
act-led.dtbo 569
adau1977-adc.dtbo 1027
akkordion-iqdacplus.dtbo 1387
ads1015.dtbo 2425
ads1115.dtbo 2425
ads7846.dtbo 2402
adv7282m.dtbo 1952
adv728x-m.dtbo 2436
audioinjector-addons.dtbo 1866
anyspi.dtbo 3895
allo-boss-dac-pcm512x-audio.dtbo 1473
allo-digione.dtbo 1208
allo-katana-dac-audio.dtbo 1659
allo-piano-dac-pcm512x-audio.dtbo 1011
allo-piano-dac-plus-pcm512x-audio.dtbo 1585
...

fixup4db.dat 9192
fixup4x.dat 9192
fixup_cd.dat 2656
fixup_db.dat 9817
fixup_x.dat 9819
kernel.img 5142912
kernel7.img 5424376
kernel7l.img 5757200
kernel8.img 13521408
start.elf 2883204
start4.elf 2784800
start4cd.elf 784316
start4db.elf 4593508
start4x.elf 3546468
start_cd.elf 690884
start_db.elf 4859912
start_x.elf 3797384
System Volume Information/
WPSettings.dat 12
IndexerVolumeGuid 76
done!

Note: I took this SD card from an RPI3 or 4 don't remember which and or if it was for Ubuntu or Raspian...

But if someone else has an RPI image you might try it as well...

EDIT: Just as an FYI - Looking at the Sparkfun page for this unit, it mentions:

If your processor is capable of it, this board supports the use of even the fastest UHS µSD cards. We only tested to 25MHz, but it should be good to two to four times that. Today most Arduino type µControllers are only capable of SPI_HALF_SPEED (6Mbps). Consider this board if you want a little future proofing or have a faster setup. The Arduino SD library is capable of SPI_FULL_SPEED (25Mbps).

The SparkFun Shifting µSD is also a bit unique from its competitors in that it is bi-directional - it level translates all of its outputs back to the level of the hardware it's connected to.
Note looks like a TXB104 they are using

mjs513
11-03-2020, 02:34 PM
@KurtE
The 32gb card I am using has a Rpi4 Ubuntu image on it and seems to work. The EVO version of the SDCards seem to have a problem - think Paul was having the same issue with Lexar? EVO card.

Looks like the level shifter for the Adafruit board is a CD74HC4050. Not sure what the difference

PaulStoffregen
11-03-2020, 07:46 PM
After much more fiddling, it's looking like the only way to get rid of the serial monitor double spacing on copy to clipboard is to filter away the carriage return chars before they get into the FifoDocument data storage. While Sun tried to design a highly flexible API between the Document class and JTextComponent, it's becoming pretty clear there's code buried deep in Java that expects the internal storage to the unix style newlines.

It's pretty clear there are multiple platform specific translations going on behind the scenes. The really frustrating part is how poorly this behavior is documented in all the Java docs. :(

I'm going to put this into the teensy_ports helper program, since this is much more efficient to do in C than Java.

defragster
11-03-2020, 07:58 PM
After much more fiddling, it's looking like the only way to get rid of the serial monitor double spacing on copy to clipboard is to filter away the carriage return chars before they get into the FifoDocument data storage. While Sun tried to design a highly flexible API between the Document class and JTextComponent, it's becoming pretty clear there's code buried deep in Java that expects the internal storage to the unix style newlines.

It's pretty clear there are multiple platform specific translations going on behind the scenes. The really frustrating part is how poorly this behavior is documented in all the Java docs. :(

I'm going to put this into the teensy_ports helper program, since this is much more efficient to do in C than Java.

What a pain with both '\r','\n' in there. On Windows using .print('\n') instead of .println() works well/as intended for SerMon's.

Does Mac or Linux require "\r\n" both be present? If required println() can't just be made '\n' - though changing that would be ... a Change ... for both UART and USB usage.

PaulStoffregen
11-03-2020, 08:36 PM
Changing the behavior of the Arduino Print class is not an option! While convenient for this particular serial monitor issue, that sort of change could break countless programs which depend on the Print class for writing to files on SD cards and other media, for transmitting data over Ethernet, for hardware serial protocols and so many more applications. It would probably even break using non-Arduino terminal emulators like Coolterm on Windows & Macintosh and seyon on Linux.

defragster
11-03-2020, 08:46 PM
Changing the behavior of the Arduino Print class is not an option! While convenient for this particular serial monitor issue, that sort of change could break countless programs which depend on the Print class for writing to files on SD cards and other media, for transmitting data over Ethernet, for hardware serial protocols and so many more applications. It would probably even break using non-Arduino terminal emulators like Coolterm on Windows & Macintosh and seyon on Linux.

Good answer, indeed not valid to change, thanks. - asked before and still wondering since KurtE brought up last year(s). So fix would have to be through resultant IDE Copy/Paste data xfer.

KurtE
11-03-2020, 10:20 PM
And Now for something completely Random ;) What else is new :D

A few days ago when answering another question, I was suprised that we did not have a T4.x GPIO structure defined in imxrt.h....

So I did a quick and dirty:


typedef struct {
volatile uint32_t DR; // 00
volatile uint32_t GDIR; // 04
volatile uint32_t PSR; // 08
volatile uint32_t ICR1; // 0C
volatile uint32_t ICR2; // 10
volatile uint32_t IMR; // 14
volatile uint32_t ICR; // 18
volatile uint32_t EDGE_SEL; // 1C
uint32_t UNUSED[25]; // 20 - 83
volatile uint32_t DR_SET; // 84
volatile uint32_t DR_CLEAR; // 88
volatile uint32_t DR_TOGGLE; // 8C

} IMXRT_GPIO_t;
#define IMXRT_GPIO1S (*(IMXRT_GPIO_t *)0x401B8000)
#define IMXRT_GPIO2S (*(IMXRT_GPIO_t *)0x401BC000)
#define IMXRT_GPIO3S (*(IMXRT_GPIO_t *)0x401C0000)
#define IMXRT_GPIO4S (*(IMXRT_GPIO_t *)0x401C4000)
#define IMXRT_GPIO5S (*(IMXRT_GPIO_t *)0x400C0000)
#define IMXRT_GPIO6S (*(IMXRT_GPIO_t *)0x42000000)
#define IMXRT_GPIO7S (*(IMXRT_GPIO_t *)0x42004000)
#define IMXRT_GPIO8S (*(IMXRT_GPIO_t *)0x42008000)
#define IMXRT_GPIO9S (*(IMXRT_GPIO_t *)0x4200C000)


I did a quick and dirty to verify that unused of 25 was correct, plus blink an LED...

void setup() {
while (!Serial);
Serial.begin(115200);
delay(2);
IMXRT_GPIO_t *pgpio = nullptr;
Serial.println((uint32_t)(&(pgpio->DR_SET)), HEX);
pinMode(13, OUTPUT);
}

void loop() {
IMXRT_GPIO7S.DR_TOGGLE = (1<<3);
delay(250);
}
And my LED is blinking...

Question is, is this something we should do a PR for?
And if So, Should I also go through and change the defines like this:


#define GPIO2_DR (IMXRT_GPIO2.offset000)
#define GPIO2_GDIR (IMXRT_GPIO2.offset004)
#define GPIO2_PSR (IMXRT_GPIO2.offset008)
#define GPIO2_ICR1 (IMXRT_GPIO2.offset00C)
#define GPIO2_ICR2 (IMXRT_GPIO2.offset010)
#define GPIO2_IMR (IMXRT_GPIO2.offset014)
#define GPIO2_ISR (IMXRT_GPIO2.offset018)
#define GPIO2_EDGE_SEL (IMXRT_GPIO2.offset01C)
#define GPIO2_DR_SET (IMXRT_GPIO2.offset084)
#define GPIO2_DR_CLEAR (IMXRT_GPIO2.offset088)
#define GPIO2_DR_TOGGLE (IMXRT_GPIO2.offset08C)

To more like:


#define DR (IMXRT_GPIO1.DR)
#define GPIO1_DR (IMXRT_GPIO1.DR)
#define GPIO1_GDIR (IMXRT_GPIO1.GDIR)
#define GPIO1_PSR (IMXRT_GPIO1.PSR)
#define GPIO1_ICR1 (IMXRT_GPIO1.ICR1)
#define GPIO1_ICR2 (IMXRT_GPIO1.ICR2)
#define GPIO1_IMR (IMXRT_GPIO1.IMR)
#define GPIO1_ISR (IMXRT_GPIO1.ISR)
#define GPIO1_EDGE_SEL (IMXRT_GPIO1.EDGE_SEL)
#define GPIO1_DR_SET (IMXRT_GPIO1.DR_SET)
#define GPIO1_DR_CLEAR (IMXRT_GPIO1.DR_CLEAR)
#define GPIO1_DR_TOGGLE (IMXRT_GPIO1.DR_TOGGLE)

PaulStoffregen
11-04-2020, 01:41 AM
To more like:



#define GPIO1_DR (IMXRT_GPIO1.DR)
#define GPIO1_GDIR (IMXRT_GPIO1.GDIR)
#define GPIO1_PSR (IMXRT_GPIO1.PSR)
#define GPIO1_ICR1 (IMXRT_GPIO1.ICR1)
#define GPIO1_ICR2 (IMXRT_GPIO1.ICR2)
#define GPIO1_IMR (IMXRT_GPIO1.IMR)
#define GPIO1_ISR (IMXRT_GPIO1.ISR)
#define GPIO1_EDGE_SEL (IMXRT_GPIO1.EDGE_SEL)
#define GPIO1_DR_SET (IMXRT_GPIO1.DR_SET)
#define GPIO1_DR_CLEAR (IMXRT_GPIO1.DR_CLEAR)
#define GPIO1_DR_TOGGLE (IMXRT_GPIO1.DR_TOGGLE)



Yes, like that (not using a new name "IMXRT_GPIO1S"). Maybe someday all the peripherals will get this treatment. I created everything with those offset defines a couple years ago to save time (just making the first imxrt.h took several days) and make double checking against the reference manual easier.

Send a PR if you'd like to see this in beta4. This stuff is pretty much at the very bottom of my priority list, but I'll merge it if you send it.

KurtE
11-04-2020, 02:35 AM
Sent in PR. No high priority, but again wondered, and so did... Had to change interrupt.c as well as it had #define statements for some of the register names, like DR, PSR...

PaulStoffregen
11-04-2020, 03:05 AM
I already packaging up beta4 and I'm editing the changelog now while waiting on Raspberry Pi build and Apple notarization. Unless something goes really wrong with testing tonight or tomorrow, that PR will get merged into beta5.