Teensy based Audio Player Station crashes after a few hours of running.

potzi

New member
Hey people,

so I've built two interactive audio players for a museum. Both use identical hardware.

The hardware setup:
I used a teensy 4.0 with the audio adaptor shield. Additionally there are 12 pushbuttons (0-9, Accept, Delete), which can be used to type in the index of the audio file the visitor would like to hear. For listening there are two Headphones. I've installed a 10k potentiometer for leveling the volume on the audio shield. The whole system is powered by a LiFePo4 battery. It's output is 12,8V which gets stepped down to 5V for the teensy by a stepdown DC/DC converter (LM2596). The files are stored on a micro SD plugged into the audio shield. I've tried different ones as some micro SDs produced occasional audio glitches. Which worked fine are a "Samsung EVO, 32GB, SDHC" and a "SanDisk Ultra, 32GB, SDHC, A1".

While testing, the first station ran without a problem for two weeks straight. But for some reason it stopped working reliably. Now it crashes after a few hours. The first time it crashed, the onboard LED showed a 4 times blink pattern. I was able to reset it by holding the button on the Teensy for 15 seconds. Afterwards I uploaded the code and it was working fine again. Then it crashed again, showing the 4 times blink pattern again. This time I replaced the teensy and SD card, so far it runs without crashing. But I also received the information that the other station, which is already installed at the museum also crashed today 😵‍💫 (As it is further away, I don't know yet if it is also showing the same blink pattern)

Now I am wondering what is causing the crash. If someone here could have a look at my code and tell me if there might be a bug inside, or could point me into a direction for checking the hardware setup I would be super grateful, as I feel a bit clueless right now.

Many thanks in advance,
Matti

P.S. I attached the the first version of the code which I used while the station was running for two weeks without a crash and the newest version which is running now. In the meantime I tried to improve the code and fix potential crash issues, but maybe I have "verschlimmbessert" the code (german for making things worse when you actually wanted to make things better). For the latest version of the code I also translated the comments so it is a bit more understandable.
 

Attachments

  • MainSketch_1-1_ENG_COMMENTS.ino
    7.2 KB · Views: 26
  • MainSketch_1-0.ino
    7.8 KB · Views: 25
The 4 blink code usually indicates a problem with the 24MHz crystal not operating.

There was a problem with some Teensy 4.1's having this issue a couple of months ago which was traced to solder paste contamination left under the crystal during the manufacturing process. They would work for awhile and then crash with the 4 blink code.

Those were fixed by resoldering the 24MHz crystal which cleaned up the solder paste left under it. Not sure if your Teensy 4.0 issue could be the same. Check out this link for more info on that issue. https://forum.pjrc.com/index.php?th...-flash-memory-chip-failure.77743/#post-366445
 
Besides a hardware problem: There could be a chance that the changes of the clock speed cause the error.
 
The 4 blink code usually indicates a problem with the 24MHz crystal not operating.

There was a problem with some Teensy 4.1's having this issue a couple of months ago which was traced to solder paste contamination left under the crystal during the manufacturing process. They would work for awhile and then crash with the 4 blink code.

Those were fixed by resoldering the 24MHz crystal which cleaned up the solder paste left under it. Not sure if your Teensy 4.0 issue could be the same. Check out this link for more info on that issue. https://forum.pjrc.com/index.php?th...-flash-memory-chip-failure.77743/#post-366445
Thank you for your response! :) I've ordered two new teensys now. If it is the crystal issue, I might be able to solve it just by exchanging the teensys for new ones. I will also ask the seller if other buyers reported problems with the teensy 4.0. Once I have the new ones, I will experiment with the old ones and see if the crash still occurs when running a simple sketch for a few days. If it still occurs, I will try the resolder method.
 
Besides a hardware problem: There could be a chance that the changes of the clock speed cause the error.
Thank you as well for responding and reading through my code! :) Do you mean by changing the clock speed between 24 MHz and 600 MHz, as in the first sketch, or setting it to 150 MHz, as in the latest version of my sketch? I was also thinking that frequently changing it might cause issues, so I switched to setting it only once in the setup. However, if that can still cause issues, I'll just leave the clock speed as it is.
 
Thank you as well for responding and reading through my code! :) Do you mean by changing the clock speed between 24 MHz and 600 MHz, as in the first sketch, or setting it to 150 MHz, as in the latest version of my sketch? I was also thinking that frequently changing it might cause issues, so I switched to setting it only once in the setup. However, if that can still cause issues, I'll just leave the clock speed as it is.
I meant the frequently changing. I thought I checked it, but I haven't realized that this has been removed in the second version.

If you should be able to narrow the problem down to a cause, please keep us informed. Could be very helpful for others.

Good luck!
 
If you should be able to narrow the problem down to a cause, please keep us informed. Could be very helpful for others.

Here is a small update already: Apparently one of the audio stations, the one already installed, wasn’t actually broken, maybe the museum staff was confused, I don't know :D

This means, out of three teensies I‘ve used for the project one seems to crash after a certain time with the four blink error. As this one is not in my hands anymore, I will do tests with it once I get it back. As soon as this happens, I will inform you how it went :)

Until then,
Matti
 
Back
Top