Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M5StickC Plus 2 speaker is crashing program #127

Open
vectorcrumb opened this issue Sep 29, 2024 · 2 comments
Open

M5StickC Plus 2 speaker is crashing program #127

vectorcrumb opened this issue Sep 29, 2024 · 2 comments

Comments

@vectorcrumb
Copy link

Hello, I'm trying to use the Speaker on a M5StickC PLUS2. I'm using Platform.IO with the esp and arduino frameworks. The relevant setup code here is:

auto m5_cfg = M5.config();
m5_cfg.external_rtc = true;
m5_cfg.internal_spk = true;
M5.begin(m5_cfg);
M5.Speaker.setVolume(200);

I then call the speaker with:

M5.Speaker.tone(2000, 1000, 0, true);

This causes a crash. I've attached the relevant parts of the coredump below

       TCB             NAME PRIO C/B  STACK USED/FREE
---------- ---------------- -------- ----------------
0x3ffdd170         spk_task      2/2         2768/468
0x3ffc21b4             main      2/1       2544/14336
0x3ffd72ec             RFID      1/1        1120/7068
0x3ffc2914             IDLE      0/0         416/1104
0x3ffc3074             IDLE      0/0         416/1104
0x3ffde784              LCD      2/2         672/7508
0x3ffc7340              tiT    18/18         544/3028
0x3ffdec98              WDG      3/3         432/3648
0x3ffcf594        mqtt_task      5/5        880/15500
0x3ffaf788             ipc0    24/24         448/1084
0x3ffbc968             ipc1    24/24         448/1076
0x3ffc9524   arduino_events    19/19         432/3648
0x3ffc83c4          sys_evt    20/20         528/2272
0x3ffbde24        esp_timer    22/22         432/3648
0x3ffcbfc0             wifi    23/23         496/6148
0x3ffc39d4          Tmr Svc      1/1         448/1584

==================== THREAD 1 (TCB: 0x3ffdd170, name: 'spk_task') =====================
#0  0x400835a5 in panic_abort (details=0x3ffe846c "***ERROR*** A stack overflow in task spk_task has been detected.") at /home/lucas/.platformio/packages/[email protected]/components/esp_system/panic.c:408
#1  0x4008ad78 in esp_system_abort (details=0x3ffe846c "***ERROR*** A stack overflow in task spk_task has been detected.") at /home/lucas/.platformio/packages/[email protected]/components/esp_system/esp_system.c:137
#2  0x4008ece9 in vApplicationStackOverflowHook (xTask=<optimized out>, pcTaskName=0x3ffdd1a8 "spk_task") at /home/lucas/.platformio/packages/[email protected]/components/freertos/port/xtensa/port.c:407
#3  0x4008ce8d in vTaskSwitchContext () at /home/lucas/.platformio/packages/[email protected]/components/hal/esp32/include/hal/cpu_ll.h:39
#4  0x4008ae73 in _frxt_dispatch () at /home/lucas/.platformio/packages/[email protected]/components/freertos/port/xtensa/portasm.S:436

For some reason, the speaker task is crashing due to an overflow in the stack size of the task. Any ideas what could be going wrong in my config or might this be a bug?

@felmue
Copy link
Contributor

felmue commented Oct 4, 2024

Hello @vectorcrumb

your example code runs fine for me - no crash.

Are you using the latest versions of M5Unified, M5GFX and M5StickCPlus2 libraries?

Thanks
Felix

@lovyan03
Copy link
Collaborator

lovyan03 commented Nov 5, 2024

Hello, @vectorcrumb
Sorry for the late reply.

I am unable to reproduce the crash.
Please try the latest develop branch.
If you're still experiencing crashes, please provide us with the minimum source code that builds completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants