Open joehui opened 4 years ago
@joehui Thanks for reporting. Would you please help provide more details as suggested in the issue template? Information like elf, sdk configuration, backtrace, log outputs, commit ID, hardware and etc. would help us debug further. Thanks.
git describe --tags
to find it): v4.0xtensa-esp32-elf-gcc --version
to find it): xtensa-esp32-elf-gcc (crosstool-NG esp-2019r2) 8.2.0I have been getting these BLE related crashes as below. Sometimes the crash would go away if I change some menuconfig setting such as various bluetooth stack sizes. The crash locations are kind of random.
I should be able to keep the firmware running without crash.
Crash in the middle of running at some random non BLE related places.
See initial message.
I noticed that if I change these Stack sizes in menuconfig, the problem seems to be go away CONFIG_BT_BTC_TASK_STACK_SIZE=6572 CONFIG_BT_BTU_TASK_STACK_SIZE=8096
The original values were: CONFIG_BT_BTC_TASK_STACK_SIZE=3572 CONFIG_BT_BTU_TASK_STACK_SIZE=5096
The old values used to work. Nothing related to BLE was changed, and it suddenly stopped working. I wonder if by changing these stack sizes, I have only hidden the problem away. What are the normal expected values for these stack sizes?
I am also attaching the sdkconfig.
@joehui Thanks for your additional information, we will look into. Thanks.
Hi, @joehui
The project I have is quite big thus it is hard to provide you the project.
In our project, we use BluFi for wifi credentials configuration, and the ESP32 also connects to BLE IoT devices. This means the ESP32 acts as both the server and client. I am wondering how much of stack sizes would you recommend one to allocate for Bluedroid in such use case.
Thanks, Joseph
Hi @joehui , I have a method, you can use the freertos API ( uxTaskGetStackHighWaterMark ) to query the minimum value of the stack of the current task. Then adjust further according to this value.
https://www.freertos.org/wp-content/uploads/2018/07/FreeRTOS_Reference_Manual_V10.0.0.pdf
I have been getting these BLE related crashes as below. Sometimes the crash would go away if I change some menuconfig setting such as various stack sizes.
The crash doesn't seem to be related to what the firmware is doing at that moment. It seems like something it is doing in the background. Any idea what the cause it and how to fix it?
I am using IDF 4.0.
Thanks, Joseph