Bug with core libraries
-
- Posts: 15
- Joined: Wed Sep 20, 2017 10:10 am
Bug with core libraries
Dear Espressif Technical Support,
We are making a Development with the vision to acquire a considerable amount of ESP32 chips to implement in our solutions, but firstly is necessary to present the stable solution and we are having problems with one bug.
The app makes an interface between BTL and Wifi functions (specially UDP client connections) using the UART as bridge, and making the ESP32 works as peripheral with a master Board.
The problem is that time to time, when we need to send several data by UDP and with a considerable speed, suddenly the chip has a reset and we had to make the debug of the error, it seems to be provoked by something wrong in core libraries of ESP-IDF. But it happens suddenly, surely it will occur a reset, but sometimes before than others times. By the way, we update our environment with the latest version of toolchain and IDF to make the debugging and tests.
Please take attention to this issue because it is important to finish in time and we are waiting for your comments.
Really, we appreciate your attention,
Jonathan Gómez
Hardware development.
The images with the debug data are attached.
We are making a Development with the vision to acquire a considerable amount of ESP32 chips to implement in our solutions, but firstly is necessary to present the stable solution and we are having problems with one bug.
The app makes an interface between BTL and Wifi functions (specially UDP client connections) using the UART as bridge, and making the ESP32 works as peripheral with a master Board.
The problem is that time to time, when we need to send several data by UDP and with a considerable speed, suddenly the chip has a reset and we had to make the debug of the error, it seems to be provoked by something wrong in core libraries of ESP-IDF. But it happens suddenly, surely it will occur a reset, but sometimes before than others times. By the way, we update our environment with the latest version of toolchain and IDF to make the debugging and tests.
Please take attention to this issue because it is important to finish in time and we are waiting for your comments.
Really, we appreciate your attention,
Jonathan Gómez
Hardware development.
The images with the debug data are attached.
- Attachments
-
- Debug2.jpg (152.26 KiB) Viewed 12841 times
-
- Debug1.jpg (79.89 KiB) Viewed 12841 times
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: Bug with core libraries
What version of ESP-IDF do you use, and what development hardware?
-
- Posts: 15
- Joined: Wed Sep 20, 2017 10:10 am
Re: Bug with core libraries
The ESP-IDF release v2.1, and the objective is with the ESP32 is provide our terminals with the possibility of work with WiFi and BTL technology, and the way to communicate our terminals with ESP32 is it by UART, then the ESP32 works as a bridge: Terminal < == > (WiFi/BTL). We only are interested in get the BTL devices arounds us and send processed info by UDP. We almost have this project but we need to force the system and test it by a long period of time before to pass the next step.
-
- Posts: 15
- Joined: Wed Sep 20, 2017 10:10 am
Re: Bug with core libraries
The ESP-IDF release v2.1, and the objective is with the ESP32 is provide our terminals with the possibility of work with WiFi and BTL technology, and the way to communicate our terminals with ESP32 is it by UART, then the ESP32 works as a bridge: Terminal < == > (WiFi/BTL). We only are interested in get the BTL devices arounds us and send processed info by UDP. We almost have this project but we need to force the system and test it by a long period of time before to pass the next step.
Note: I was not sure about the reply was uploaded correctly.
Note: I was not sure about the reply was uploaded correctly.
-
- Posts: 15
- Joined: Wed Sep 20, 2017 10:10 am
Re: Bug with core libraries
I need to make a correction, we had must tested with 2 combinations:
1.- crosstool-NG crosstool-ng-1.22.0-61-gab8375a with ESP-IDF release v2.1
2.- crosstool-NG crosstool-ng-1.22.0-73-ge28a011 with the last ESP-IDF version downloaded from our git hub official site (we are not sure of the number of release)
In both cases the result is it the same. Really thanks for your time.
1.- crosstool-NG crosstool-ng-1.22.0-61-gab8375a with ESP-IDF release v2.1
2.- crosstool-NG crosstool-ng-1.22.0-73-ge28a011 with the last ESP-IDF version downloaded from our git hub official site (we are not sure of the number of release)
In both cases the result is it the same. Really thanks for your time.
Re: Bug with core libraries
This looks like a stack overflow (garbage in the PC value), or memory corruption. Could you please check whether you have the following stack overflow checking options enabled in menuconfig?
1. CONFIG_FREERTOS_CHECK_STACKOVERFLOW: http://esp-idf.readthedocs.io/en/latest ... ckoverflow
2. CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK: http://esp-idf.readthedocs.io/en/latest ... d-of-stack
1. CONFIG_FREERTOS_CHECK_STACKOVERFLOW: http://esp-idf.readthedocs.io/en/latest ... ckoverflow
2. CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK: http://esp-idf.readthedocs.io/en/latest ... d-of-stack
-
- Posts: 15
- Joined: Wed Sep 20, 2017 10:10 am
Re: Bug with core libraries
My configuration was:
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
And I tested with your advice:
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
Now I got the same resets while I am sending by UDP but without message, and other times I got this debug data:
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
And I tested with your advice:
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
Now I got the same resets while I am sending by UDP but without message, and other times I got this debug data:
- Attachments
-
- Debug Data.jpg (114.75 KiB) Viewed 12749 times
Re: Bug with core libraries
You may get more useful info if you disable GDBStub and leave just the default panic handler ("print registers and reboot" enabled).
Also, judging by the path you seem to be using BTStack... Are you able to reproduce the issue without it?
Also, judging by the path you seem to be using BTStack... Are you able to reproduce the issue without it?
-
- Posts: 15
- Joined: Wed Sep 20, 2017 10:10 am
Re: Bug with core libraries
OK, I will change that option and I had tested before without BTL, but still exists the problem.
-
- Posts: 15
- Joined: Wed Sep 20, 2017 10:10 am
Re: Bug with core libraries
IMPORTANT: Really it seems that we have improved the performance with the program with your help and I believe we are closer to have the solution, as you say, the problem seems to be from 2 sources WiFi and BTL, I attach the debug info when suddenly the program breaks with three possible break points, and aditionally one issue in bt.c line 225.
Please, help us orienting to finish this project, remember it is just an application with some bluetooth fuctions in a inquiry BTL and transmit and receive data by UDP throught UART communication.
Thank you again
Please, help us orienting to finish this project, remember it is just an application with some bluetooth fuctions in a inquiry BTL and transmit and receive data by UDP throught UART communication.
Thank you again
- Attachments
-
- Error3_sep27.JPG (106.93 KiB) Viewed 12698 times
-
- Error2_sep27.JPG (115.26 KiB) Viewed 12698 times
-
- Error1_sep27.JPG (126.65 KiB) Viewed 12698 times
Who is online
Users browsing this forum: No registered users and 14 guests