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

esp_hid_host demo: printing in callback causes stackoverflow or freeze (IDFGH-6369) #8028

Closed
ChrisIdema opened this issue Dec 7, 2021 · 5 comments
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@ChrisIdema
Copy link

When connecting a mouse and moving it around very fast for a few seconds causes a stack overflow or a freeze.
Message when a stack overflow is detected:

ERROR A stack overflow in task esp_bt_hidh_eve has been detected.

Increasing the stack size of "esp_bt_hidh_events" task from 2048 to 4096 prevents a stack overflow when using a BT keyboard, but a BT mouse generates more events and still triggers a stack overflow or freeze.

A simple workaround I used is to check the system time and to only print after 200 milliseconds have passed since the last printing in this callback.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 7, 2021
@github-actions github-actions bot changed the title esp_hid_host demo: printing in callback causes stackoverflow or freeze esp_hid_host demo: printing in callback causes stackoverflow or freeze (IDFGH-6369) Dec 7, 2021
@igrr
Copy link
Member

igrr commented Dec 7, 2021

@ChrisIdema I think this should be addressed by d1c8c26 and 5266d81.

Sorry to ask the question from the issue template, but which IDF version are you using?

@ChrisIdema
Copy link
Author

ChrisIdema commented Dec 7, 2021

@igrr
I use the same version of IDF as from the example. In this case commit 2ee9140 . I think that is close to 4.3.1

Like I wrote d1c8c26 doesn't fix the stackoverflow for the mouse. Only for the keyboard.
I will check out 5266d81 .

Edit, I don't have event_stack_size in my esp_hidh_config_t. So I cannot apply that fix. The newer version of the app is worse as it doesn't work at all: #8027

@jack0c
Copy link
Collaborator

jack0c commented Jan 9, 2022

@ChrisIdema Can you try ade22c9 which fix a heap issue?

@Alvin1Zhang Alvin1Zhang added the Awaiting Response awaiting a response from the author label Jan 10, 2022
@ChrisIdema
Copy link
Author

ChrisIdema commented Jan 19, 2022

I did not try ade22c9. I'm not working on this project anymore.

@Alvin1Zhang
Copy link
Collaborator

@ChrisIdema Thanks for reporting and sharing the updates, feel free to reopen.

@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally and removed Status: Opened Issue is new labels Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

5 participants