Device crashing on boot up? guru meditation

Hello, I have run into an error that im not sure whats causing it. I have went in and wrote serial.println's into a lot of my functions just to see whats happening, not finding much, will post the output as well.

alarm_volume = 100
LED_strip_mode = 0
LED_strip_pin = 25
LED_strip_count = 10
LED_strip_brightness = 2
vibration_mode = 0
vibration_pin = 26
vibration_strength = 512
micro_dot_pHAT = 0
info_line = 1
brightness1 = 50
brightness2 = 100
brightness3 = 10
date_format = 0
time_format = 0
NO invert_display defined = -1
display_rotation = 1
temperature_unit = 1
disable_web_server = 0
NO [wlan0] ssid
NO [wlan0] pass
[wlan1] ssid = EmpireXerxes
[wlan1] pass = Empire001
NO [wlan2] ssid
NO [wlan2] pass
NO [wlan3] ssid
NO [wlan3] pass
NO [wlan4] ssid
NO [wlan4] pass
NO [wlan5] ssid
NO [wlan5] pass
NO [wlan6] ssid
NO [wlan6] pass
NO [wlan7] ssid
NO [wlan7] pass
NO [wlan8] ssid
NO [wlan8] pass
NO [wlan9] ssid
NO [wlan9] pass
No invert_display defined in INI.
Entered playWAV
volumeGain:1.17
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x401a6e79  PS      : 0x00060530  A0      : 0x800f28ce  A1      : 0x3ffb1eb0
A2      : 0x3ffb21f8  A3      : 0x3f4151bc  A4      : 0xe0000000  A5      : 0x3ff2b851
A6      : 0x00000002  A7      : 0x00060323  A8      : 0x8000beb2  A9      : 0x3ffb1e90
A10     : 0x00000000  A11     : 0x00000044  A12     : 0xffffff40  A13     : 0x3fdfffed
A14     : 0x00000000  A15     : 0x00000007  SAR     : 0x0000001c  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x4008ec91  LEND    : 0x4008eca1  LCOUNT  : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x401a6e79:0x3ffb1eb0 0x400f28cb:0x3ffb1ed0 0x400de1f1:0x3ffb1ef0 0x400e0867:0x3ffb1f20 0x400f8276:0x3ffb1fb0 0x40091c4e:0x3ffb1fd0

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff001

I am GUESSING that maybe it's caused by volumegain 1.17? Maybe it doenst go above 1.0? Not sure what would cause that unless in my float i did something wrong. If so ill post the audio code (float and variable) to see if you guys can help

however if its not a volume gain problem i am totally lost
serial output:

Entered playWAV
volumeGain:1.17
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x401a6e79  PS      : 0x00060530  A0      : 0x800f28ce  A1      : 0x3ffb1eb0
A2      : 0x3ffb21f8  A3      : 0x3f4151bc  A4      : 0xe0000000  A5      : 0x3ff2b851
A6      : 0x00000002  A7      : 0x00060323  A8      : 0x8000beb2  A9      : 0x3ffb1e90
A10     : 0x00000000  A11     : 0x00000044  A12     : 0xffffff40  A13     : 0x3fdfffed
A14     : 0x00000000  A15     : 0x00000007  SAR     : 0x0000001c  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x4008ec91  LEND    : 0x4008eca1  LCOUNT  : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x401a6e79:0x3ffb1eb0 0x400f28cb:0x3ffb1ed0 0x400de1f1:0x3ffb1ef0 0x400e0867:0x3ffb1f20 0x400f8276:0x3ffb1fb0 0x40091c4e:0x3ffb1fd0

Rebooting...
got ␀M5Core2 initializing...axp: vbus limit off
axp: gpio1 init
axp: gpio2 init
axp: rtc battery charging enabled
axp: esp32 power voltage was set to 3.35v
axp: lcd backlight voltage was set to 2.80v
axp: lcd logic and sdcard voltage preset to 3.3v
axp: vibrator voltage preset to 2v
touch: FT6336 ready (fw id 0x10 rel 1, lib 0x300E)
OK
GOT SD.BIGIN
passed system checks
PACISCREEN GOOD
M5Stack CORE2 code starting
Free Heap: 234748
SD Card Type: SDHC
SD Card Size: 15193 MB
Ini file exists
section 'config' has an entry 'PA_CI_1' with value 
section 'config' has an entry 'token' with value
bootpic = null (was a file on sd, took out to test)

[wlan1] ssid = EmpireXerxes
[wlan1] pass = **************
No invert_display defined in INI.
Entered playWAV
volumeGain:1.17
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x401a6e79  PS      : 0x00060530  A0      : 0x800f28ce  A1      : 0x3ffb1eb0
A2      : 0x3ffb21f8  A3      : 0x3f4151bc  A4      : 0xe0000000  A5      : 0x3ff2b851
A6      : 0x00000002  A7      : 0x00060323  A8      : 0x8000beb2  A9      : 0x3ffb1e90
A10     : 0x00000000  A11     : 0x00000044  A12     : 0xffffff40  A13     : 0x3fdfffed
A14     : 0x00000000  A15     : 0x00000007  SAR     : 0x0000001c  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x4008ec91  LEND    : 0x4008eca1  LCOUNT  : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x401a6e79:0x3ffb1eb0 0x400f28cb:0x3ffb1ed0 0x400de1f1:0x3ffb1ef0 0x400e0867:0x3ffb1f20 0x400f8276:0x3ffb1fb0 0x40091c4e:0x3ffb1fd0

