Using AudioAnalyzeToneDetect crash up Teensy

digitalwire

Member
I play a WAV file from Teensy SD card to decode morse signals via the audio lib. For this I use AudioAnalyzeToneDetect. I call the function every 5ms. After a few seconds teensy hangs up and emits a humming sound, a few seconds later teensy is restarted by the internal watchdog.

How can I find out the reason for the crash?
At what time interval can AudioAnalyzeToneDetect be called?

C-like:
// Audio - begin automatically generated code
AudioInputI2S            Line_In;          //xy=67.16668701171875,58.00000762939453
AudioPlaySdWav           PlayWAV;          //xy=79.16667175292969,115.16666412353516
AudioSynthWaveformSine   Key_Mithoerton;   //xy=88.16668701171875,175
AudioMixer4              TRX_Mixer;        //xy=297.16668701171875,67.00000762939453
AudioMixer4              SPK_Mixer;        //xy=300.16668701171875,164
AudioAnalyzeToneDetect   CW_Tone_Detector; //xy=568.1666870117188,66.00000762939453
AudioOutputI2S           Line_Out;         //xy=602.1666870117188,168
AudioConnection          patchCord1(Line_In, 1, TRX_Mixer, 0);
AudioConnection          patchCord2(Line_In, 1, SPK_Mixer, 0);
AudioConnection          patchCord5(Key_Mithoerton, 0, SPK_Mixer, 1);
AudioConnection          patchCord6(Key_Mithoerton, 0, TRX_Mixer, 1);
AudioConnection          patchCord3(PlayWAV, 0, TRX_Mixer, 2);
AudioConnection          patchCord4(PlayWAV, 0, SPK_Mixer, 2);
AudioConnection          patchCord7(TRX_Mixer, CW_Tone_Detector);
AudioConnection          patchCord8(SPK_Mixer, 0, Line_Out, 0);
AudioControlSGTL5000     sgtl5000_1;       //xy=297.16668701171875,245

C-like:
void auInit() {
  AudioMemory(8);
  sgtl5000_1.enable();
  sgtl5000_1.volume(1.0);
  sgtl5000_1.lineInLevel(15);
  sgtl5000_1.lineOutLevel(21);
  sgtl5000_1.micGain(0);
  SPI.setMOSI(SDCARD_MOSI_PIN);
  SPI.setSCK(SDCARD_SCK_PIN);
  if (!(SD.begin(SDCARD_CS_PIN))) {
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }
  auSelectAudioSource(AUDIO_SRC_NONE);
}

Complete source is attached
 

Attachments

  • 01_IO.ino
    2 KB · Views: 8
  • 02_Nextion.ino
    1.8 KB · Views: 7
  • 03_Audio.ino
    3.4 KB · Views: 9
  • 04_EEPROM.ino
    234 bytes · Views: 7
  • 09_helper.ino
    4.1 KB · Views: 6
  • 10_StateMachine.ino
    4.4 KB · Views: 8
  • 99_Main.ino
    534 bytes · Views: 11
  • MorseDecoder.ino
    5.6 KB · Views: 8
On Windows Addr2line can be found here: "C:\Program Files (x86)\Arduino\hardware\tools\arm\bin\arm-none-eabi-addr2line.exe"

Here you can find some more useful info on using CrashReport and Addr2Line.
 
You can check the entry in the unofficial Teensy wiki <here> for links to descriptions of where to find the addr2line utility for both the old (1.8.x) & new (2.3.x) Arduino IDE, as well as detailed descriptions of how to use it.

Hope that helps . . .

Mark J Culross
KD5RXT
 
Back
Top