0

ESP32 Huzzah32 & Featherwing Music Maker panic'ed
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by imruffsdad on Sun Aug 01, 2021 2:37 pm

I'm a newbie, so forgive me if I'm being an idiot. I played around with the ESP32 Feather Board and was able to connect and upload from Ardunio and it worked.
I then attached the Music Maker FeatherWing and loaded the simple Example following the instructions on Adafruit including making the code changes and when I go to upload I get:
Adafruit VS1053 Simple Test
Guru Meditation Error: Core 1 panic'ed (banned spam word). Exception was unhandled.
Memory dump at 0x40126efc:

I then tried the player_interrupts example and received the following:
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)
Core 1 register dump:
PC : 0x4000c271 PS : 0x00060034 A0 : 0x80086c14 A1 : 0x3ffb1e20
A2 : 0x3ffb0058 A3 : 0x3f4059fc A4 : 0x00000014 A5 : 0x3ffbebf0
A6 : 0x3ffbec38 A7 : 0x00000001 A8 : 0x00000001 A9 : 0x3f4059fd
A10 : 0x000000a5 A11 : 0xff000000 A12 : 0x800877a3 A13 : 0x3ffbebc0
A14 : 0x00000008 A15 : 0x00000001 SAR : 0x00000019 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x4000c271:0x3ffb1e20 0x40086c11:0x3ffb1e40 0x4008858c:0x3ffb1e60 0x40088542:0x3ffb1e80 0x400d4e46:0x3ffbfe78

Core 0 register dump:
PC : 0x400f1bc2 PS : 0x00060d34 A0 : 0x800ea5c2 A1 : 0x3ffbc130
A2 : 0x00000000 A3 : 0x00000001 A4

I have no idea what I'm doing wrong, Is there a simpler way just to make sure the Music Maker is working? I had to solder the pins on myself so there could be an error there but I'm generally pretty good at soldering. Is there some kind of blink program I could run to test the Music Maker Feather.

Any guidance gratefully appreciated.

Dennis

PRODUCTS I'M USING:
Assembled Adafruit HUZZAH32 – ESP32 Feather Board - with Stacking Headers PID: 3619

Music Maker FeatherWing w/ Amp - MP3 OGG WAV MIDI Synth Player - Stereo 3W Amplifier PID: 3436

Mono Enclosed Speaker with Plain Wires - 3W 4 Ohm PID: 4445

imruffsdad
 
Posts: 18
Joined: Sun Mar 30, 2014 1:21 pm

Re: ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by imruffsdad on Sun Aug 01, 2021 3:10 pm

Just tried feather_player example and this time it appears to load and I get a beeping tone from my speakers repeatedly but the Serial monitor fills up with gobbeldie goop and it just keeps beeping. Tried "Sending" some commands from the Serial Monitor and it just keeps beeping.

imruffsdad
 
Posts: 18
Joined: Sun Mar 30, 2014 1:21 pm

Re: ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by imruffsdad on Sun Aug 01, 2021 3:20 pm

So feather_player from the examples is my best bet so far. Plays continuous test tone and finds the SD reader and files.
When it gets to this line:
// Play a file in the background, REQUIRES interrupts!
Serial.println(F("Playing full track 001"));
musicPlayer.playFullFile("/track001.mp3");

It appears to crash with the following error:

Playing full track 001
abort() was called at PC 0x400834f5 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x40085078:0x3ffbea90 0x400852ed:0x3ffbeab0 0x400834f5:0x3ffbead0 0x40083621:0x3ffbeb00 0x400d7462:0x3ffbeb20 0x400d7529:0x3ffbeb50 0x400d27bf:0x3ffbeb70 0x400d2403:0x3ffbeb90 0x400d31c2:0x3ffbebb0 0x400d3206:0x3ffbebd0 0x400d321c:0x3ffbebf0 0x40080ef9:0x3ffbec10 0x40083a09:0x3ffbec30 0x400f1ccf:0x3ffbc6b0 0x400ea6c7:0x3ffbc6d0 0x40087792:0x3ffbc6f0 0x400862fd:0x3ffbc710

