Page 1 of 2

Bug with core libraries

Posted: Thu Sep 21, 2017 4:21 pm
by kalimanmer
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.

Re: Bug with core libraries

Posted: Fri Sep 22, 2017 12:25 am
by ESP_Sprite
What version of ESP-IDF do you use, and what development hardware?

Re: Bug with core libraries

Posted: Fri Sep 22, 2017 7:09 am
by kalimanmer
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.

Re: Bug with core libraries

Posted: Fri Sep 22, 2017 7:18 am
by kalimanmer
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.

Re: Bug with core libraries

Posted: Fri Sep 22, 2017 7:45 am
by kalimanmer
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.

Re: Bug with core libraries

Posted: Sat Sep 23, 2017 6:10 am
by ESP_igrr
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

Re: Bug with core libraries

Posted: Mon Sep 25, 2017 12:37 pm
by kalimanmer
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:

Re: Bug with core libraries

Posted: Mon Sep 25, 2017 1:10 pm
by ESP_igrr
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?

Re: Bug with core libraries

Posted: Mon Sep 25, 2017 2:04 pm
by kalimanmer
OK, I will change that option and I had tested before without BTL, but still exists the problem.

Re: Bug with core libraries

Posted: Tue Sep 26, 2017 3:45 pm
by kalimanmer
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