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

Stack size to small in example switch_driver (TZ-701) #284

Closed
3 tasks done
janjaeger opened this issue Mar 15, 2024 · 3 comments
Closed
3 tasks done

Stack size to small in example switch_driver (TZ-701) #284

janjaeger opened this issue Mar 15, 2024 · 3 comments
Labels

Comments

@janjaeger
Copy link

Answers checklist.

  • I have read the documentation ESP Zigbee SDK Programming Guide and tried the debugging tips, the issue is not addressed there.
  • I have updated ESP Zigbee libs (esp-zboss-lib and esp-zigbee-lib) to the latest version, with corresponding IDF version, and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.3-dev-2527-ga7d1da94b9

esp-zigbee-lib version.

1.1.2 @ 32fe286

esp-zboss-lib version.

1.1.2

Espressif SoC revision.

ESP32H2

What is the expected behavior?

abort in printf

What is the actual behavior?

message being displayed

Steps to reproduce.

Run a the HA light + switch example, with a debug and trace messages enabled

More Information.

The below fix solves the problem, however, one could also make a change where one passes the stack size for the button press task on the switch_driver_init() routine.

diff --git a/examples/common/switch_driver/src/switch_driver.c b/examples/common/switch_driver/src/switch_driver.c
index 5cb6dcd..d641487 100644
--- a/examples/common/switch_driver/src/switch_driver.c
+++ b/examples/common/switch_driver/src/switch_driver.c
@@ -136,7 +136,7 @@ static bool switch_driver_gpio_init(switch_func_pair_t *button_func_pair, uint8_
         return false;
     }
     /* start gpio task */
-    xTaskCreate(switch_driver_button_detected, "button_detected", 2048, NULL, 10, NULL);
+    xTaskCreate(switch_driver_button_detected, "button_detected", 4096, NULL, 10, NULL);
     /* install gpio isr service */
     gpio_install_isr_service(ESP_INTR_FLAG_DEFAULT);
     for (int i = 0; i < button_num; ++i) {

@janjaeger janjaeger added the Bug label Mar 15, 2024
@github-actions github-actions bot changed the title Stack size to small in example switch_driver Stack size to small in example switch_driver (TZ-701) Mar 15, 2024
@xieqinan
Copy link
Contributor

@janjaeger

You are correct. We will increase the default size. However, this is an application logic, and you can also modify it as needed.

@janjaeger
Copy link
Author

Thank you @xieqinan !

@xieqinan
Copy link
Contributor

xieqinan commented Apr 1, 2024

Hi,

The stack size of switch driver task has been enlarged to 4096, meeting the requirement. Therefore, the issue will be closed.

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

No branches or pull requests

2 participants