Rebooting...

imruffsdad
 
Posts: 18
Joined: Sun Mar 30, 2014 1:21 pm

Re: ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by adafruit_support_mike on Tue Aug 03, 2021 2:27 am

Try using the version that doesn’t play in the background and checks the VS1053’s ‘need more data’ pin directly.

The kind of error you’re getting happens when code makes the ESP32 wait too long.

Unlike other microcontrollers, the ESP8266 and ESP32 have simple, built-in operating systems that keep all the radios happy while the code you’ve uploaded does its thing. To do that, the OS has to jump away from your code periodically, usually about once every 50us if I’m remembering it correctly.

That isn’t a preemptive swap, like the kind you get in Linux, where user code can’t prevent the OS from suspending it. It’s what’s known as ‘cooperative multitasking’, where your code has to give the OS a chance to take over. That happens any time your code calls one of the ESP32’s built-in instructions, and the underlying code for Arduino sketches hands control over to the OS each time execution goes back to the beginning of loop(). Calls to delay() also get broken down into shorter chunks that make time for the OS periodically.

There are still cases where user code can tie up execution long enough for the OS to give up.. enough information has been lost that the OS can’t keep the system working any more. That’s when the OS emits messages like the ones above.

adafruit_support_mike
 
Posts: 63698
Joined: Thu Feb 11, 2010 2:51 pm

Re: ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by imruffsdad on Sun Aug 08, 2021 3:40 pm

I'm just running examples that came with include file referenced on the parts page for the Music Maker.
I switched to player_simple and received this error:

12:27:03.675 -> Adafruit VS1053 Simple Test
12:27:03.675 -> Guru Meditation Error: Core 1 panic'ed (Illegal Instruction). Exception was unhandled.
12:27:03.769 -> Memory dump at 0x40126efc:

note: there is no space on the word in parenthesis but if you put Illegal and Instruction together without a space this forum system marks it as a spam word.

Interesting note: I accidently uploaded this sketch to my Feather board without the Music Maker attached and it gave me the same error as reported here.


Code: Select all | TOGGLE FULL SIZE
/***************************************************
  This is an example for the Adafruit VS1053 Codec Breakout

  Designed specifically to work with the Adafruit VS1053 Codec Breakout
  ----> https://www.adafruit.com/products/1381

  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries. 
  BSD license, all text above must be included in any redistribution
 ****************************************************/

// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>

// define the pins used
//#define CLK 13       // SPI Clock, shared with SD card
//#define MISO 12      // Input data, from VS1053/SD card
//#define MOSI 11      // Output data, to VS1053/SD card
// Connect CLK, MISO and MOSI to hardware SPI pins.
// See http://arduino.cc/en/Reference/SPI "Connections"

// These are the pins used for the breakout example
#define BREAKOUT_RESET  9      // VS1053 reset pin (output)
#define BREAKOUT_CS     32     // VS1053 chip select pin (output)
#define BREAKOUT_DCS    33      // VS1053 Data/command select pin (output)
// These are the pins used for the music maker shield
#define SHIELD_RESET  -1      // VS1053 reset pin (unused!)
#define SHIELD_CS     7      // VS1053 chip select pin (output)
#define SHIELD_DCS    6      // VS1053 Data/command select pin (output)

// These are common pins between breakout and shield
#define CARDCS 14     // Card chip select pin
// DREQ should be an Int pin, see http://arduino.cc/en/Reference/attachInterrupt
#define DREQ 15       // VS1053 Data request, ideally an Interrupt pin

Adafruit_VS1053_FilePlayer musicPlayer =
  // create breakout-example object!
  //Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS);
  // create shield-example object!
  Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);
 
void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit VS1053 Simple Test");

  if (! musicPlayer.begin()) { // initialise the music player
     Serial.println(F("Couldn't find VS1053, do you have the right pins defined?"));
     while (1);
  }
  Serial.println(F("VS1053 found"));
 
   if (!SD.begin(CARDCS)) {
    Serial.println(F("SD failed, or not present"));
    while (1);  // don't do anything more
  }

  // list files
  printDirectory(SD.open("/"), 0);
 
  // Set volume for left, right channels. lower numbers == louder volume!
  musicPlayer.setVolume(20,20);

  // Timer interrupts are not suggested, better to use DREQ interrupt!
  //musicPlayer.useInterrupt(VS1053_FILEPLAYER_TIMER0_INT); // timer int

  // If DREQ is on an interrupt pin (on uno, #2 or #3) we can do background
  // audio playing
  musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT);  // DREQ int
 
  // Play one file, don't return until complete
  Serial.println(F("Playing track 001"));
  musicPlayer.playFullFile("/track001.mp3");
  // Play another file in the background, REQUIRES interrupts!
  Serial.println(F("Playing track 002"));
  musicPlayer.startPlayingFile("/track002.mp3");
}

void loop() {
  // File is playing in the background
  if (musicPlayer.stopped()) {
    Serial.println("Done playing music");
    while (1) {
      delay(10);  // we're done! do nothing...
    }
  }
  if (Serial.available()) {
    char c = Serial.read();
   
    // if we get an 's' on the serial console, stop!
    if (c == 's') {
      musicPlayer.stopPlaying();
    }
   
    // if we get an 'p' on the serial console, pause/unpause!
    if (c == 'p') {
      if (! musicPlayer.paused()) {
        Serial.println("Paused");
        musicPlayer.pausePlaying(true);
      } else {
        Serial.println("Resumed");
        musicPlayer.pausePlaying(false);
      }
    }
  }

  delay(100);
}


/// File listing helper
void printDirectory(File dir, int numTabs) {
   while(true) {
     
     File entry =  dir.openNextFile();
     if (! entry) {
       // no more files
       //Serial.println("**nomorefiles**");
       break;
     }
     for (uint8_t i=0; i<numTabs; i++) {
       Serial.print('\t');
     }
     Serial.print(entry.name());
     if (entry.isDirectory()) {
       Serial.println("/");
       printDirectory(entry, numTabs+1);
     } else {
       // files have sizes, directories do not
       Serial.print("\t\t");
       Serial.println(entry.size(), DEC);
     }
     entry.close();
   }
}

imruffsdad
 
Posts: 18
Joined: Sun Mar 30, 2014 1:21 pm

Re: ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by adafruit_support_mike on Mon Aug 09, 2021 10:19 am

This part of your code tells the microcontroller to use interrupts:

Code: Select all | TOGGLE FULL SIZE
  // If DREQ is on an interrupt pin (on uno, #2 or #3) we can do background
  // audio playing
  musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT);  // DREQ int

adafruit_support_mike
 
Posts: 63698
Joined: Thu Feb 11, 2010 2:51 pm

Re: ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by imruffsdad on Mon Aug 09, 2021 1:22 pm

Thanks. I commented out that whole section and it played both the mp3's I had on the disk. Now I can play around with what I wanted to do.
The code I shared wasn't mine, it was code provided from ADAFRUIT when you install the library for your Music Maker wing.
The code in the void loop doesn't work because we're no longer in the background. Is there a way to have this wing play in the background
without getting the panic? No biggie, I'm off to the races with what I need to do and I appreciate all your help.
Thanks,
Dennis

imruffsdad
 
Posts: 18
Joined: Sun Mar 30, 2014 1:21 pm

Re: ESP32 Huzzah32 & Featherwing Music Maker panic'ed

by adafruit_support_mike on Tue Aug 10, 2021 3:53 pm

Glad to hear it's working.

imruffsdad wrote:Is there a way to have this wing play in the background without getting the panic?

You should be able to use the .startPlaying() method as long as you call .feedBuffer() at regular intervals.. the top or bottom of loop() usually works.

adafruit_support_mike
 
Posts: 63698
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.