Rebooting...

Now im thinking its either volume, or the playwav command (playwav has always worked before, i just added new entries to the case list) OR im complelty out of it and don't know what im saying lol.

Any help would be appreciated.

Run the Exception Decoder.

I would use that however I'm not using arduino ide. I'm using vscode and platform io and last time I trued opening my platform io project in the ide it wouldn't build

I was able to run it from the firmware.elf file platform io generated. this is the result

PC: 0x401a6e79: AudioFileSourceID3::isOpen() at C:/Users/Administrator.MYTDS/Documents/Arduino/libraries/ESP8266Audio/src/AudioFileSourceID3.cpp line 269
EXCVADDR: 0x00000000

Decoding stack results
0x401a6e79: AudioFileSourceID3::isOpen() at C:/Users/Administrator.MYTDS/Documents/Arduino/libraries/ESP8266Audio/src/AudioFileSourceID3.cpp line 269
0x400f28cb: AudioGeneratorWAV::begin(AudioFileSource*, AudioOutput*) at C:/Users/Administrator.MYTDS/Documents/Arduino/libraries/ESP8266Audio/src/AudioGeneratorWAV.cpp line 286
0x400de1f1: playWAV(char, int) at src/audiotest.h line 78
0x400e0867: setup() at C:/Users/Administrator.MYTDS/Documents/PlatformIO/Projects/pa-ci1/src/pa-ci1.ino line 2767
0x400f8276: loopTask(void*) at C:/Users/Administrator.MYTDS/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp line 18
0x40091c4e: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

which is odd because none of these things have given me errors before i didn't even touch half of these i literally just added a couple more cases to my switch list

And these i have no idea why they arent working

0x400e0867: setup() at C:/Users/Administrator.MYTDS/Documents/PlatformIO/Projects/pa-ci1/src/pa-ci1.ino line 2767
0x400f8276: loopTask(void*) at C:/Users/Administrator.MYTDS/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp line 18
0x40091c4e: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

From: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/fatal-errors.html

This seems relevant, likely trying to dereference the NULL pointer.:

Ok that understandable, now the question is exactly what is trying to call a null value?

If a pointer points to nothing, accessing that nothing will cause an error. As the exceptions decoder suggests the error is at line 2767 in pa-ci1.ino

Let me go check that line quick I'll post the output If I don't see immediate problems with it

The line in question i am putting in {{{ }}} because i don't know how to bold it :slight_smile: but it is an else line i have included the above and below statements.

preferences.begin("paci_check", false);
    // preferences.putBool("NeedsBootstrap", cfg.is_task_bootstrapping);
    // is_task_bootstrapping = preferences.getBool("NeedsBootstrap", false);
    is_task_bootstrapping = cfg.is_task_bootstrapping;
    if(preferences.getBool("SoftReset", false)) {
      // no startup sound after soft reset and remove the SoftReset key
      snoozeUntil=preferences.getLong64("SnoozeUntil", 0);
      preferences.remove("SoftReset");
      preferences.remove("SnoozeUntil");
   {{{ } else { }}}
      // normal startup so decide by M5CPACI.INI if to play startup sound
      if(cfg.snd_warning_at_startup) {
      playWAV(paci, paci_vol); Serial.println("GOT TO STARTUP SOUND");
      }
      if(cfg.snd_alarm_at_startup) {
        play_tone(660, 400, cfg.alarm_volume);
        delay(500);
      }

Not seeing any problems really....not sure how to proceed

Think i just found it

      playWAV(paci, paci_vol); Serial.println("GOT TO STARTUP SOUND");

im using a variable there, but i dont see how that is causing a problem. (its global var) here is the definition for those to varables.

char paci = 'z';

int paci_vol = 3.0;

did i not define them right? the z should be updating to another case switch the second the device hits the void setup() one line down from power on.

You are assigning a floating point value to an integer:

int paci_vol = 3.0;

Oh dang! Your right. OK I only know how to do floats is there a better way to do volume instead of a float value that way I can use the variable?

Sorry, but "your" code is too advanced for you to not know such basic stuff.

The EXCVADDR value certainly indicates that you're dereferencing a NULL pointer. But, it wouldn't hurt to sprinkle in some checks of maximum stack usage at strategic places: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/freertos.html?highlight=water%20mark#_CPPv427uxTaskGetStackHighWaterMark12TaskHandle_t

OK so it was the variable. I just need to redefine the control to not be a float and hopefully that will sort it out

If it's open source, where is the code?

No, mismatching types will not sort a null pointer issue.

Haven't finished it yet when it's finjshed I'll be putting it up on github
Are that nieve to as where is the code when I'm obviously still working on it?

Besides, implicit conversion works just fine.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.