ESP32-S2 and VS1053 interrupt problem

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
HelgeSuess
 
Posts: 9
Joined: Tue Feb 27, 2018 7:41 pm

ESP32-S2 and VS1053 interrupt problem

Post by HelgeSuess »

Hi!
I want to play music asynchronously on a VS1053 board (product ID 1381) driven by a Feather ESP32-S2 (product ID 5000).
Synchronous playback works fine but whenever I try to play an mp3 file asynchronously, the ESP32-S2 resets. It seems as if calling the method reading the SD card and filling the playback buffer via SDI doesn't work from within the interrupt.
The ISR routine is called properly (verified by test code) but crashes whenever SDI calls are involved.
Are there special restrictions (interrupt pins, priorities) to be observed in this case?

TIA,
Helge

User avatar
bidrohini
 
Posts: 202
Joined: Thu Oct 20, 2022 10:03 am

Re: ESP32-S2 and VS1053 interrupt problem

Post by bidrohini »

Here is a discussion about a similar problem: viewtopic.php?f=19&t=45856

User avatar
HelgeSuess
 
Posts: 9
Joined: Tue Feb 27, 2018 7:41 pm

Re: ESP32-S2 and VS1053 interrupt problem

Post by HelgeSuess »

Thanks for the link.
The problem seems to be different though.
Whenever I start playing asynchronously, the ESP32-S2 resets like when the reset button is pushed. When I don't use SDI calls in the ISR, it works fine.
For a test, I disconnected DREQ and trigger the interupt with a microswitch. Triggering the interrupt causes a reset immediately, when SDI communication is taking place.
Further test showed, that a single digitalWrite() causes the device to reboot, when the interrupt executes.
Since SDI involves a series of digitalWrite calls, it is guaranteed to fail.

The procedure digitalWrite() has AFAIK several impementations. Some of them switch interupts on and off in order to be atomic. What is the proper implementation of digitalWrite for teh ESP32-S2? How to ensure it is included?

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”