Bug with core libraries

kalimanmer
Posts: 15
Joined: Wed Sep 20, 2017 10:10 am

Bug with core libraries

Postby kalimanmer » Thu Sep 21, 2017 4:21 pm

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.
Attachments
Debug2.jpg
Debug2.jpg (152.26 KiB) Viewed 12732 times
Debug1.jpg
Debug1.jpg (79.89 KiB) Viewed 12732 times

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: Bug with core libraries

Postby ESP_Sprite » Fri Sep 22, 2017 12:25 am

What version of ESP-IDF do you use, and what development hardware?

kalimanmer
Posts: 15
Joined: Wed Sep 20, 2017 10:10 am

Re: Bug with core libraries

Postby kalimanmer » Fri Sep 22, 2017 7:09 am

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.

kalimanmer
Posts: 15
Joined: Wed Sep 20, 2017 10:10 am

Re: Bug with core libraries

Postby kalimanmer » Fri Sep 22, 2017 7:18 am

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.

kalimanmer
Posts: 15
Joined: Wed Sep 20, 2017 10:10 am

Re: Bug with core libraries

Postby kalimanmer » Fri Sep 22, 2017 7:45 am

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.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Bug with core libraries

Postby ESP_igrr » Sat Sep 23, 2017 6:10 am

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

kalimanmer
Posts: 15
Joined: Wed Sep 20, 2017 10:10 am

Re: Bug with core libraries

Postby kalimanmer » Mon Sep 25, 2017 12:37 pm

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:
Attachments
Debug Data.jpg
Debug Data.jpg (114.75 KiB) Viewed 12640 times

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Bug with core libraries

Postby ESP_igrr » Mon Sep 25, 2017 1:10 pm

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?

kalimanmer
Posts: 15
Joined: Wed Sep 20, 2017 10:10 am

Re: Bug with core libraries

Postby kalimanmer » Mon Sep 25, 2017 2:04 pm

OK, I will change that option and I had tested before without BTL, but still exists the problem.

kalimanmer
Posts: 15
Joined: Wed Sep 20, 2017 10:10 am

Re: Bug with core libraries

Postby kalimanmer » Tue Sep 26, 2017 3:45 pm

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
Attachments
Error3_sep27.JPG
Error3_sep27.JPG (106.93 KiB) Viewed 12589 times
Error2_sep27.JPG
Error2_sep27.JPG (115.26 KiB) Viewed 12589 times
Error1_sep27.JPG
Error1_sep27.JPG (126.65 KiB) Viewed 12589 times

Who is online

Users browsing this forum: No registered users and 15 guests