ESP32 resets on mechanical shock

GLFURTADO61
Posts: 6
Joined: Thu Jul 04, 2019 12:37 pm

Re: ESP32 resets on mechanical shock

Postby GLFURTADO61 » Tue Jul 23, 2019 6:48 pm

Well, I made some tests and saw that ESP32 crashes on transmiting a message by bluetooth. I´m using BluetoothSerial library.
This is the message from booting process after reset (the long sequence of numbers is my message ESP32 is trying to send):

15:37:30.962 -> [BluetoothSerial.cpp:174] esp_spp_cb(): ESP_SPP_SRV_OPEN_EVT
15:37:32.912 -> [V][BluetoothSerial.cpp:205] esp_spp_cb(): ESP_SPP_DATA_IND_EVT len=1 handle=129
15:37:32.946 -> Comando recebido: b
15:37:32.946 -> [V][BluetoothSerial.cpp:201] esp_spp_cb(): ESP_SPP_WRITE_EVT: 1 FREE
15:37:32.946 -> [V][BluetoothSerial.cpp:201] esp_spp_cb(): ESP_SPP_WRITE_EVT: 5 FREE
15:37:58.859 -> [V][BluetoothSerial.cpp:205] esp_spp_cb(): ESP_SPP_DATA_IND_EVT len=1 handle=129
15:37:58.893 -> Comando recebido: d
15:37:58.893 -> REF:28.10
15:38:00.506 -> Amostras lidas:67
15:38:00.540 -> d2.73283 30.07638 -61.54208 3.52672 34.27486 -61.77109 4.01527 40.25961 -62.12224 4.73283 44.42755 -62.68712 5.31299 51.20619 -62.59552 5.83207 58.00009 -63.48102 6.74810 64.00010 -64.44285 7.17558 70.48866 -64.12224 6.77864 78.36654 -63.40468 7.19085 84.56502 -63.86270 7.31299 89.77113 -63.80163 7.78627 95.83221 -64.71766 9.55727 99.26733 -65.72530 9.67941 103.20627 -66.06117 9.55727 106.09177 -65.69476 9.58780 108.18338 -65.93903 10.15269 109.06888 -65.43522 10.79391 109.92384 -66.13751 10.62597 111.52689 -66.29018 11.25193 111.89331 -66.32072 11.19086 112.38186 -66.35125 10.24429 112.94675 -66.53445 10.82444 111.75591 -65.86270 10.87025 112.62614 -66.33598 10.64124 112.53453 -66.38178 11.12979 112.19865 -66.42759 10.87025 111.93911 -66.68713 11.19086 111.80170 -66.13751 10.94658 111.03835 -65.93903 10.88551 111.67957 -65.90850 10.56490 111.22155 -66.12225 11.32826 110.61086 -66.12225 10.73284 110.41239 -66.29018 10.67177 109.51163 -66.47339 9.90841 108.29025 -65.98484 9.51147 107.64902 -65.63369 10.03055 105.92384 -65.55736 9.72521 104.38184 -65.37415 9.23666 101.32841 -65.34361 8.91605 97.64901 -65.89323 8.64124 92.90091 -65.41995 8.59543 87.45052 -64.97720 34.51914 84.65662 -67.31309 11.08399 69.22148 -63.69476 -40.74816 57.45047 -59.26727 6.99238 7.14505 -61.54208 10.32063 -10.03055 -57.23673 -52.03062 10.22902 -54.88559 -104.67192 -33.78631 -51.87794 78.65662 -18.41224 -59.96956 -27.92371 -5.46566 -55.35887 -17.08400 -42.58022 -59.60315 12.04582 -5.55726 -60.16803 -0.79389 -18.99240 -58.22910 -10.01528 -14.56491 -58.27490 14.71758 6.41222 -58.87032 -14.10689 -26.58019 -58.10696 2.16794 -31.78631 -58.76345 -0.58015 -2.39695 -58.61078 -8.74811 -20.87026 -58.65658 2.00000 -19.38934 -58.39704 -1.35878 -2.94657 -58.90086 -8.16795 -25.00767 -58.30544 3.81680 -18.04583 -58.64132 -3.89314 -11.45040 -59.11460 -5.34352 -17.60308 -58.16803 3.29772 -14.00002 -58.73292 #
15:38:00.673 ->
15:38:00.673 -> Stack smashing protect failure!
15:38:00.673 -> i
15:38:00.673 -> abort() was called ap spp_cb0):a8S3PonSPP_eR1
15:38:00.673 ->
15:38:00.673 -> Backtrace: 0x40092894:0x3ffcc4c0 0x40092ac5:0x3ffcc4e0 0x4014a873:0x3ffcc500 0x400d23a7:0x3ffcc520 0x400d2ccb:0x3ffcc570 0x400d5b51:0x3ffcc590 0x4008e7b5:0x3ffcc5b0
15:38:00.673 ->
15:38:00.673 -> Rebooting...
15:38:00.707 -> ets Jun 8 2016 00:22:57
15:38:00.707 ->
15:38:00.707 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
15:38:00.707 -> configsip: 0, SPIWP:0xee
15:38:00.707 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
15:38:00.707 -> mode:DIO, clock div:1
15:38:00.707 -> load:0x3fff0018,len:4
15:38:00.707 -> load:0x3fff001c,len:928
15:38:00.707 -> ho 0 tail 12 room 4
15:38:00.707 -> load:0x40078000,len:8424
15:38:00.707 -> ho 0 tail 12 room 4
15:38:00.707 -> load:0x40080400,len:5868
15:38:00.707 -> entry 0x4008069c
15:38:02.075 -> CPU0 reset reason:
15:38:02.075 -> SW_CPU_RESET
15:38:02.075 -> CPU1 reset reason:
15:38:02.075 -> SW_CPU_RESET
15:38:02.552 -> [BluetoothSerial.cpp:160] esp_spp_cb(): ESP_SPP_INIT_EVT
15:38:02.587 -> [BluetoothSerial.cpp:227] esp_spp_cb(): ESP_SPP_START_EVT
15:38:03.373 -> Initializando comunicação I2C com o MPU...
15:38:07.342 -> [BluetoothSerial.cpp:174] esp_spp_cb(): ESP_SPP_SRV_OPEN_EVT

Some hint?

ESP_Angus
Posts: 1897
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 resets on mechanical shock

Postby ESP_Angus » Wed Jul 24, 2019 3:24 am

Hi GLFURTADO61,

This looks like a 100% software crash (stack smashing, so buggy code is overflowing a variable on the stack). If there is some code path branch which is only executed when the accelerometer reports a high value, this may be the reason it triggers on fast movement.

BluetoothSerial.cpp is an Arduino library, right? To get more details you can decode this backtrace against your firmware ELF file:

Code: Select all

15:38:00.673 -> Backtrace: 0x40092894:0x3ffcc4c0 0x40092ac5:0x3ffcc4e0 0x4014a873:0x3ffcc500 0x400d23a7:0x3ffcc520 0x400d2ccb:0x3ffcc570 0x400d5b51:0x3ffcc590 0x4008e7b5:0x3ffcc5b0
Tools for this in Arduino are: https://github.com/espressif/arduino-es ... exceptions

Tools for this in ESP-IDF are: https://docs.espressif.com/projects/esp ... s-decoding

Who is online

Users browsing this forum: No registered users and 2 guests