Teensy 4.0 & 4.1
Re: Teensy 4.0 & 4.1
You are welcome.
Maybe to elaborate a bit more. The uSHDC peripheral does not support SPI mode. The machine.SDCard driver is configured to use 4bit SD high speed mode with 50MHz. That should give you superior performance in comparison to the SPI driver. If you can not use it however there is no other option right now but to use the SPI driver. As you rightfully did.
Maybe to elaborate a bit more. The uSHDC peripheral does not support SPI mode. The machine.SDCard driver is configured to use 4bit SD high speed mode with 50MHz. That should give you superior performance in comparison to the SPI driver. If you can not use it however there is no other option right now but to use the SPI driver. As you rightfully did.
Re: Teensy 4.0 & 4.1
I’ve been having intermittent issues with the prototype Teensy firmware. Everything works but frequently I’ll be uploading code to the Teensy and it will brick. I have to reload the firmware to get it running again. I'm using VS Code with Pymakr.Mike Teachman wrote: ↑Mon Feb 07, 2022 5:49 am@rdagger Some good news. I was able to use your driver to make a prototype of the Teensy playing through the audio shield. I committed a new folder "teensy_audio_shield" to this branch:
https://github.com/miketeachman/micropy ... ree/mimxrt
The folder contains a micropython binary for the Teensy4.1 that supports the I2S class, an example program to play a wav file, and your driver with a couple of minor changes (most important change is to the headphone_select() method).
Re: Teensy 4.0 & 4.1
Try mpremote instead, or upload code to the file system and import if from repl. I do not trust pymakr.
- Mike Teachman
- Posts: 155
- Joined: Mon Jun 13, 2016 3:19 pm
- Location: Victoria, BC, Canada
Re: Teensy 4.0 & 4.1
It's possible because it has a lot less flash memory. I'll check if mpremote works better tomorrow.Mike Teachman wrote: ↑Wed Feb 09, 2022 4:46 amYou have a Teensy4.0, but I built the firmware for a Teensy4.1...could that be a possible root cause?
Re: Teensy 4.0 & 4.1
The virtual file system is located from 1 MB upwards.
Hence you are missing 7MB on your Teensy4.0 but your program does not know about it (it is a bit less due to the reserved area at the end of flash memory on the teensy devices - but to keep it simple you are missing 7MB).
When you are loading files to the board that could definitely create issues.
Hence you are missing 7MB on your Teensy4.0 but your program does not know about it (it is a bit less due to the reserved area at the end of flash memory on the teensy devices - but to keep it simple you are missing 7MB).
When you are loading files to the board that could definitely create issues.
Re: Teensy 4.0 & 4.1
Especially since a flash file system should distribute the writes over the whole available memory range to increase flash lifetime.
So I would assume that sometimes it works flawlessly and sometimes it crashes miserably, taking the file system down with it.
So I would assume that sometimes it works flawlessly and sometimes it crashes miserably, taking the file system down with it.
- Mike Teachman
- Posts: 155
- Joined: Mon Jun 13, 2016 3:19 pm
- Location: Victoria, BC, Canada
Re: Teensy 4.0 & 4.1
I committed a firmware file for the Teensy 4.0. Maybe this will give better results?
https://github.com/miketeachman/micropy ... ree/mimxrt
https://github.com/miketeachman/micropy ... ree/mimxrt
Re: Teensy 4.0 & 4.1
Thanks for creating the 4.0 firmware!Mike Teachman wrote: ↑Thu Feb 10, 2022 4:46 amI committed a firmware file for the Teensy 4.0. Maybe this will give better results?
https://github.com/miketeachman/micropy ... ree/mimxrt
Unfortunately, I'm getting the following error:
The error occurs when the audio_out is initialized:ValueError: invalid MCK pin
Code: Select all
MCK_PIN = 23
audio_out = I2S(
I2S_ID,
sck=Pin(SCK_PIN),
ws=Pin(WS_PIN),
sd=Pin(SD_PIN),
mck=Pin(MCK_PIN),
mode=I2S.TX,
bits=WAV_SAMPLE_SIZE_IN_BITS,
format=FORMAT,
rate=SAMPLE_RATE_IN_HZ,
ibuf=BUFFER_LENGTH_IN_BYTES,
)
- Mike Teachman
- Posts: 155
- Joined: Mon Jun 13, 2016 3:19 pm
- Location: Victoria, BC, Canada
Re: Teensy 4.0 & 4.1
The Teensy 4.0 build was missing the MCK pin definitions. I added them, rebuilt the binary, and committed the updated binary. Hopefully it works now.