-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Problem runing tasks while BLE connected (IDFGH-7456) #9030
Comments
Hi @jrHernandezSio, Could you please decode the backtrace into a readable format? Most likely the issue is that some code is passing a NULL pointer to xRingbufferGetMaxItemSize function. The backtrace will reveal which code that is. |
Not sure how to decode the backtrace. Shall I run idf.py monitor while running the device? or can I decode post-mortem?
|
You can decode by running |
Here's the relevant link for PlatformIO address decoding: platformio/platform-espressif32#105 (comment) |
Thanks for the tip :) Really helpful Here you are. I hope you understand sth cause I do not :) It seems to fail the allocation twice (non-BLE tasks are using 2048 bytes) and it crash at the second fail.
|
The issue is that uart_driver_install function in v4.3 release was missing a check for successful allocation of tx_ring_buf ringbuffer. If the ringbuffer wasn't allocated correctly, tx_ring_buf member of uart object was NULL but the uart_driver_install function returned successfully. Subsequent access to tx_ring_buf in uart_tx_all results in a failed assertion. This was fixed in commit 73c5a68, available in v4.3.2 bugfix release. Now uart_driver_install should return with an error and print "UART driver malloc error". If you upgrade to IDF 4.3.2, the failed assertion issue will be fixed. However |
Thanks for the support. I will optimize my RAM so as to provide enough heap to the tasks. Cheers. |
No problem! If you think this and the other issue you have opened are resolved, would you consider closing them? If you have trouble optimizing the memory consumption of the bluetooth stack, feel free to open another issue on that topic, instead. We also have a couple of articles which may help you: |
Thanks. |
Hi, After RAM was optimized everything worked ok, but now we have detected some units presenting memory problems, which are not reproduced in other units of ESP32. We have similar problems described in issue #11393 Not sure if I should reopen this or keep on #11393 I am wondering how RAM gets unaccesible |
Hi,
ENVIRONMENT:
espressif32@3.3.2
ESP-IDF 4.3
While the ESP32 is connected via BLE to smartphone I have problem ringbuf module.
While connected several tasks are created and deleted severl times.
Sometimes I get the following crash:
All tasks are run in core 0. If I use core 1 for BLE I have other ringbuf error when creating the other tasks by a second time. See error here: "assertion "pxRingbuffer" failed: file "C:\Users\jr.hernandez.platformio\packages\framework-espidf\components\esp_ringbuf\ringbuf.c", line 1100, function: xRingbufferReceive"
Regards, Ramon.
The text was updated successfully, but these errors were encountered: